Hello Community!

I am developing a functionality such as, a data grid within a detail, is populated when I Click a button. In the same time when I click the button I want to reload the grid data. Which is the proper syntax for the callback function in Creatio, because i havent seen many examples in the Community.

 
			onGenerateButtonClick: function(callback,scope)
			{
				var currentRecordId = this.get("MasterRecordId");
				var args = {
                    sysProcessName: "FZProcess_dc5a9de",
                    parameters: {
                        RecordId: currentRecordId,
						Amount: FZAmount,
						Interes: FZInteres,
						StartPaymentDate: FZStartPaymentDate,
						Tenor: FZTenor		
                    } 		
                }                
				this.reloadGridData();
                ProcessModuleUtilities.executeProcess(args);  
 
			}

I want to use this.reloadGridData(); inside a callback, after the   ProcessModuleUtilities.executeProcess(args) is finished , which is the proper way to do this ? 

Like 0

Like

7 comments
Best reply

Petrika,

In your case the button appears to be a part of the page schema, not a part of the detail schema. For you to refresh the detail you'd need to use:

this.updateDetail({ detail: "NameOfDetail" });

You can find the "NameOfDetail" value to use by looking at the details section of the page code for your detail (it's not the name of the detail schema, but the name or Id it gave it when it added it to the page). The reloadGridData function only works from within the detail schema code itself. 

Hello Petrika,

Calling this.reloadGridData() is the proper function to use to refresh the detail grid from within the detail schema itself. However, you do need to call after the process completes. 

I have an article here that shows how to use a callback when executing a process: https://customerfx.com/article/programmatically-starting-a-process-from…

If you put the call to reloadGridData inside the callback then it will refresh  when the process has completed.

Ryan

Ryan Farley,

Hello Ryan,

Firstly thanks for the quick reply, your posts are very useful, each time i have a developing problem in creatio.

In this case i saw the post before. I have try it. When I use the callback like the article the page only reloads and never stops, thats why i thought of another callback syntax.

Ryan Farley,

To be more specific

I have created this button Generate on the Main Page(parent). When this button is clicked , it calls a bussines Process, which on the other hand executes a Stored Procedure(populates dhe datagrid of the details).

onGeneratePrecalButtonClick: function()
			{
var currentRecordId = this.get("Id");
		var args = {                                                                  
		sysProcessName: "FZProcess_dc5a9de",
			parameters: {
				RecordId: currentRecordId,
				Amount: this.$FZAmount,
				Interes: this.$FZInteres,
				StartPaymentDate: this.$FZStartPaymentDate,
				Tenor: this.$FZTenor		
					}
				};
              ProcessModuleUtilities.executeProcess(args);  
}

When the Business Process finishes, i want to reload the grid data of the Details, so that I dont have to press the green Button below

How can this be done ?

 

Petrika,

 

Hello,

 

There are two possible ways:

 

1) Call this method after the executeProcess method call:

this.updateDetail({
 
                        detail: "DetailNameHere"
 
                    });

2) At the end of your business process execution you need to send some message using MsgChannelUtilities class and PostMessageToAll method, create a replacing ClientMessageBridge, add your message there, add the message to the page where the detail is located, subscribe to the message and specify a handler for the received message (a simple example is here). Once the message is received the handler should call the same updateDetail method as above.

 

Best regards.

Oscar

Petrika,

In your case the button appears to be a part of the page schema, not a part of the detail schema. For you to refresh the detail you'd need to use:

this.updateDetail({ detail: "NameOfDetail" });

