Hello,

 

I am willing to change publish button caption. any ideas how can we do this? I tried to override the module but in vain.

 

Like 0

Like

1 comments

Hello,

If you want to change the caption of the publish button then you need to create a replacing schema of BaseMessagePublisherPage and in it change the value of the PublishButtonCaption localizable string

 

Show all comments

I need to make it open a panel with Open Street Map on it but my code is not working, when I click on the button I added, it gets the loading screen but doesn't show anything and the console shows an error.

My Code:

{
    showMapContainer: function() {
		var mapsConfig = {
			mapsData: []
		};
 
		mapsConfig.mapsData.push(
			{
				address: "0.0, 0.0",
				content:"<h2>Check-In</h2>",
				gpsE: "0.0",
				gpsN: "0.0",
				isCoordsItem: true,
				useCurrentUserLocation: true
			}
		);
		MapsUtilities.open({
			mapsConfig: mapsConfig,
			scope: this
		});
	}
}

Error:

Like 1

Like

1 comments
Best reply

I solved it, I needed to add the GetMapsConfig in messages:

I solved it, I needed to add the GetMapsConfig in messages:

Show all comments

Hello,

 

I have a detail in which I have added a column from another table using the "diff" array. Please see below Code. I would like the "Link" column to get hyperlinked. Unfortunately, the code I added does not seem to add hyperlink.

Can someone help please?

getShareLink: function(value) {
 
                return {
                        url: value,
                        caption: value,
 
                };
        	},
        	onShareLinkClick: function(url) {
                if (url != null) {
                        window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + 								this.get("WindowWidth"));
                        return false;
                }
   },
 
