7.16
Service_Creatio_enterprise_edition

Hello all,

Im working on a business process to send an email from in the document section, i want to include any attachment in the object to the email through the process. 

Any advise on which object i should pull the attachment from and whats the best way to do this is welcomed.

Thank you

Like 0

Like

1 comments

Hello,

 

You can use the object Document attachment to read attachments. The send element should be implemented in the business process using a script task element and creating a correct script for it. You can find an example of such task here: https://community.creatio.com/questions/add-orders-attachments-email

 

Best regards,

Angela

Show all comments
map
ShowOnMap
7.16
Service_Creatio_enterprise_edition

Hello all,

 

I am trying to use the show on map function from the contact section page and add it to the actions on the contact record page.

I have added the function to the page schema and added it to the actions menu. However, when I load the page, the button works and displays the map but it doesn't display the caption string on the button. 

Though oddly, when I reload the page, the string appears but the map then won't load.

 

What could be causing this?

Like 0

Like

3 comments

Hello Kevin,

 

Caption is not displayed since once the edit page is reviewed in combined mode then localizable values are being received from the section schema. To resolve this problem you need to:

 

1) Add the same localizable value to the ContactSectionV2 schema as on the ContactPageV2 schema

2) Add this part of code to the contact page schema:

 

define("ContactPageV2",["ContactPageV2Resources", "MapsHelper", "MapsUtilities"],

        function(resources, MapsHelper, MapsUtilities){

    return{

        entitySchemaName:"Contact",

        modules:/**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,

        messages: {

            "GetMapsConfig": {

                mode: Terrasoft.MessageMode.PTP,

                direction: Terrasoft.MessageDirectionType.SUBSCRIBE

            }

        },

        businessRules:/**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,

        methods:{

            getActions: function() {

                var actionMenuItems = this.callParent(arguments);

                actionMenuItems.addItem(this.getButtonMenuItem({

                    "Tag": "showOnMap",

                    "Click": {"bindTo": "openShowOnMap"},

                    "Caption": {"bindTo": "Resources.Strings.ShowOnMapCaption"},

                    "Visible": true

                }));

            

                return actionMenuItems;

            },

            showOnMap: function(schemaName, items, callback) {

                var config = config || {};

                items = items || this.getesqedItems();

                var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {

                    rootSchemaName: "ContactAddress"

                });

                esq.addColumn(schemaName + ".Name");

                esq.addColumn("AddressType");

                esq.addColumn("Address");

                esq.addColumn("City");

                esq.addColumn("Region");

                esq.addColumn("Country");

                if(config.columnNameLongitude){

                    esq.addColumn(config.columnNameLongitude);

                }

                if(config.columnNameLatitude){

                    esq.addColumn(config.columnNameLatitude);

                }

                esq.filters.addItem(this.Terrasoft.createColumnInFilterWithParameters(schemaName, items));

                esq.getEntityCollection(function(result) {

                    var addresses = result.collection;

                    if (result.success && !addresses.isEmpty()) {

                        var mapsData = [];

                        var mapsConfig = {

                            mapsData: mapsData

                        };

                        addresses.each(function(item) {

                            var addressType = item.get("AddressType").displayValue;

                            var address = MapsHelper.getFullAddress.call(item);

                            var content = this.Ext.String.format("<h2>{0}</h2><div>{1}</div>", addressType, address);

                            var dataItem = {

                                caption: addressType,

                                content: content,

                                address: address,

                                gpsE: item.get(config.columnNameLongitude),

                                gpsN: item.get(config.columnNameLatitude)

                            };

                            mapsData.push(dataItem);

                        }, this);

                        callback.call(this, mapsConfig);

                    } else {

                        this.showInformationDialog(resources.localizableStrings.EmptyAddressDetailMessage);

                    }

                }, this);

            },

            openShowOnMap: function() {

                var items = [];

                items.push(this.get("Id"));

                this.showOnMap.call(this, this.entitySchemaName, items, function(mapsConfig) {

                    MapsUtilities.open({

                        scope: this,

                        mapsConfig: mapsConfig

                    });

                });

            }

}

 

3) Add the EmptyAddressDetailMessage localizable string to the ContactPageV2 schema

 

Best regards,

Oscar

Dear Oscar,

I m trying to display the adresse on the map, but when i do the final step:

callback.call(this, mapsConfig);

i ve got the error:

message: Uncaught Error: Map container is already initialized.

 

Here's my code :

define("UsrNearestAccountsf7482dd9Page", ["MapsHelper", "MapsUtilities"], function(MapsHelper, MapsUtilities) {
	return {
		entitySchemaName: "UsrNearestAccounts",
		attributes: {},
        messages: {
            "GetMapsConfig": {
                mode: Terrasoft.MessageMode.PTP,
                direction: Terrasoft.MessageDirectionType.SUBSCRIBE
            }
        },
		modules: /**SCHEMA_MODULES*/{
			"Indicator7c02186a-07da-467a-90ed-cf5286772816": {
				"moduleId": "Indicator7c02186a-07da-467a-90ed-cf5286772816",
				"moduleName": "CardWidgetModule",
				"config": {
					"parameters": {
						"viewModelConfig": {
							"widgetKey": "Indicator7c02186a-07da-467a-90ed-cf5286772816",
							"recordId": "cb62f87b-52b6-4482-8283-344ec2f94e1a",
							"primaryColumnValue": {
								"getValueMethod": "getPrimaryColumnValue"
							}
						}
					}
				}
			},
			"Indicator32f96c54-6fbf-45be-b641-95268da60efc": {
				"moduleId": "Indicator32f96c54-6fbf-45be-b641-95268da60efc",
				"moduleName": "CardWidgetModule",
				"config": {
					"parameters": {
						"viewModelConfig": {
							"widgetKey": "Indicator32f96c54-6fbf-45be-b641-95268da60efc",
							"recordId": "cb62f87b-52b6-4482-8283-344ec2f94e1a",
							"primaryColumnValue": {
								"getValueMethod": "getPrimaryColumnValue"
							}
						}
					}
				}
			}
		}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
            getActions: function() {
                var actionMenuItems = this.callParent(arguments);
                actionMenuItems.addItem(this.getButtonMenuItem({
                    "Tag": "showOnMap",
                    "Click": {"bindTo": "openShowOnMap"},
                    "Caption": "openShowOnMap",
                    "Visible": true
                }));
            
                return actionMenuItems;
            },
            openShowOnMap: function() {
                var items = [];
                items.push(this.get("NearAccount"));
                this.showOnMap.call(this, "Account", items, function(mapsConfig) {
                    MapsUtilities.open({
                        scope: this,
                        mapsConfig: mapsConfig
                    });
                });
            },

            showOnMap: function(schemaName, items, callback) {
              
                var config = config || {};
                items = items || this.getesqedItems();
              
                var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                    rootSchemaName: "AccountAddress"
                });
              
                esq.addColumn("AddressType");
                esq.addColumn("Address");
                esq.addColumn("City");
                esq.addColumn("Region");
                esq.addColumn("Country");
                esq.addColumn("GPSE");
                esq.addColumn("GPSN");
              
                esq.filters.addItem(this.Terrasoft.createColumnInFilterWithParameters(schemaName, items));
                esq.getEntityCollection(function(result) {
                    var addresses = result.collection;
                    if (result.success && !addresses.isEmpty()) {
                      
                        var mapsData = [];
                        var mapsConfig = {
                            mapsData: mapsData
                        };
                      
                        addresses.each(function(item) {
                            this.console.log('item: '+this.print_r(item));
                            var addressType = item.get("AddressType").displayValue;
                            var gpsE = item.get("GPSE");
                            var gpsN = item.get("GPSN");
                            var address = MapsHelper.getFullAddress.call(item);
                            var content = this.Ext.String.format("<h2>{0}</h2><div>{1}</div>", addressType, address);
                            var dataItem = {
                                caption: addressType,
                                content: content,
                                address: address,
                                gpsE: gpsE,
                                gpsN: gpsN
                            };
                          
                            this.console.log('dataItem:'+this.print_r(dataItem));
                            mapsData.push(dataItem);
                          
                        }, this);
                      
                        this.console.log('mapsConfig:'+this.print_r(mapsConfig));
                        callback.call(this, mapsConfig);
                      
                    } else {
                        this.showInformationDialog("EmptyAddressDetailMessage");
                    }
                }, this);
            }, 
             print_r: function(obj) { //debug
              let cache = [];
              let str = JSON.stringify(obj, function(key, value) {
                if (typeof value === "object" && value !== null) {
                  if (cache.indexOf(value) !== -1) {
                    // Référence circulaire trouvée
                    return;
                  }
                  // enregistrement de la valeur dans la collection
                  cache.push(value);
                }
                return value;
              });
              cache = null; // reset
              return str;
            }          
        },
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"name": "NearAccountaf54e816-a480-49e1-b827-362d9259418c",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 0,
						"layoutName": "Header"
					},
					"bindTo": "NearAccount"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 0
			},
			{
				"operation": "insert",
				"name": "NearAddress0e195398-6b7e-4bed-81c7-4250803f37dd",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 1,
						"layoutName": "Header"
					},
					"bindTo": "NearAddress"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 1
			},
			{
				"operation": "insert",
				"name": "Distanced9f7c441-62cf-4789-bad3-d9452054b13f",
				"values": {
					"layout": {
						"colSpan": 12,
						"rowSpan": 1,
						"column": 0,
						"row": 2,
						"layoutName": "Header"
					},
					"bindTo": "Distance"
				},
				"parentName": "Header",
				"propertyName": "items",
				"index": 2
			},
			{
				"operation": "merge",
				"name": "ChangesHistoryTab",
				"values": {
					"order": 0
				}
			},
			{
				"operation": "merge",
				"name": "MapTab",
				"values": {
					"order": 1
				}
			},
			{
				"operation": "merge",
				"name": "ESNTab",
				"values": {
					"order": 2
				}
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Here is the screenshot:

screenShot

 

I retrieve the address and coordinates correctly but I cannot display the marker on the map

 

Do you have an idea why i ve got this error ?

 

Thank you,

Nicolas

 

LÉZORAY Nicolas,

 

I change BaseModulePageWithMap to BaseModulePageV2 on my object page nad now it works !

 

thank you !

Show all comments
excel files
7.14
Service_Creatio_enterprise_edition

I created an Excel report on 5/4 and was able to successfully run in several times. However, it will not run now and gives the attached error message. I recreated the report and it is also giving me this error message. However, if I run one of the other excel reports I created it runs just fine. What could be the issue with this?

File attachments
Like 0

Like

9 comments
Best reply

Disregard - I solved it myself. The title of the file had "&". Once I removed the symbol it worked as expected. 

Hi Melinda,

 

please download the template of the report via the 'Download template' button and try it open without data. Come back with results. The issue relates to the xlsx file itself.

Irina Lazorenko,

Hello Irina, the template downloads just fine. When I select "Generate Report" with or without the template open I get the error message. 

 

Hi Melinda,

 

Kindly send the xlsx file without data so that we could investigate the template itself. Also, please specify what operating system (+ version) you are using on your PC.

Irina Lazorenko,

I am using Windows 7 Professional. Attached is the template. Thanks for your review. Melinda

 

Hi Melinda,

 

This is to inform you that we have successfully downloaded the template and forwarded it to the responsible team for a review. 

We'll get back with a reply as soon as we have their feedback.

 

P.S. Note that the template's been removed from the post.

 

Have a good forthcoming weekend! 

S.Kobizka,

Hello do you have an update on this?

 

Thank you for removing the template from the post. 

I just created a brand new report and again I am getting the .xlsx file extension error. This has been going on for almost a month now and I need to pull report asap. Please assist as this is now an urgent matter.

Disregard - I solved it myself. The title of the file had "&". Once I removed the symbol it worked as expected. 

Melinda Krupcyznski,

Hi Melinda,



Sorry for my belated reply and thank you for your post.

 

The point is that our responsible team's been trying to figure out the problem all this time. My colleagues checked and double-checked the template and it downloaded OK for them, so it was hard to detect the error.



We are very glad it is resolved for you now and highly appreciate your attention to detail.

 

Have a good day!

Show all comments
cases
7.15
Service_Creatio_enterprise_edition

I've seen that when a case is automatically created upon receiving an email, the case "Source" field is "email".

I have several mailboxes used to create cases and I'd like to set different "source" values depending on the source mailbox (for example "email mailbox1", "email mailbox 2", ecc) to make statistics and better distinguish cases depending on the source mailbox that originated the case.

How can I configure the "source" field for a case depending on the mailbox that created it?

Like 0

Like

1 comments

Hello Massimiliano, 



As an option, you can use a Category field for this purpose. 

You can specify names of mailboxes in this field by editing "Case categories" lookup. 

Please follow this academy article to find information on how to create a connection between Case Category and Mailbox the case has been registered from. 



Kind regards,

Roman

 

Show all comments
Sections
custom
7.15
Service_Creatio_enterprise_edition

Hello, I've created a custom section and notice when I add a new record and click save, the record automatically closes and takes the user back to the Section to view the list of records. Is there a setting that can be changed so when you save a new record, the page does NOT close and instead the user stays on the page?

Like 0

Like

2 comments

Hi Mitch,

You can find the answer on this thread: https://community.creatio.com/questions/stay-current-edit-page-after-saving-record

 

Regards,

Phuong Nguyen

Hello Mitch, 



Please take a look at the comment above from Phuong Akira. 

The answer on how to reach the functionality you have asked about is described there. 



Kind regards,

Roman

Show all comments
#editable list
add detail
detail
7.15
Service_Creatio_enterprise_edition

I have been having issues changing the default behavior when adding a record from a detail with an editable list. After adding the “IsEditable” attribute to my detail schema, whenever I want to add a record from the detail page a new row is added rather than showing the edit page for adding a new record. Is there a way I change this behavior?

Like 1

Like

2 comments
Best reply

Daer Alex, 

 

You can override the method openCardByMode in the detail schema, forcing the detail to open the card instead of adding a row. You can see the original method in the BaseGridDetailV2 schema in the NUI package. 

 

Daer Alex, 

 

You can override the method openCardByMode in the detail schema, forcing the detail to open the card instead of adding a row. You can see the original method in the BaseGridDetailV2 schema in the NUI package. 

 

Dennis Hudson,

 Thank you I was able to override this method and it worked. For anyone  trying to do a similar thing here is the code I added to my detail schema.

 

openCardByMode: function() {
     const cardState = this.get("CardState");
     const editPageUId = this.get("EditPageUId");
     const primaryValueUId = this.get("PrimaryValueUId");
     this.openCard(cardState, editPageUId, primaryValueUId);    
}

 

I just removed the if else statement from the original method:

 

if (this.getIsEditable() && cardState !== enums.CardStateV2.EDIT) { 
    this.addRow(editPageUId);
} else {
    this.openCard(cardState, editPageUId, primaryValueUId);
}

 

Show all comments
Case_Registration_Form
case landing page
-Service_Creatio
enterprise_edition_()

In the landing page custom javascript code to be added to our web site pages there are only a few case fields (see fields properties of the config variable in the attached image)

  • "Subject"
  • "Email"
  • "Name"
  • "Phone"

I need to let the user on the landing page to provide more informations, like Category or some custom fields (numbers, strings and lookups), that should be automatically set on the related new case.

Is it possible to do that? If yes can somebody provide me some examples, possibly with a lookup field that I think it could be the most complicated situation)?