You can find the "NameOfDetail" value to use by looking at the details section of the page code for your detail (it's not the name of the detail schema, but the name or Id it gave it when it added it to the page). The reloadGridData function only works from within the detail schema code itself. 

Thanks very much Oscar and Ryan ! Your help was great.

Hi

Have 
"operation": "insert",
                "name": "DataGrid_md3ruqw",


in handler section of a button trying to reload using 
this.updateDetail({ detail: "DataGrid_md3ruqw" });
 

and tried 

 this.reloadGridData('DataGrid_md3ruqw');


both dont work any help will be highly appreciated 
 

Show all comments

Hi Community!

 

I can't find documentation related to the creation of records via javascript. I know I can use ESQ to query records, but is there also an API for create, update and delete?

 

Many thanks,

Robert

Like 0

Like

4 comments
Best reply

Hello Robert,

For inserting data in Javascript (InsertQuery):

https://customerfx.com/article/inserting-a-record-from-client-side-code…

For updating data in Javascript (UpdateQuery):

https://customerfx.com/article/updating-a-record-from-client-side-code-…

For deleting data in Javascript (DeleteQuery):

https://customerfx.com/article/deleting-records-from-client-side-code-u…

Ryan

Hi Robert,

 

The second possible way, if ESQ for some reasons doesn't work in your case, is to send XHR requests from the client code. An example of such request send from the client side can be found here, in your case the endpoint URL should be OData endpoint and the method to add the record to some section is similar to standard OData call from Postman.

 

Best regards,

Oscar

Hello Robert,

For inserting data in Javascript (InsertQuery):

https://customerfx.com/article/inserting-a-record-from-client-side-code…

For updating data in Javascript (UpdateQuery):

https://customerfx.com/article/updating-a-record-from-client-side-code-…

For deleting data in Javascript (DeleteQuery):

https://customerfx.com/article/deleting-records-from-client-side-code-u…

Ryan

Ryan Farley,

thanks for the links, very helpful!

 

However, I wonder if I (mis)understood the base concept here.

Dylan pointed out, that ESQ could be used for this...so is your solution what Dylan was referring to? I ask, because I thought "ESQ", which stands for EntitySchemaQuery, was only used for reading data?

In your linked code, the class used is called "Terrasoft.InsertQuery". So is this whole part of the SDK called ESQ?

 

Another question is if the permissions will be respected or not. In c#, there is the possibility to use either the Insert-class or the InsertToDB() method of the entity. AFAIK, the Insert-class will not take permissions into account or start business processes and will be executed directly against the DB. Is this what the "Terrasoft.InsertQuery"-class will execute on the server, or is it the InsertToDB() method from the entity?

 

Many thanks,

Robert

Hello Robert,

EntitySchemaQuery is only for queries/reading (technically, ESQ server side does return entity objects which can be used for updating as well). 

InsertQuery/UpdateQuery/DeleteQuery isn't technically part of EntitySchemaQuery, but are similar in purpose as they wrap calls to DataService and provide a simpler objects to use from client-side code. 

Since all of these are basically wrapper objects for using DataService, it does respect permissions. In fact, if you look at the network traffic when using Creatio, you'll find that when adding, editing, or deleting records in the Creatio client (for example, when you add an activity, edit an account, or delete something) it is issuing these same InsertQuery/UpdateQuery/DeleteQuery requests. When a bound edit page is saved, an InsertQuery or UpdateQuery is issued for the bound data on that page.

Ryan

Show all comments

Dear colleguagues

 

I need to run a process when create a new record, in this case invoke it from onEntityInitialized method just in case is a new record or a copy from another (this.isAddMode() || this.isCopyMode())

 

But don't know how to call a process from there, and how to pass parameters, is it possible?

 

Thanks in advance

Like 0

Like

3 comments
Best reply

Hi Julio,

 

You can use this article as a reference on how to trigger the process from the client and pass process parameters to the process.

 

As for calling the process upon creating a new record - onEntityInitialized is not a good choice here since the process call will be triggered once the page is loaded for adding a new record, but not once all the data on the page is specified and the record should be saved. In our case it's better to use save function and overwrite its logic. For example in a following manner:

 

1) We have a UsrTestJSON object which is a section in the system and has UsrTestJSON1Page as an edit page.

 

2) UsrTestJSON object has following columns:

 

UsrTransType - Text (250 characters) data type column

UsrPolicyNumber - Text (500 characters) data type column

UsrTransTime - Time data type column

UsrTransDate - Date data type column

3) We need to call the custom process called "Test JSON page process" with the following schema once the record is saved upon creation:

Please note that the process code is Process_20340ad and the process parameter codes should be the same as process parameter names (as an example please see UsrTransType parameter declaration).

 

4) Add the following code to the UsrTestJSON1Page schema:

