7.12
sales_enterprise

Hello Community!

I have a query with aggregation SUM in products. But need SUMa field depend of the category.

How can make a subquery to sum based a condition 

Regards,

 

				esq.addAggregationSchemaColumn("[Product:OrderProduct:Order].UsrCost",
						this.Terrasoft.AggregationType.SUM, "ProductCost");
				esq.addAggregationSchemaColumn("[Product:OrderProduct:Order].UsrProfit",
						this.Terrasoft.AggregationType.SUM, "ProductProfit");
 
//Only if category of product is xxxxx sum the price
				esq.addAggregationSchemaColumn("[Product:OrderProduct:Order].UsrPrice",
						this.Terrasoft.AggregationType.SUM, "ProductProfit");

 

Like 0

Like

1 comments

Hello Federico,

Unfortunately, there is no way to create a complex query with subqueries via client ESQ.

You can create a business-process that will perform the request to the database, fetch all needed data, process it and display on the page.

Show all comments
7.12
sales_enterprise

Hello Community! I want to export only the data into a pachage like a file to another site. Is that posible?

Like 0

Like

1 comments

Could you clarify your business case (what you are trying to do) or give an example/more information on the end result?

If you mean just the values in a lookup: 

I know you can export data that is bound to a lookup within a package. I do not think you can create a different package and then recreate an object within that package to transfer the data connected to said package. You would have to use the same package.

If you mean data from a section (records), excel my friend. Use the excel exporter tool in the Action drop-down.

Hopefully with more information I can help further! 

Show all comments
integration
postman
DataServices
REST
7.12
sales_enterprise

Hi Everyone,



I have a case about data integration using DataService (JSON).

I have read documentation but I can't cleary understand cause example use C# languange, I'm not comfortable with that.



I have try using postman to integration DataService, but I have a trouble,

Below screenshot setting in my postman:



1. I access the login for get the cookies for Auth, I dont have any problem in Auth login.

2. I access url DataService, but I got a problem, I can't access the page what I want, the response is 403. I'm sure when I access the url I have put the cookies from auth login.

What's wrong in my method ?

Anyone have a same case or can give me some example to use DataService beside using C# language ?

Or any advise / suggest ??

 

Thanks.



FYI: I try in local BPM



SOLVED:

Check again header cookies, csrf, and format data JSON will sent to web service bpm'online.

And you can implement data service using any language along support JSON and http request.

Like 0

Like

3 comments

Hi Romadan, 

Have you tired the business process web call element? You could even try the script element.

I had the same issue and it looked to me that you have to use the C# language. 

 

Dear Romadan,

Firstly, based on the error, it is most likely, that authorization hasn't passed well. Please make sure, that you have done all the steps described in the article as an example, particularly adding needed namespaces for the DataService to work, as well as, adding methods to authenticate and create records.

https://academy.bpmonline.com/documents/technic-sdk/7-12/dataservice-adding-records 

Also, yes, as Philip already mentioned, you have to use C# language. Moreover, you can see the example of the working InsertQuery by opening web debugger application like Telerik Fiddler and tracing the insert action made within the bpm'online system. You will find all needed information on what InsertQuery is made of, as insert, update, delete queries in the system are executed by the means of DataService.

To sum up with, if you are not comfortable to use C# language I would recommend to use OData protocol instead. Please see the implementation of OData requests with its examples in the system:

https://academy.bpmonline.com/documents/technic-sdk/7-12/possibilities-bpmonline-integration-over-odata-protocol

Finally, here is a documentation on how to call configuration services using Postman:

https://academy.bpmonline.com/documents/technic-sdk/7-12/how-call-configuration-services-using-postman

Hope you find it helpful!

Regards,

Anastasia

Thanks Anastasia Botezat for your feedback.

I have solved this problem.

The problem is like you say. I dont complete passed auth in header, and have miss passed data json to web service bpm'online.



Philip Wierciszewski, I success implement data service using another language beside use c#.

Show all comments
7.12
sales_enterprise

Hello, 

Is there a way to produce printables and save their file name according to fields in the system?

Eg. Printable name to be saved in a users PC as "ClientCode_OpportunityName_ClientAmount$"

 

Thank you,

Much appreciated 

 

 

Like 0

Like

2 comments

Dear Thanos,

You need to create a replacing schema for PrintReportUtilities and overwrite the current logic. This is the out of the box logic used for naming the file:

    getCaption: function() {

            var baseCaption = this.get("Caption") || this.get("NonLocalizedCaption");

            return baseCaption + ((this.get("ConvertInPDF") || this.isDevExpressReport()) ? ".pdf" : ".docx");

        },

Feel free to develop your own logic overwriting it according to your needs.

 

With best regards,

Oleh

Oleh Chudiiovych,

Hello Oleh,

Thank you for your response. Thats perfect, however, how difficult would it be to amend that code and name the file according to those two field "UsrClientCode_UsrOpportunityName"? What would that look like (I dont have much experience with coding)