Thank you

File attachments
Like 0

Like

3 comments

Hello Massimiliano,

To add additional fields to your landing page you need to go to configurations, open Case object and check how those fields are named in the object. For example if I need to add case category to my landing page I am using following code for adding case categories values to my landing page:

Category:<br>

        <input type="hidden" id="CategoryId" />

        <input list="Categories">

            <datalist id="Categories">

                <option value="Incident">

                <option value="Service request">

                <option value="New test category">

            </datalist>

Then I am adding Category field to my landing page (since the column is called "Category" in configurations), and you can read more about how to add drop-down list to landing page here https://academy.creatio.com/documents/marketing/7-15/how-set-mapping-lookups-and-other-non-text-fields

By the way, same article tell us how to add radio buttons to a landing page.

Best regards,

Oscar

Oscar Dylan,

Hello Oscar

Thank you very much for your response.

Just another question about lookup fields: in you example the value the landing page must send to Creatio for a lookup is its description and not its Id. Is it correct? Creatio does the match using the lookup description and not the lookup ID?

Best regards

Massimiliano

Massimiliano Mazzacurati,

We are sending selected value to Creatio app, but mapping is performed via field Id, not description, so the answer is - Creatio does the match using the lookup Id.

Best regards,

Oscar

Show all comments
Access Rights
Business Process
7.15_()
-Service_Creatio
enterprise_edition_()