define("UsrTestJSON1Page", ["ProcessModuleUtilities"], function(ProcessModuleUtilities) {
	return {
		entitySchemaName: "UsrTestJSON",
		attributes: {},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{
			"Files": {
				"schemaName": "FileDetailV2",
				"entitySchemaName": "UsrTestJSONFile",
				"filter": {
					"masterColumn": "Id",
					"detailColumn": "UsrTestJSON"
				}
			}
		}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			callCustomProcess: function() {
                var usrTransType = this.get("UsrTransType");
				var usrPolicyNumber = this.get("UsrPolicyNumber");
				var usrTransDate = this.get("UsrTransDate");
				var usrTransTime = this.get("UsrTransTime");
                var args = {
                    sysProcessName: "Process_20340ad",
                    parameters: {
                        UsrTransType: usrTransType,
						UsrPolicyNumber: usrPolicyNumber,
						UsrTransDate: usrTransDate,
						UsrTransTime: usrTransTime
                    }
                };
                ProcessModuleUtilities.executeProcess(args);
            },
			save: function(){
				this.callParent(arguments);
				if (this.isAddMode()){
					this.console.log("Adding mode!!!");
					this.callCustomProcess();
				} else if (this.isCopyMode()){
					this.console.log("Copy mode!!!");
				} else if (this.isEditMode()){
					this.console.log("Edit mode!!!");
				} else {
					this.console.log("NOT EDIT, NOT COPY, NOT ADD!!!");
				}
			},
			onUsrTestJSONPageButtonClick: function(){
				this.save();
			}
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
                "operation": "insert",
                "parentName": "ActionButtonsContainer",
                "propertyName": "items",
                "name": "UsrTestJSONPageButton",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: { bindTo: "Resources.Strings.UsrTestJSONPageButtonCaption" },
                    click: { bindTo: "onUsrTestJSONPageButtonClick" },
                    "layout": {
                        "column": 1,
                        "row": 6,
                        "colSpan": 1
                    }
                }
            },
			{
				"operation": "insert",
				"name": "UsrTransTypec0a98c8f-acb0-4d1f-9333-94ba13a0abe4",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "ProfileContainer"
					},
					"bindTo": "UsrTransType"
				},
				"parentName": "ProfileContainer",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "UsrPolicyNumber9a8b5c79-6a4f-4326-ab8e-d7c471ebc2a5",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "Header"
					},
					"bindTo": "UsrPolicyNumber"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "UsrTransDate2bfe7bc7-21d7-4024-8809-919959aa5eaa",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 1,
						"layoutName": "Header"
					},
					"bindTo": "UsrTransDate"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "UsrTransTime7cede060-4f2c-406c-a74f-1abd5679848c",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 12,
						"row": 1,
						"layoutName": "Header"
					},
					"bindTo": "UsrTransTime"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 2
			},
			{
				"operation": "insert",
				"name": "NotesAndFilesTab",
				"values": {
					"caption": {
						"bindTo": "Resources.Strings.NotesAndFilesTabCaption"
					},
					"items": [],
					"order": 0
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "Files",
				"values": {
					"itemType": 2
				},
				"parentName": "NotesAndFilesTab",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "NotesControlGroup",
				"values": {
					"itemType": 15,
					"caption": {
						"bindTo": "Resources.Strings.NotesGroupCaption"
					},
					"items": []
				},
				"parentName": "NotesAndFilesTab",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "Notes",
				"values": {
					"bindTo": "Notes",
					"dataValueType": 1,
					"contentType": 4,
					"layout": {
						"column": 0,
						"row": 0,
						"colSpan": 24
					},
					"labelConfig": {
						"visible": false
					},
					"controlConfig": {
						"imageLoaded": {
							"bindTo": "insertImagesToNotes"
						},
						"images": {
							"bindTo": "NotesImagesCollection"
						}
					}
				},
				"parentName": "NotesControlGroup",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "merge",
				"name": "ESNTab",
				"values": {
					"order": 1
				}
			}
		]/**SCHEMA_DIFF*/
	};
});

So the main idea here is calling callCustomProcess method upon record saving (this.isAddMode()):