//diff array
{
	"operation": "insert",
	"name": "PsgDataGrid",
	"parentName": "Detail",
	"propertyName": "items",
	"index": 0,
	"values": {
			"itemType": Terrasoft.ViewItemType.GRID,
			"listedZebra": true,
			"collection": {"bindTo": "Collection"},
			"activeRow": {"bindTo": "ActiveRow"},
			"primaryColumnName": "Id",
			"isEmpty": {"bindTo": "IsGridEmpty"},
			"isLoading": {"bindTo": "IsGridLoading"},
			"multiSelect": {"bindTo": "MultiSelect"},
			"selectedRows": {"bindTo": "SelectedRows"},
			"sortColumn": {"bindTo": "sortColumn"},
			"sortColumnDirection": {"bindTo": "GridSortDirection"},
			"sortColumnIndex": {"bindTo": "SortColumnIndex"},
			"linkClick": {"bindTo": "linkClicked"},
			"type": "listed",
			"useListedLookupImages": true,
			"visible": {
				"bindTo": "isImageManagerDetailView",
				"bindConfig": {"converter": "getDataGridVisible"}
					},
					"listedConfig": {
						"name": "DataGridListedConfig",
						"items": [
							{
 
								"name": "Link",
								"bindTo": "Link",
								"position": {
									"column": 16,
									"colSpan": 8
								},
								"caption": Resources.localizableStrings.Link,
								"values":
								{
 
									"config": {
											"className": "Terrasoft.TextEdit",
											"linkclick": { bindTo: "onShareLinkClick"},
											"showValueAsLink": true,
											"enabled" : true,
											"href": {
											"bindTo": "Link",
											"bindConfig": {"converter": "getShareLink"}
										}
									}
								},
							}

 

Like 0

Like

8 comments

Hello,

If you want to make a text fields display as a hyperlink you need to add these parameters to the "values" part of the diff:

"showValueAsLink": true,

 "href": {

        "bindTo": "UsrLink",

        "bindConfig": {"converter": "getLinkFormat"}

 },

 "controlConfig": {

        "className": "Terrasoft.TextEdit",

        "linkclick": { bindTo: "onLinkClick"}

}

Note that "UsrLink" is the Code of the column.

And in the methods part add these methods:

            getLinkFormat: function(value) {

                return {

                    "url": value,

                    "caption": value

                };

            },

 

            onLinkClick: function(url) {

                var link = document.createElement("a");

                link.href = url;

                link.target = "_blank";

                document.body.appendChild(link);

                link.click();

                document.body.removeChild(link);

                return false;

            }

After this, your text should be displayed as a hyperlink.

Dmytro Vovchenko,

 

kindly see the code above. I have pasted the code with href, control config and showvalueaslink. It does not seem to work which is why I would like to check if the team can help here

Shivani Lakshman,

In that case, can you please show a screenshot of the detail so I can see how it looks like with values?

Sure



Shivani Lakshman,

I can see that you have two parameters named "values", inner and outer ones. Can you please try moving parameters "showValueAsLink", "bindConfig" and others to the outer "values" 

Dmytro Vovchenko,

I believe the outer values is for the detailgrid. I anyway tried outside the inner value and it still did not work. I am attaching the code

 define("FileDetailV2", ["FileDetailV2Resources", "PsgCurrentStorageImageConstants", "ViewUtilities", "ConfigurationConstants", "ConfigurationEnums", "ServiceHelper", "ProcessModuleUtilities","terrasoft", "BusinessRuleModule", "ImageListViewModel", "GridUtilitiesV2","ConfigurationGrid", "ConfigurationGridGenerator", "ConfigurationGridUtilities"],
function(Resources,PsgCurrentStorageImageConstants, ViewUtilities, ConfigurationConstants, ConfigurationEnums, ServiceHelper, ProcessModuleUtilities,Terrasoft, BusinessRuleModule) 
		{
	return {
		rules: {
		},
		attributes: {  
			"ShareButtonMenuItems": {
				dataValueType: Terrasoft.DataValueType.COLLECTION
			}
		},
 
		messages: {
		},
 		mixins: {
         ConfigurationGridUtilites: "Terrasoft.ConfigurationGridUtilities"
        },
		methods: {
 
				init: function() {
						this.callParent(arguments);
						this.loadSPConfiguration();
 
					},
 
 
 
			initLoadFilesQueryColumns: function(esq) {
				this.callParent(arguments);
				esq.addColumn("[PsgFileLink:PsgFileId].PsgCurrentStorage", "CurrentStorage");
				esq.addColumn("[PsgFileLink:PsgFileId].PsgShareableLink", "ShareLink");
 
			},
 
			getImageByCurrentStorage: function() {
 
				var imageUrl = PsgCurrentStorageImageConstants.Icons.DataBase;
				var storageType = this.get("CurrentStorage");
				if(storageType) {
					if(storageType.displayValue === "SharePoint") {
						imageUrl = PsgCurrentStorageImageConstants.Icons.Cloud;
					}
 
				}		
 
				return imageUrl;
			},
 
			decorateItem: function(item) {
				this.callParent(arguments);	
				item.columns["CurrentStorage"] = {
					caption: "",
					columnPath: "CurrentStorage",
					dataValueType: Terrasoft.DataValueType.LOOKUP,
					isLookup: true,
					name: "CurrentStorage"
				};
 
				item.defGetLookupImageUrlMethod = "getIconByCurrentStorage";
				item.getIconByCurrentStorage = this.getImageByCurrentStorage;
			},
 			addColumnLink: function(item, column) {
                this.callParent(arguments);
            },
 
			getShareLink: function(value) {
 
                return {
                        url: value,
                        caption: value,
 
                };
        	},
        	onShareLinkClick: function(url) {
                if (url != null) {
                        window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + 								this.get("WindowWidth"));
                        return false;
                }
        	}
		},
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "remove",
				"name": "DataGrid",
			},
 
			{
				"operation": "insert",
				"name": "PsgDataGrid",
				"parentName": "Detail",
				"propertyName": "items",
				"index": 0,
				"values": {
					"itemType": Terrasoft.ViewItemType.GRID,
					"listedZebra": true,
					"collection": {"bindTo": "Collection"},
					"activeRow": {"bindTo": "ActiveRow"},
					"primaryColumnName": "Id",
					"isEmpty": {"bindTo": "IsGridEmpty"},
					"isLoading": {"bindTo": "IsGridLoading"},
					"multiSelect": {"bindTo": "MultiSelect"},
					"selectedRows": {"bindTo": "SelectedRows"},
					"sortColumn": {"bindTo": "sortColumn"},
					"sortColumnDirection": {"bindTo": "GridSortDirection"},
					"sortColumnIndex": {"bindTo": "SortColumnIndex"},
					"linkClick": {"bindTo": "linkClicked"},
					"type": "listed",
					"useListedLookupImages": true,
					"visible": {
						"bindTo": "isImageManagerDetailView",
						"bindConfig": {"converter": "getDataGridVisible"}
					},
					"listedConfig": {
						"name": "DataGridListedConfig",
						"items": [
							{
								"name": "NameListedGridColumn",
								"bindTo": "Name",
								"position": {
									"column": 0,
									"colSpan": 4
								},
 
							},
							{
								"name": "VersionListedGridColumn",
								"bindTo": "Version",
								"position": {
									"column": 5,
									"colSpan": 2
								}
							},
							{
								"name": "CurrentStorage",
								"bindTo": "CurrentStorage",
								"position": {
									"column": 7,
									"colSpan": 6
								},
								"caption": Resources.localizableStrings.CurrentStorageColumnCaption,
 
							},
 
							{
								"name": "ShareLink",
								"bindTo": "ShareLink",
								"position": {
									"column": 13,
									"colSpan": 11
								},
								"caption": Resources.localizableStrings.Link,
								"values":
								{
											"showValueAsLink": "true",
											//"enabled" : true,
											"href": {
											"bindTo": "Link",
											"bindConfig": {"converter": "getLink"},
											},
 
											"controlconfig": {
												"className": "Terrasoft.TextEdit",
												"linkclick": { bindTo: "onShareLinkClick"},
 
										},
										"viewType":"url"
									}
 
							}
						]
					},
					"tiledConfig": {
						"name": "DataGridTiledConfig",
						"grid": {
							"columns": 24,
							"rows": 3
						},
						"items": [
 
						]
					},
					"linkClick": {"bindTo": "linkClicked"}
				}
			},
 
			{
					"operation": "insert",
					"parentName": "Header",
					"propertyName": "items",
					"name": "Name",
					"values": {
						"generator": "HtmlControlGeneratorV2.generateHtmlControl",
						"htmlContent": {
							"bindTo": "Name"
						},
						"classes": {
							"wrapClass": ["t-label"]
						}
					}
				},
			{
				"operation": "insert",
				"name": "AddToCloudButton",
				"parentName": "Detail",
				"propertyName": "tools",
				"values": {
					"itemType": Terrasoft.ViewItemType.BUTTON,
					"tag": "addFileButton",
					"fileUpload": true,
					"filesSelected": {"bindTo": "onFileSelect"},
					"click": {"bindTo": "onAddFileClick"},
					"visible": {"bindTo": "getAddToCloudButtonVisible"},
					"imageConfig": {"bindTo": "Resources.Images.AddToCloudButtonImage"},
					 "hint": { "bindTo": "Resources.Strings.AddToCloudToolTip" } ,
				}
			},
			{
				"operation": "merge",
				"name": "AddRecordButton",
				"parentName": "Detail",
				"propertyName": "tools",
				"values": {
					"itemType": Terrasoft.ViewItemType.BUTTON,
					"tag": "addFileButton",
					"fileUpload": true,
					"filesSelected": {"bindTo": "onFileSelect"},
					"click": {"bindTo": "onAddFileClick"},
					"visible": {"bindTo": "getAddRecordButtonVisible"},
					"imageConfig": {"bindTo": "Resources.Images.AddButtonImage"}
				}
			},
			{
				"operation": "insert",
				"name": "UploadToSPRetry",
				"parentName": "Detail",
				"propertyName": "tools",
				"values": {
					"itemType": Terrasoft.ViewItemType.BUTTON,
					"click": {"bindTo": "uploadToSPRetry"},
					"visible": {"bindTo": "uploadToSPRetryButtonVisible"},
					"caption": Resources.localizableStrings.UploadToSPRetryButtonCaption
				}
			},
 
 
			]
		/**SCHEMA_DIFF*/
	};
});

for you to look at. Please let me know your suggestions.

Shivani Lakshman,

With the same issue on my end.

Federico Buffa ?,

 

The column that I wanted to hyperlink was from another table. The solution that was provided is as follows

Please try with the specific column that you want to hyperlink with the following method

addColumnLink: function(item, column) {

                const columnPath = column.columnPath;

                if (columnPath ==="[PsgFileLink:PsgFileId].PsgShareableLink") {

                    column.columnPath = "ShareLink";

                    this.callParent(arguments);

                } else {

                    this.callParent(arguments);

                }

            },

Show all comments

Hi All,

 

I am not able to replicate https://academy.creatio.com/documents/technic-sdk/7-15/how-add-auto-numbering-edit-page-field?_ga=2.112080903.283211749.1623923008-1596851256.1623923008 it successfully on our custom package. Client-side implementation is working as expected. If we try the server side, it is not working. Could anyone please help us with what I am missing? Or is there anything specific we need to do? Even I tried following https://community.creatio.com/questions/auto-numbering-server-side-doesnt-work and could double check on the parameters mentioned.

 

Image Reference

https://ibb.co/tBcFN8Y

https://ibb.co/CMQ29nV

https://ibb.co/cDCBbFC

https://ibb.co/T12tWK7

 

Thanks in advance.

Like 0

Like

3 comments

In addition to the above, I could see the source code section on the downloaded https://academy.creatio.com/docs/node/2311 package with many autogenerated function related to event triggers. If I check my custom object it only has getter and setter for each columns.

To autogenerate the source code I have tried 

1. Generate schemas

2. Publish

3. Complie

All options I have tried but Source code is not generated.

 

 

Thanks

From the screenshots it look like the column you're storing the number in is "UsrCode", however the screenshots show you're attempting to set that in a column named "Code".

Change the line that says:

Entity.SetColumnValue("Code", UserTask1.ResultCode);

To this:

Entity.SetColumnValue("UsrCode", UserTask1.ResultCode);

Secondly, it's unlikely that the name of the UserTask component (the element titled "Generate ordinal number" in your screenshot) is really just UserTask1 (unless you've changed it to that). To find it's name, select that element, then click the three-dot button on the top of the properties on the right and switch to advanced mode to see the name. Then change the "UserTask1" part of the code in both script tasks to that name (it's likely something like UserTask_ followed by random numbers/letters)