I'd like to make a section record completely read-only based on whether the value of a status column. If the record is Draft, it should be editable, and when it is Active or Inactive it should completely read-only.

We're using a business process to handle the Activation of the record, so I've tried changing the access rights of the record to remove edit and delete permissions, which works to an extent; the record can be put into edit mode (when the Save button is visible), but it cannot be saved, as the user is prompted they lack permissions to save the record.

What I'd really like is so each field is completely locked, so the user cannot even get to the stage where the option to save the record is available. Is something like this possible?

Like 0

Like

5 comments

You can use business rules to make fields editable or not editable based on the value of a field. You will need to create a business rule for each field one at a time. If the condition is not met, the field will not be editable. This does not work for detail records. You will need to use business processes to control edit/delete of detail records or stop the creation of new records based on reading the status field you mentioned. 

Thanks both for the responses! Do either of these allow a system admin to edit the fields/details? If not, is there a method to implement this?

Morgan Rees,

The only option that would work with your requirements is creating a business rule with code, specifying the condition that the checkbox is set to true plus the user doesn't have a system administration organisational role. Unfortunately, the second part wouldn't be possible to do in UI, which is why you would need a development for that. 

Here is an article how to make a business rules with code: 

https://academy.creatio.com/documents/technic-sdk/7-15/bindparameter-rule-how-lock-field-edit-page-based-specific-condition