save: function(){
				this.callParent(arguments);
				if (this.isAddMode()){
					this.console.log("Adding mode!!!");
					this.callCustomProcess();
				}

And you bind page data to the process using args object parameters:

var args = {
                    sysProcessName: "Process_20340ad",
                    parameters: {
                        UsrTransType: usrTransType,
						UsrPolicyNumber: usrPolicyNumber,
						UsrTransDate: usrTransDate,
						UsrTransTime: usrTransTime
                    }
                };

usrTransType, usrPolicyNumber, usrTransDate and usrTransTime variables are received from the page before saving the record (using this.get method).

 

So you need to develop the logic similar to described above using your own object, process and page schema. As a result the process will return the data specified when creating a new record:

Best regards,

Oscar

Hi Julio,

 

You can use this article as a reference on how to trigger the process from the client and pass process parameters to the process.

 

As for calling the process upon creating a new record - onEntityInitialized is not a good choice here since the process call will be triggered once the page is loaded for adding a new record, but not once all the data on the page is specified and the record should be saved. In our case it's better to use save function and overwrite its logic. For example in a following manner:

 

1) We have a UsrTestJSON object which is a section in the system and has UsrTestJSON1Page as an edit page.

 

2) UsrTestJSON object has following columns:

 

UsrTransType - Text (250 characters) data type column

UsrPolicyNumber - Text (500 characters) data type column

UsrTransTime - Time data type column

UsrTransDate - Date data type column

3) We need to call the custom process called "Test JSON page process" with the following schema once the record is saved upon creation:

Please note that the process code is Process_20340ad and the process parameter codes should be the same as process parameter names (as an example please see UsrTransType parameter declaration).

 

4) Add the following code to the UsrTestJSON1Page schema:

define("UsrTestJSON1Page", ["ProcessModuleUtilities"], function(ProcessModuleUtilities) {
	return {
		entitySchemaName: "UsrTestJSON",
		attributes: {},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{
			"Files": {
				"schemaName": "FileDetailV2",
				"entitySchemaName": "UsrTestJSONFile",
				"filter": {
					"masterColumn": "Id",
					"detailColumn": "UsrTestJSON"
				}
			}
		}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			callCustomProcess: function() {
                var usrTransType = this.get("UsrTransType");
				var usrPolicyNumber = this.get("UsrPolicyNumber");
				var usrTransDate = this.get("UsrTransDate");
				var usrTransTime = this.get("UsrTransTime");
                var args = {
                    sysProcessName: "Process_20340ad",
                    parameters: {
                        UsrTransType: usrTransType,
						UsrPolicyNumber: usrPolicyNumber,
						UsrTransDate: usrTransDate,
						UsrTransTime: usrTransTime
                    }
                };
                ProcessModuleUtilities.executeProcess(args);
            },
			save: function(){
				this.callParent(arguments);
				if (this.isAddMode()){
					this.console.log("Adding mode!!!");
					this.callCustomProcess();
				} else if (this.isCopyMode()){
					this.console.log("Copy mode!!!");
				} else if (this.isEditMode()){
					this.console.log("Edit mode!!!");
				} else {
					this.console.log("NOT EDIT, NOT COPY, NOT ADD!!!");
				}
			},
			onUsrTestJSONPageButtonClick: function(){
				this.save();
			}
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
                "operation": "insert",
                "parentName": "ActionButtonsContainer",
                "propertyName": "items",
                "name": "UsrTestJSONPageButton",
                "values": {
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    caption: { bindTo: "Resources.Strings.UsrTestJSONPageButtonCaption" },
                    click: { bindTo: "onUsrTestJSONPageButtonClick" },
                    "layout": {
                        "column": 1,
                        "row": 6,
                        "colSpan": 1
                    }
                }
            },
			{
				"operation": "insert",
				"name": "UsrTransTypec0a98c8f-acb0-4d1f-9333-94ba13a0abe4",
				"values": {
					"layout": {
						"colSpan": 24,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "ProfileContainer"
					},
					"bindTo": "UsrTransType"
				},
				"parentName": "ProfileContainer",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "UsrPolicyNumber9a8b5c79-6a4f-4326-ab8e-d7c471ebc2a5",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "Header"
					},
					"bindTo": "UsrPolicyNumber"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "UsrTransDate2bfe7bc7-21d7-4024-8809-919959aa5eaa",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 1,
						"layoutName": "Header"
					},
					"bindTo": "UsrTransDate"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "UsrTransTime7cede060-4f2c-406c-a74f-1abd5679848c",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 12,
						"row": 1,
						"layoutName": "Header"
					},
					"bindTo": "UsrTransTime"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 2
			},
			{
				"operation": "insert",
				"name": "NotesAndFilesTab",
				"values": {
					"caption": {
						"bindTo": "Resources.Strings.NotesAndFilesTabCaption"
					},
					"items": [],
					"order": 0
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "Files",
				"values": {
					"itemType": 2
				},
				"parentName": "NotesAndFilesTab",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "NotesControlGroup",
				"values": {
					"itemType": 15,
					"caption": {
						"bindTo": "Resources.Strings.NotesGroupCaption"
					},
					"items": []
				},
				"parentName": "NotesAndFilesTab",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "Notes",
				"values": {
					"bindTo": "Notes",
					"dataValueType": 1,
					"contentType": 4,
					"layout": {
						"column": 0,
						"row": 0,
						"colSpan": 24
					},
					"labelConfig": {
						"visible": false
					},
					"controlConfig": {
						"imageLoaded": {
							"bindTo": "insertImagesToNotes"
						},
						"images": {
							"bindTo": "NotesImagesCollection"
						}
					}
				},
				"parentName": "NotesControlGroup",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "merge",
				"name": "ESNTab",
				"values": {
					"order": 1
				}
			}
		]/**SCHEMA_DIFF*/
	};
});