Thank you

Show all comments

Hello, 

 

I am wondering if a business process is started by a trigger, could that trigger also happen on the database side? (Example SQL script adjusting value in db so that a business process should be triggered).

 

This is the process in question:

 One the boolean flag is "1" process is suppose to run. 

 

If this is not how business processes are meant to run, how else could we trigger this business process via a database value changing? Would we have to use the DBExecutor, or other c# code on the section itself?

 

Thank you. 

Like 0

Like

1 comments

Dear Philip,

The business process won't be triggered on update/insert made directly into the database either from script task or directly via database system query.

The best option would be updating/inserting via script task within another business process where you should write the query that alters the field value with the help of EntitySchemaQuery (the manual is available in the Academy)

Oleh

Show all comments
7.12
sales_enterprise

Hi Support, i want to ask you about web tracking, how to add tracking event in button and view number on the tracking?

Like 0

Like

1 comments

Dear Lily,

Please see the following academy article, which will help you to set up website even tracking for button click.

https://academy.bpmonline.com/documents/marketing/7-12/how-set-list-tracked-events?document=marketing&document=marketing&document=marketing#HT_chapter_tracking_website_events_setup_click

In order to count number of clicks on the button, you can create a dashboard for "SiteEvent" object. Set filters to display only particular events. Please see videos on how to create a dashboard:

https://academy.bpmonline.com/video-course/dashboards?document=team

Regards,

Anastasia

Show all comments
Button
7.12
sales_enterprise

 

I have a case, I want to make two or more buttons on a page.

I've create it, but only one button appears, the second button doesn't appear.

When I refresh the page, a second button appears. Below screenshoot and the code that I use to make these 2 buttons.

Source code in section: 

define("UsrExampleBtn1Section", [], function() {
	return {
        entitySchemaName: "UsrExampleBtn",
        methods: {
            onClickTest1: function() {
                console.log("Test 1 Button Clicked..");
            },
            onClickTest2: function() {
                console.log("Test 2 Button Clicked..");
            },
        },
		diff: /**SCHEMA_DIFF*/[
            /**
             * Element Test Button 1
             */
            {
                "operation": "insert",
                "parentName": "CombinedModeActionButtonsCardLeftContainer",
                "propertyName": "items",
                "name": "Test1Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn1Caption"
                    },
                    click: {
                        bindTo: "onClickTest1"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.BLUE,
                }
            },
 
            /**
             * Element Test Button 2
             */
            {
                "operation": "insert",
                "parentName": "CombinedModeActionButtonsCardLeftContainer",
                "propertyName": "items",
                "name": "Test2Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn2Caption"
                    },
                    click: {
                        bindTo: "onClickTest2"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.GREEN
                }
            },
 
        ]/**SCHEMA_DIFF*/,
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
	};
});

Source code in page:

define("UsrExampleBtn1Page", [], function() {
	return {
		entitySchemaName: "UsrExampleBtn",
        methods: {
            onClickTest1: function() {
                console.log("Clicked Test Button 1");
			},
            onClickTest2: function() {
                console.log("Clicked Test Button 2");
            },
        },
		diff: /**SCHEMA_DIFF*/[
 
			/**
             * Element Test Button 1
             */
            {
                "operation": "insert",
                "parentName": "LeftContainer",
                "propertyName": "items",
                "name": "Test1Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn1Caption"
                    },
                    click: {
                        bindTo: "onClickTest1"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.BLUE
                }
			},
 
			/**
             * Element Test Button 2
             */
            {
                "operation": "insert",
                "parentName": "LeftContainer",
                "propertyName": "items",
                "name": "Test2Btn",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: {
                        bindTo: "Resources.Strings.TestBtn2Caption"
                    },
                    click: {
                        bindTo: "onClickTest2"
                    },
                    "style": Terrasoft.controls.ButtonEnums.style.GREEN
                }
			},
		]/**SCHEMA_DIFF*/,
	};
});

Is there something wrong in my code? I have checked the console, but there is no error. any solution for my case? Thanks



*SOLVED

Add all button caption in section and page

Like 1

Like

4 comments

Dear Romadan,

It seems you have forgot to add the caption "TestBtn2Caption" in Section schema.

I have added the same buttons with 2 captions both in Section and Page schemas and they are displayed correctly, but once I delete the caption in Section schema I was able to see the same results - the second button was appearing only after I refresh the page.

Please check the caption in the Section schema and make sure it is added correctly.

Oleh

 

I check caption 'TestBtn2Caption' in schema, and I forgot to add.

Thanks Oleh.

 

Dear Romadan & Oleh,



This case is same with my problem.

Thank you for this post and solved very helpful.



Ali

Dear Romadan,

Don't forget about me.

Show all comments
7.12
sales_enterprise

Hello Community! 

I need make enabled the save button after save based on a field condition.

Is that posible?

Regards,

Like 0

Like

5 comments

Hi Federico, could you please clarify what do you mean by "after save on a field condition"? What is the business task you want to solve? 