An article how to identify if the user has a certain role:

https://customerfx.com/article/determining-if-a-user-has-a-specific-role-in-bpmonline/

Morgan,

My workaround for this has been to use the Records Group Editing addon to edit a value which is locked in the edit page. But Dennis's comment is more robust.

I have not tried it, but I thought that I could set a checkbox under column permissions to only editable by admin, then make the business rule dependent on that checkbox. Not sure if that would work. 

Show all comments
7.15_()
-Service_Creatio
enterprise_edition_()

Hi,

For the various FileDetailV2 lists found in section attachments, it appears the FileSize column, (if added to the detail list columns to display,) only renders the value as the size in bytes.  What is the correct procedure to have that value shown instead in kilo/megabytes, with appropriate suffix?

ie instead of showing a value of '2,456,601' for the size of the file, instead show '2.456 MB' (if the file size >= 1 000 000 bytes).

If the value for file size is greater than 1 000 byes, but less than 1 000 000 ( 1000 <= x < 1000000) I'd like to have the value displayed as the file size value divided by 1000, to 3 decimal places with a suffix of 'KB' added.

In a more general scenario, how can fields within detail lists results be formatted through some callback function?  Does that need to be defined within the schema of the detail itself, overriding the prepareEntityLinkCollection function?  Or can this be done with field validation/input masks?

 