Ryan

Ryan Farley,

 

Thanks for your reply. I have double checked my code and I have changed it into "UserTask1" also I have shown 2 examples where I am trying to follow the tutorial with property value as "Code" and my custom section with the property as "UsrCodee".

 

Also, I see this as because of missing source code details for my custom section than the sample SDK which was referenced in the document.

 

Thanks,

Altaf Hussian

 

Show all comments

Hi,

 

Once the activity is created by DCM, I want to show only the activity which is assigned to the current user. Any lead woul help.

 

Regards,

Sourav

Like 1

Like

3 comments

Hello,

 

You can create a business process that grants read permission to an activity only to its owner.

 

More about the business process element "Change access rights":

https://academy.creatio.com/docs/user/bpm_tools/process_elements_refere…

Cherednichenko Nikita,

 

I have already tried this approach. Although it works perfectly fine for Activity section, but under DCM it still shows the Activity which I want to show or hide conditionally.

 

Regards,

Sourav

Sourav Kumar Samal,

 

If you remove read permissions for other users, then only the responsible user will be able to see this record.

Show all comments

Hello,

 

I need to make a button visible based on a few conditions

1. If current user contact record has a lookup value of "Approver"

and

2. If account record of the current user contact has lookup value "Enterprise"

 

Since there are 2 tables to be queried, I understand I need to use callbacks and chaining. This does not seem to work well for me. I have also tried passing a callback function within a callback function, but still its not working well. Can someone please give an example of multiple callbacks?

 