Dennis Trieskunov,

In the save: function() in js o onsave: i need after run the base logic function keep the button save in the edit page visible.

Dear Federico,

If you open BasePageV2 schema you will find there onSaved() function. At the last line of this method you can see:

this.set("IsChanged", this.isChanged());

So now you know where and how modification property is set.

You need to override onSaved() as you wish. For example:

methods: {

            onSaved: function() {

                this.callParent(arguments);

                this.set("IsChanged", true); // always show Save button after saving

            }

        },

Peter Vdovukhin,

hi,

Can you please clarify on opportunity section if any one filled details by using opportunity mini page after filling the details if you click on save i need to go directly to edit page of opportunity.

praveen n,

You need to override the basic save method, so to firstly run parent realization and save the record. Afterwards, use other basic functionality to open current record card. You can use the following code snippet:

save: function() {
				this.callParent(arguments);
				var elementUId = this.get("ProcessElementId");
				if (elementUId) {
					Terrasoft.ProcessModuleUtilities.tryShowProcessCard.call(this, {
						procElUId: elementUId,
						recordId: this.get("Id")
					});
				} else {
					NetworkUtilities.openEntityPage(this.getOpenEntityPageConfig());
				}
			}

Regards,

Anastasia

Show all comments
API
7.12
sales_enterprise

Hello, 

We have an API that we are trying to grab information from and show the information on a detail on the edit page. We are already the API is working and we are getting a response, however we are not sure how to now display the data on the detail. 

(We are using a detail because on the edit page we are grabbing a new values and passing them through parameters for a query done on the other server getting the API call.) 

Do you have any thought on this? We looked into virtual columns/tables but were unsuccessful.  

Like 0

Like

1 comments

Hello Philip,

So, you have a REST-service and you are looking for a way to display the response from it on some detail on the edit page. Do I understand you correctly?

The best way to achieve this goal is create a business process. Please, take a look on the [Call web service] process element.

You can find all needed information and examples on our academy web-site - https://academy.bpmonline.com/documents/technic-bpms/7-12/call-web-serv…

Also, you will find an example of setting up web service integration following this link - https://academy.bpmonline.com/documents/technic-bpms/7-12/calling-web-s…

Show all comments
7.11
sales_enterprise

Hello Community!

I would like get the current selected folder in the product catalog section. How can do that?

Regards,

 

Like 0

Like

3 comments

Hello Federico,

In order to get the current folder id in the product section, you need to subscribe to the ResultFolderFilter message in your replacing client module ProductSectionV2.

Please, see my example - http://prntscr.com/kiucak. 

Tetiana Markova,

That's work for ProductSelectionSchema? I´m trying there but is not working for me.

Federico,

I tried the same solution for ProductSelectionSchema and it didn't work for me as well.

So I looked into this case deeper and would like to share my findings with you. 



In case you need to get the current folder in the Section (for example, ProductSectionV2 as I did in my previous example) you need to subscribe for the "ResultFolderFilter" message.

Such message is published in the FolderManagerViewModel schema in the applyFolderFilters method. 

But in case of ProductSelectionSchema the publication for such message should be done in the ProductCatalogueFolderManagerViewModel, but it is missed. That's why the subscription for such message doesn't work for ProductSelectionSchema. I'll forward such question to our developers' team in order to figure out if there is any reason for that.



If such functionality is crucial for you, the only way to get it work is override applyFolderFilters method in the ProductCatalogueFolderManagerViewModel schema and implement the publication for "ResultFolderFilter" message.

So, you will need to replace the base ProductCatalogueFolderManagerViewModel in your package and modify     applyFolderFilters methods in the following way:

    applyFolderFilters: function(rowId) {

            if (this.get("IsProductSelectMode")) {

                var currentItem = this.currentEditElement;

                var currentItemType = currentItem.get("FolderType");

                var resultFiltersObject = null;

                var filtersGroupResult = Terrasoft.createFilterGroup();

                var filtersGroup = this.getFolderFilters(rowId);

                filtersGroupResult.add("FolderFilters", filtersGroup);

                var filterItem = {

                    filters: filtersGroupResult

                };

                this.sandbox.publish("UpdateCatalogueFilter", filterItem);

                var serializationInfo = filtersGroup.getDefSerializationInfo();

                serializationInfo.serializeFilterManagerInfo = true;

                resultFiltersObject = {

                    value: currentItem.get("Id"),

                    displayValue: currentItem.get("Name"),

                    filter: filtersGroup.serialize(serializationInfo),

                    folder: currentItem,

                    folderType: currentItemType

                };

                    this.sandbox.publish("ResultFolderFilter", resultFiltersObject);

            } else {

                this.callParent(arguments);

            }

        }

After that, you'll be able to receive the current folder value in the message handler method in the ProductSelectionSchema schema as was shown in my previous post. 

Please, pay attention, that it is not recommended to change the default logic of the base methods to prevent the possible issues in the future releases.

Show all comments