So the main idea here is calling callCustomProcess method upon record saving (this.isAddMode()):

save: function(){
				this.callParent(arguments);
				if (this.isAddMode()){
					this.console.log("Adding mode!!!");
					this.callCustomProcess();
				}

And you bind page data to the process using args object parameters:

var args = {
                    sysProcessName: "Process_20340ad",
                    parameters: {
                        UsrTransType: usrTransType,
						UsrPolicyNumber: usrPolicyNumber,
						UsrTransDate: usrTransDate,
						UsrTransTime: usrTransTime
                    }
                };

usrTransType, usrPolicyNumber, usrTransDate and usrTransTime variables are received from the page before saving the record (using this.get method).

 

So you need to develop the logic similar to described above using your own object, process and page schema. As a result the process will return the data specified when creating a new record:

Best regards,

Oscar

Hi Julio,



You can trigger a business process from Client JS code using the ProcessModuleUtilities module. You can inject it as a dependency in a Client schema and call the executeProcess(args) method to call a business process. Business process parameters can be set in the parameters attribute inside the argument you pass to the executeProcess method. Request you to go through this academy link for more information.



If your use case is to trigger a business process 'after' a new record is created, there are a few ways of doing it. You could use the 'Record created' trigger in the Business process designer. Or you can also choose to do it from the service side by listening to entity events on the specific section/object. You can get more details in this academy link.



Thanks,

Shrikanth

M Shrikanth,

Thank you very much

Show all comments

Hi,



I am not sure if it is okay to leave the warning be.

But I tried to follow that I needed to declare esversion, just not sure if I've done it properly.



Any comments?



Like 0

Like

3 comments
Best reply

Solem Khan Abdusalam,

 

Hi,

 

Thank you! This is a warning message that the arrow function is supported in Ecma Script 6 only. Here is the list of browsers and their versions that support arrow functions (information copied from here):

There is a low probability that a client will have an older browser version so you can ignore this warning or use function declaration to create a method.

 

Best regards,

Oscar 

Hi Solem,

 

Unfortunately the image wasn't loaded properly, can you please reupload it or share the code itself?

 

Thank you!

 

Best regards,

Oscar

Hi,



I edited my question.

Solem Khan Abdusalam,

 

Hi,

 

Thank you! This is a warning message that the arrow function is supported in Ecma Script 6 only. Here is the list of browsers and their versions that support arrow functions (information copied from here):

There is a low probability that a client will have an older browser version so you can ignore this warning or use function declaration to create a method.

 

Best regards,

Oscar 

Show all comments

Hello community,



We are using Creatio 7.16.3 Service enterprise on-premises (Infra on AWS cloud). We have a use case where certain fields on the Creatio GUI need to send and receive real time updates for a specific user across multiple browser client instances that s/he might be using.



We have zero-ed in on Firebase real time database to maintain state on the server side. We plan to establish Creatio client - Firebase interaction via the Firebase JS SDK to send and receive real time updates. Few clarifications below - 

 

1. Have there been known instances of Creatio successfully integrating with Firebase real time database in the past? If Yes, any available material/documentation around the same would help. 

2. Are there any gotchas or limitations we need to keep in mind from an implementation, security and performance perspectives specific to the Creatio product while integrating with Firebase real time database? Eg with Service workers. 

3. Firebase provides for including the JS SDK via a CDN link. I went through this article on how to include external JS libraries- https://community.creatio.com/questions/how-include-external-js-library-bpmonline. The answer provided seems incomplete/inconclusive. Would appreciate if someone could respond to my query. 

4. Is there a way to directly inject a CDN link globally on Creatio without having to physically include the contents of the file as suggested in the above link?



Thanks in advance!

Shrikanth

Like 0

Like

1 comments

Hello Shrikanth,

Please find my answers bellow:

 

1. We have checked the existing case history but unfortunately didn't find any request related to integration with Firebase service, sorry.

 

2. Unfortunately, we don't have any specific best practices for integrations. It is necessary to use generally accepted engineering practices and instructions but we will happy to assist with any difficulties you may have.

 

3. This question was already answered in the mentioned community post. Duplicating the answer here:

"Please call jQuery.getScript function in the console and review the sources tab as I recommended and use it as an example to add your own jQuery to the system"

 

4. As of now, there is no way to use CDN link in the Creatio application. If it will be available in future releases, you will be able to find this information in the Creatio release notes.

 

Please let us know if you have any other questions.

 

Best regards,

Roman

Show all comments



Dear Community,



I was wondering if there's a comprehensive list somewhere where we can find all the attributes for the schema page.

Some of the examples are:

- In diff we can add different things like

"operation": "delete",

                    "name": "",

                    "propertyName": "",

                    "parentName": "",

                    "values": {}

Where can I find a list of things I can put in the Diff and "values"?

Same thing for messages, attributes, ...



Thank you in advance!

Like 0

Like

3 comments

Hi Yosef,

 

You can find the chain of articles here that describes multiple schema configurations:

https://academy.creatio.com/documents/technic-sdk/7-16/introduction-3

The diff array article among others describes the possbile operations that you refer to

https://academy.creatio.com/documents/technic-sdk/7-16/diff-array

 

Regards,

Dean

dean parrett,



Thank you for the quick response but this isn't exactly what I'm looking for, it sure is a great start for beginners!



What I'm looking for is like an "extended" list. If I want to enable or disable an item, I would be adding the ' "enable": true ' to the diff. This is nowhere to be found on the second link.



While programming I found bits and pieces of information of these properties in different posts, but I'm looking for something more complete in one place.



If anyone knows or has made a list like this, please let me know!

Thank you

Show all comments

I am trying to implement validation logic in client module edit page of a section.

I want to save the column value of UsrAttributeName (a lookup) into a variable.

To do this, I am using this.get("UsrAttributeName").displayValue. But when Page is loaded it hangs and console shows the error 

message: Uncaught TypeError: Cannot read property 'displayValue' of undefined 

Like 0

Like

2 comments

Hello! 

 

1. To add validation use this.addColumnValidator method in setValidationConfig method.

Please, find the example in the Academy article: https://academy.creatio.com/documents/technic-sdk/7-16/how-add-field-va…

 

2. If the column value is not defined you cannot call for its properties. Check if the column has value:

var attribute =  this.get("UsrAttributeName");

var attributeDisplayValue = attribute  && attribute.displayValue;

 

Please, let us know in case any additional information is required. 

 

Best regards,

Olga. 

Olga Avis,

Hi 

 

After debugging it turns out undefined is coming because Entity/Page is not fully loaded or when I create a new record then all fields are empty.

I could use your suggested way to assign attribute value to a variable but that would not be able to work if entity/page is not fully loaded.

 

So I used a flag in attributes with default value false and set it to true in OnEntityIntilized method.

Then I checked the flag, if it is true then the validation method will run.

 

Thanks

Ram

Show all comments

I'm trying to configure a modal lookup window by following Example 2 in this academy page https://academy.creatio.com/documents/technic-sdk/7-15/creating-detail-selection-lookup and everything works as described, but I cannot figure out how to add a default sort to the modal lookup window - are there some parameters which can be added to the config object passed to the this.openLookup method call?

 

While on that subject, are there any other potential parameters which can be added to this config object which might be useful for other tasks?

Like 0

Like

1 comments

Dear Harvey, 



There is no description for all parameters of the lookup config. The possible way is to check the existing openLookup calls. 

Sorting can be specified in sortedColumns parameter. 

You can find the example in method selectPeriod in the ForecastTab. 

Collection of columns with sorting parameters is passed to it this way: 

var config = {

    entitySchemaName: "Contact",

    multiSelect: false,

    columns: ["Name", "Account.Name"],

    sortedColumns: [{

        name: "Account.Name",

        orderPosition: 0,

        orderDirection: this.Terrasoft.core.enums.OrderDirection.ASC

    }]

};

this.openLookup(config, this.lookupCallback, this);



Kind regards, 

Roman

Show all comments

I am trying to generate a printable from the opportunity object (which will be a quote) and attach this printable to an email after generating.

 

I am getting stuck on the generate and save printable script task. 

This is the error I am getting

Terrasoft.Common.ItemNotFoundException: Value "Name" was not found.
   at Terrasoft.Core.Entities.EntityColumnValueCollection.GetByName(String name)
   at Terrasoft.Core.Entities.Entity.SetColumnValue(String valueName, Object value)
   at Terrasoft.Core.Process.UsrlabSavePrintableAndEmailQuote1Custom6.ScriptTask1Execute(ProcessExecutingContext context)
   at Terrasoft.Core.Process.ProcessFlowElement.Execute(ProcessExecutingContext context)

 

I'm not sure what the issue is. I tried hardcoding the name in the script but that doesn't seem to work either. 

 

My script action that is failing.

var reportService = new Terrasoft.Configuration.ReportService.ReportService();
Terrasoft.Configuration.ReportService.ReportData report = reportService.GenerateMSWordReport(
    (PrintableId.ToString()), ObjectId.ToString(), ConvertToPdf);
var entity = UserConnection.EntitySchemaManager.GetInstanceByName("Opportunity");
var fileEntity = entity.CreateEntity(UserConnection);
fileEntity.SetDefColumnValues();
fileEntity.SetColumnValue("Id", OpportunityId);
fileEntity.SetColumnValue("TypeId", AttachmentType);
fileEntity.SetColumnValue("Name", "ExamplePrintable.docx");
fileEntity.SetColumnValue("Data", report.Data);
fileEntity.Save();
 
 
return true;

 

Let me know if you need any more information.

Also, any documentation where I can read up on this myself. Like the fileEntity variable, or just how this code works in general.

 

Any help is appreciated thanks!

Like 0

Like

1 comments

Hi Tyler,

Implemented this week a very similiar feature throw a business process.

I reversed engeneered this market place app: https://marketplace.bpmonline.com/template/creating-quotes-opportunities

But I used the user task instead of the script task in the processes as I was getting in trouble passing the process parameters to the script task.

 

Hope it helps,

Luis

Show all comments

Hi, How am I able to return a value of a Lookup (the Name) using ESQ, JS? I have defined the Lookup as an attribute: "DevCertPublicationFrequency": { DataValueType: Terrasoft.DataValueType.LOOKUP, }, I have the following function: getLookupValue: function (DevCertPublicationFrequency, safe) { var column = this.columns[DevCertPublicationFrequency]; if (column && (column.isLookup || true)) { var columnValue = this.get(DevCertPublicationFrequency); this.set("DevCertPublicationFrequency", columnValue); } }, When the record is saved I want to check the value of the Lookup and call a function if the Lookup value selected prior to the save = 'Daily' Save: function() { this.callParent(arguments); this.getLookupValue(); var textmessage = "Verification will be performed"; //if periodical edition = daily then perform verification var DevCertPubFrequency = this.get("DevCertPublicationFrequency"); if (DevCertPubFrequency === "Daily") { Terrasoft.showInformation(textmessage); this.verification(); } },

Like 0

Like

1 comments

It's pretty easy to get a value from a lookup attribute using this.get("NameOfLookupAttribute"). Please debug your js code using the article below 

https://academy.bpmonline.com/documents/technic-sdk/7-13/client-code-debugging 

Show all comments