Thanks

Like 1

Like

2 comments

There's no need for the multiple callbacks since this can be done in a single ESQ query. For example, the ESQ below retrieves both the current user's Type value as well as the current user's account Type value in the same call.

var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: "Contact"
});
 
esq.addColumn("Type");
esq.addColumn("Account.Type", "AccountType");
 
esq.getEntity(Terrasoft.SysValue.CURRENT_USER_CONTACT.value, function (result) {
    if (result.success) {
        var conType = result.entity.values.Type,
            accType = result.entity.values.AccountType;
 
        if ((conType &amp;&amp; conType.displayValue == "Approver")
            &amp;&amp; (accType &amp;&amp; accType.displayValue == "Enterprise")) {
            // do something
        }
    }
}, this);

However, to nest a ESQ in a callback of another ESQ it would look like this: 

var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
	rootSchemaName: "Contact"
});
 
esq.addColumn("Type");
esq.addColumn("Account");
 
esq.getEntity(Terrasoft.SysValue.CURRENT_USER_CONTACT.value, function (result) {
    if (result.success) {
        var conType = result.entity.values.Type,
            account = result.entity.values.Account;
        if (conType &amp;&amp; conType.displayValue == "Approver") {
            var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
                rootSchemaName: "Account"
            });
 
            esq.addColumn("Type");
 
            esq.getEntity(account.value, function (result) {
                if (result.success) {
                    var accType = result.entity.values.Type;
                    if (accType &amp;&amp; accType.displayValue == "Enterprise") {
                        // do something
                    }
                }
            }, this);
        }
    }
}, this);

Ryan

Show all comments

How can we show the Delete Menu Item for a custom detail only for a certain role like System Administrator?

 

Like 0

Like

2 comments

Hello, 

you can restrict deletion rights with object permissions.



The following instructions can help you to achieve the result you are looking for: Object operation permissions

Thank you Kalymbet!

With this option, the Delete Item would still be "visible" to all users (although only certain roles will have permission to perform deletion as defined in object permissions).

Any way to display the option only for specific roles?

Show all comments

Hello,



I would like create multiple buttons that call a business process. Due to the number of buttons in my page, I would like to create a single button click method. This method would receive a parameter that would tell it which button was called. The parameter would then determine which field would be read.