Thanks,

Lachlan Devantier

 

Like 1

Like

1 comments

Hi Lachlan,



In order to achieve that you should add your logic to the detail schema. Since size is an integer column and we want to display it with text ("kb", "mb", etc) I also modifed its attribute. In a detail there is a function prepareResponseCollection that can be used for such purposes.



See full sample below:

 

define("FileDetailV2", [],
	function() {
	return {
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
		attributes: {
			"Size": {
				"dataValueType": Terrasoft.DataValueType.TEXT
			}
		},
		methods: {
			prepareResponseCollection: function(collection) {
				this.callParent(arguments);
				collection.each(function(item) {
					this.fillInSizeColumn(item);
				}, this);
			},
			fillInSizeColumn: function(item) {
				var size = item.get("Size");
				//add your calculating logic here
				item.set("Size", (size / 1024) + " Kb");
			}
		}
	};
});

Result - https://prnt.sc/qiv9gs



Regards,

Dmytro

Show all comments
cases
knowledge base
-Service_Creatio
enterprise_edition_()

Hi Team, 

I have a questions related to Knowldge Base and Case in Service Enterprise.

1. My requirement is to count views for knowledge base article.

2. I want to limit number of cases portal user can register.

Like 0

Like

4 comments

Hello Sushma,

1) To achieve this task you need to add an integer field to the knowledge base edit page that will store this amount of views. Then you need to add additional logic to Knowledge base edit page that will trigger incrementation of the integer field when method onEntityInitialized is initiated.

2) To achieve this task you need to add a system setting with integer data type that will be used to set a restriction number. Then you need to create a process that will sum "Created by" field of "Case" object (each time new case is created) and if the count of "Created by" is greater than the value of the system setting - the incident will be automatically "Canceled". The plus of this method is in fact that the client doesn't need to fill in entered data each time he tries to create new portal incident and you can simply reopen "Canceled" ticket.

Best regards,

Oscar

Sushma

And as for the first question you can also display "View" column that already present in knowledge base object and that shows the amount of views of the article.

Best regards,

Oscar

Oscar Dylan,

I checked Views Column in Knowledge base and this field is not updating.

sushma,

Than you need to implement additional development logic based on onEntityInitialized method.

Best regards,

Oscar

Show all comments