My button method should look something like this:

 onButtonClick: function(clickedButton){
				var recordId = this.get("Id");
                var readField = "Error"; //This value should change later, will show error otherwise
 
                switch(clickedButton){
                    case "Button1":
                        readField = this.get("Field1");
                        break;
                    case "Button2":
                        readField = this.get("Field2");
                        break;
                    /*More Cases
                    .
                    .
                    .
                    */
                   default:
                    console.log(readField);
                    break;
                }
 
                var config = {
                    sysProcessName: "UsrBpToCall",
                	parameters: {
						CurrentRecordId: recordId,
						ReadField: readField,
 
					}
				};
                ProcessModuleUtilities.executeProcess(config);
}

I assume the parameter would appear in the diff section, but I do not know how to implement this functionality.



I appreciate your help!

 

Kind Regards,

Firas



 

Like 1

Like

3 comments
Best reply

Hello Firas,

If you add a tag to each button it will get passed as the fourth parameter to the click handler. 

For example:

{
	"operation": "insert",
	"parentName": "Detail",
	"propertyName": "tools",
	"name": "MyButton1",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": "Send selected invoice",
		"click": {"bindTo": "onMyButtonClick"},
		"tag": "MyButton1"
	}
}

Then you can retrieve the tag in the click function handler like this: 

onMyButtonClick: function(p1, p2, p3, tag) {
    console.log(tag);
}

Ryan

Hello Firas,

If you add a tag to each button it will get passed as the fourth parameter to the click handler. 

For example:

{
	"operation": "insert",
	"parentName": "Detail",
	"propertyName": "tools",
	"name": "MyButton1",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": "Send selected invoice",
		"click": {"bindTo": "onMyButtonClick"},
		"tag": "MyButton1"
	}
}

Then you can retrieve the tag in the click function handler like this: 

onMyButtonClick: function(p1, p2, p3, tag) {
    console.log(tag);
}

Ryan

Ryan Farley,



the solution works perfectly. Thank you.



I have a follow-up question if you do not mind. Does the tag being passed as the fourth argument mean that button click methods can take up to 4 arguments?  If that is the case how can one proceed if they were to pass more than one argument and populate p1 through p3? 



Thank you again, your Community responses and articles have been very helpful.



Firas

Hello,

 

Not sure about passing 4 arguments to the click event, I've been using the tag property only to pass the parameter needed. In your case you can bind the click-handler method to several buttons and specify different tags for it so the click-handler method could understand what to do according to the button tag.

Show all comments

Hi Community!

 

I have the following requirement:

We need to link a custom entity called reclamations to the activity. This has to be done m:n. So I have created a new link entity called ReclamationInActivity and added it as a detail to the ActivityPageV2.js.

 

When adding such a ReclamationInActivity record from the activity a new page opens and the user can open the reclamation lookup window there to select or create a reclamation.

When they choose to create a new reclamation, the account and contact have to be prefilled on the "new reclamation" page.

 

I cannot use business rules, because there is no link from the reclamation to ReclamationInActivity.

Also, using a business process is not an option, because the user would have to save the record first and we need to prefill the values.

Is there a way to achieve this by javascript somehow?

 

Thanks,

Robert

Like 0

Like

1 comments

Hi,

If I understand you correctly you want to add a value to columns "Contact" and "Account" from your activity. If so, you can use a simple esq request to get these values and set them in the init or onEntityInitialized methods.

Show all comments

Hello,

 

We have a boolean column in accounts section. If the value is checked, we would like to add an image on the header space as highlighted in yellow in image below. Is there a sample code/ recommendation for this?

 

Like 0

Like

1 comments

Hello,

You can write a simple button and display it in the center. 

{
				"operation": "insert",
				"name": "TestContainer",
				"parentName": "ActionButtonsContainer",
				"propertyName": "items",
				"values": {
					"itemType": Terrasoft.ViewItemType.CONTAINER,
					"wrapClass": ["test-container-wrapClass"],
					"items": []
				}
			},
            {
                "operation": "insert",
                "parentName": "TestContainer",
                "propertyName": "items",
                "name": "PrimaryContactButton",
                "values": {
 
                    "itemType": Terrasoft.ViewItemType.BUTTON,
                    "click": {bindTo: "testclick"},
					"visible": {bindTo: "checkVisible"},
                    "enabled": true,
                    "style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
					"imageConfig": {"bindTo": "Resources.Images.EnrichedDefaultIcon"}
                }
            }

In the method checkVisible you can return true or false based on the condition.

To make it at the center just add a new CSS style:

define("AccountPageV2", ["css!UsrDStyle"], function() {

 

.test-container-wrapClass {

        margin-left: auto;

    margin-right: auto;

    width: 6em

    }

 

Show all comments