Hi,

I have an "Anúncios" lookup. I want to create a new record from the lookup, but in the "Anúncios" lookup, the record is created but the relationship is not.

Can anyone explain to me why this happens?

 

Thanks!

Like 0

Like

2 comments

Hello Andreia,



Unfortunately, it can't be configured automatically. 

So, after creating a new record from the lookup you have to configure the relationship manually, 



As a workaround, you can create a new business process to achieve your business task,



We have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project in order to increase its priority.  



Best regards,

Bogdan

Thanks, Bogdan.

Show all comments

In the previous versions of Creatio, In the User Task element there was the Script where you could implement the task logic, as shown in the image below

In which part of the User Task Source code , in the 7.18 Version of Creatio, should I implement the same logic ? 

 

Like 0

Like

3 comments

Hello Petrika,

 

Thank you for your question!

 

You can read more on this here:

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

 

Kind regards,

Anastasiia

Anastasiia Lazurenko,

Thank you Anastasia for your quick reply. But this is a different approach. I am not asking about the Script Task, but about the User Task.Because i want to use my logic in different bussiness processes.

Dear Petrika,

 

This logic is still the same. Please refer to the screenshots below:

 

 

Kind regards,

Anastasiia

Show all comments

Hi community,

 

What's the best way to filter records in a user friendly way ?

 

I have an object with details and lookups (simplified on this diagram).

Is there a more user-friendly way to filter ObjectSection records based on the lookupDetail value?

I thought of a workaround with a new object, then a detail in that new object that is filtered by a field above, but I don't know if this is the best way to do it. Because these are objects, it's clearly not a good way to filter records. I need these filters to be persistent for the logged in user, but several users will use this search "page" at the same time.

 

The global search is not a good solution either, I need to filter the records of a specific object according to the search values that are in the details of my object.

 

Do you have any idea how I can make this "search page"?

 

Best regards,

 

Julien

Like 0

Like

2 comments

Hello Julien,

I have implemented something like what you're referring to. I have a section where a client manages "areas" and zip codes are assigned to each area (in a detail in this section). This client didn't want to have to create a filter to locate the area for a zip each time they needed - they always locate an area by a zip code in the area. I implemented the ability to search for an area based on a zip code in the detail for the area. It turned out like this: 

Basically, I did the following in the section schema: 

1) Add a text attribute for the value being searched, you'll also want to add an onChange for the attribute so it triggers a change event method. Mine looks like this (note, all the updateSection function does is refresh the section - this is a function in the base section):

attributes: {
	"ZipSearchValue": {
		dataValueType: Terrasoft.DataValueType.TEXT,
		value: "",
		onChange: "updateSection"
	}
}

2) Add an element to the diff bound to the attribute in #1. You could add this with parentName "FiltersContainer" or "GridUtilsContainer", depending on where you want it, but you'll likely need to style it with some CSS to get it to look right. Mine looks like this: 

{
	"operation": "insert",
	"name": "ZipSearchText",
	"parentName": "FiltersContainer",
	"propertyName": "items",
	"index": 0,
	"values": {
		"layout": {
			"colSpan": 12,
			"rowSpan": 1,
			"column": 0,
			"row": 0,
			"layoutName": "FiltersContainer"
		},
		"hasClearIcon": true,
		"bindTo": "ZipSearchValue",
		"caption": "Find zip",
		"classes": {
			"wrapClassName": ["fx-zipsearch"]
		}
	}
}

3) When the user types in the textbox, it will trigger the onChange which just refreshes the section. When the section refreshes, it will call the getFilters method in the section code where you can append to the filters for the list. I have an article about that here: https://customerfx.com/article/programmatically-overriding-or-adding-fi… My filter method looks like this:

getFilters: function() {
	var filters = this.callParent(arguments);
 
	if (!Ext.isEmpty(this.get("ZipSearchValue"))) {
		var filter = Terrasoft.createFilterGroup(),
			subFilters = Terrasoft.createFilterGroup();
 
		subFilters.add("ZipValueFilter",
			Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "UsrZipCodeValue", this.get("ZipSearchValue").trim())
		);
 
		filter.addItem(Terrasoft.createExistsFilter("[UsrZipCode:UsrDistributorArea].Id", subFilters));
		filters.add("ZipSearchFilter", filter);
	}
 
	return filters;
}

Hope this helps get you started.

Ryan

Ryan Farley,

Thank you for your contribution. It will be very useful.



In the "OperatorCustomerEngagementCenter" package there is a client module named "SearchAccountAndContactPage.js". You can find a screenshot here: https://community.creatio.com/questions/adding-button-search-contacts-a…

I will try to load a custom view like this and use your answer to create filters. I'll post how I did it once done so other people can do it too.

 

Best regards,

 

Julien

Show all comments

Hi Community

 

Has anyone used the macro handler in a bulk email ?

I'm trying to do what is described in this article Work with emails basics | Creatio Academy in a bulk email,

but it does not work.

 

Like 0

Like

1 comments

Hi Stefano,

 

This macro is not supposed to be used in bulk emails, it's only for regular emails (IMAP\SMTP, Exchange).

 

Best regards,

Oscar

Show all comments

I have set an encrypted string as a system setting as shown on the picture

 

and for some reason I am not able to use it as a value for the parameter of my user task. It is not showing as an option to be selected. Any help would be appreciated.

 

Like 1

Like

1 comments

Hello Erald,

 

By default, Business Process elements cannot process encrypted values but you can refer to this workaround that might help you with your business task.

 

Best regards,

Bogdan S.

Show all comments

Hi community,

 

I try to display (or not) an element based on information found on the contact page of the connected user. I tried with a business rule but I only can choose the user connected and not its related objects and their attributes.

 

So I tried something like that in the methods :

		methods: {
			init: function() {
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
				// console.log(this.checkIfInHR());
				},
			/** 
			* Check if connected user is in HR department
			* @param  {string} departmentId  The contact's department Id
			* @param  {string} contactTypeId The contact's type Id
			* @return {bool} 			true if user is in HR department, otherwise false
			*/
			checkIfInHR: function(departmentId = "", contactTypeId = ""){
 
				// if called without args, query connected contact
				if (departmentId == "" && contactTypeId == ""){
					var esq = Ext.create("Terrasoft.EntitySchemaQuery", {rootSchemaName: "Contact"});
 
					// query the contact's department and contact's type
					esq.addColumn("Department");
					esq.addColumn("Type");
 
					// Execute the query 
					esq.getEntity(Terrasoft.SysValue.CURRENT_USER_CONTACT.value, function(res) {
						if (res.success){
							// call checkIfHR again but with args this time
							this.checkIfHR(res.entity.values.Department.value, res.entity.values.Type.value);
						}}, this);
				} else {
					// if args are passed
					// console.log() will be removed in prod
					console.log("departmentId : ", departmentId);
					console.log("contactTypeId : ", contactTypeId);
					console.log("response : ", departmentId == "ca611978-6277-4576-8a96-22ae54fe4d79" && contactTypeId == "60733efc-f36b-1410-a883-16d83cab0980");
					// 1st Id : HR department, 2nd Id: Our company
					return departmentId == "ca611978-6277-4576-8a96-22ae54fe4d79" && contactTypeId == "60733efc-f36b-1410-a883-16d83cab0980";
				}
			}
		}

Then I tried to call this method in the DIFF part :

			{
				"operation": "insert",
				"name": "Tab0f271a37TabLabel",
				"values": {
					"caption": {
						"bindTo": "Resources.Strings.Tab0f271a37TabLabelTabCaption"
					},
					"items": [],
					"order": 11
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 10,
				"enabled": this.checkIfInHR()
			},

but it always gives me this error now:

Uncaught TypeError: this.checkIfInHR is not a function

 

Do you have a better way to hide a tab based on values in the user connected' contact page or a way to fix my error ?

 

Best regards,

 

Julien G.

Like 0

Like

3 comments
Best reply

Hi Julien,

 

I cannot see the checkIfInHR method call on the init method execution, but I suppose you wanted to call it inside the "enabled" property of the Tab0f271a37TabLabel object. Ok, but the problem is that you need to use:

"enabled": {"bindTo": "checkIfInHR"},

and also the "enabled" property should be initialized inside the "values" object. So the code should've been:

onEntityInitialized: function() {
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
				this.checkIfInHR();
				},
 
....
 
{
				"operation": "insert",
				"name": "Tab0f271a37TabLabel",
				"values": {
					"enabled": {"bindTo": "checkIfInHR"},
					"caption": {
						"bindTo": "Resources.Strings.Tab0f271a37TabLabelTabCaption"
					},
					"items": [],
					"order": 11
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 10
			},

The next problem is that this approach won't work since there is no "enabled" property for tab labels. So the general approach should be modified.

 

I would suggest using this check in the onEntityInitialized method:

onEntityInitialized: function() {
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
				this.reformTabsCollection();
			},
			reformTabsCollection: function(){
				this.checkIfInHR();
				var tabsCollection = this.get("TabsCollection");
				if (this.get("BooleanAttribute")==false) {
                        tabsCollection.removeByKey("TheTabYouNeedToBeNotVisible");
                    }
			}

Also you need to create some bool attribute where the result of the checkIfInHR method will be written (using this.set("BooleanAttribute", true) or this.set("BooleanAttribute", false) at the end of the checkIfInHR method execution based on the checkIfInHR method results). There is no need to store the tab on the page in case it should be non clickable.

 

Best regards,

Oscar

Change it from this:

"enabled": this.checkIfInHR()

To this (and move inside of "values"):

"enabled": { "bindTo": "checkIfInHR" }

Ryan

Hi Julien,

 

I cannot see the checkIfInHR method call on the init method execution, but I suppose you wanted to call it inside the "enabled" property of the Tab0f271a37TabLabel object. Ok, but the problem is that you need to use:

"enabled": {"bindTo": "checkIfInHR"},

and also the "enabled" property should be initialized inside the "values" object. So the code should've been:

onEntityInitialized: function() {
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
				this.checkIfInHR();
				},
 
....
 
{
				"operation": "insert",
				"name": "Tab0f271a37TabLabel",
				"values": {
					"enabled": {"bindTo": "checkIfInHR"},
					"caption": {
						"bindTo": "Resources.Strings.Tab0f271a37TabLabelTabCaption"
					},
					"items": [],
					"order": 11
				},
				"parentName": "Tabs",
				"propertyName": "tabs",
				"index": 10
			},

The next problem is that this approach won't work since there is no "enabled" property for tab labels. So the general approach should be modified.

 

I would suggest using this check in the onEntityInitialized method:

onEntityInitialized: function() {
				this.callParent(arguments);
				this.mixins.MultiChoiceMixin.init.call(this, arguments);
				this.reformTabsCollection();
			},
			reformTabsCollection: function(){
				this.checkIfInHR();
				var tabsCollection = this.get("TabsCollection");
				if (this.get("BooleanAttribute")==false) {
                        tabsCollection.removeByKey("TheTabYouNeedToBeNotVisible");
                    }
			}

Also you need to create some bool attribute where the result of the checkIfInHR method will be written (using this.set("BooleanAttribute", true) or this.set("BooleanAttribute", false) at the end of the checkIfInHR method execution based on the checkIfInHR method results). There is no need to store the tab on the page in case it should be non clickable.

 

Best regards,

Oscar

Oscar Dylan,

 Thank you very much !

 

Best regards,

 

Julien

Show all comments

Hi Community,

 

In mobile, I found this sample below in Academy on how to add filter to dropdown field. My question is how to add mulitple filter to dropdown field. I tried below syntax but it is not working

 

addFilter: [

             {

                      property: "IsChief",

                     value: true

             },

             

             {

                      property: "IsChief2",

                     value: true

             },

]



 

Like 0

Like

1 comments

Hi Fulgen, 

 

Please try to use it in this way : 

 

addFilter: {

type: Terrasoft.FilterTypes.Group,

subfilters: [{...}, {...}]

}

 

Best Regards, 

 

Bogdan L.

Show all comments

Hi Everyone,



in mobile app, in the Account section,  we added a link to the order detail, which display the order list for that account.

Unfortunatelly, when selecting one order, the product list is missing.

 

I did not found a way to display it, using the mobile app assistant.

After some searching, i found that the MobileOrderRecordPageSettingsDefaultWorkplace define the fields to be displayed, but i could not configure it properly to display the product list.



How can it be done, please ?



Thanks.



Patrice

Like 0

Like

3 comments

Hello Patrice,

 

You need to add it to the mobile application manifest.

Find details here:

https://academy.creatio.com/docs/developer/mobile_development/mobile_ap…

 

Best Regards, 

Bogdan 

Hello Bogdan,

thank you for your answer.

The mobile application manifest is a part of the solution as one need to add OrderProduct reference in it to make it work.

 

For my particular issue, i did not set MobileOrderRecordPageSettingsDefaultWorkplace correctly.

Finally, i found the right way :

 

	{
		"operation": "insert",
		"name": "OrderProductDetail",
		"showForVisibleModule": true,
		"values": {
			"caption": "OrderProductDetailCaptionOrder_caption",
			"entitySchemaName": "OrderProduct",
			"filter": {
				"detailColumn": "Order",
				"masterColumn": "Id"
			},
			"operation": "insert"
		},
		"parentName": "settings",
		"propertyName": "details",
		"index": 1
	},

 

If anyone searching for the complete solution, here is the MobileOrderProductRecordPageSettingsDefaultWorkplace :

 

[
	{
		"operation": "insert",
		"name": "settings",
		"values": {
			"entitySchemaName": "OrderProduct",
			"details": [],
			"columnSets": [],
			"localizableStrings": {
				"primaryColumnSetOrderProduct_caption": "Informations générales"
			},
			"settingsType": "RecordPage",
			"operation": "insert"
		}
	},
	{
		"operation": "insert",
		"name": "primaryColumnSet",
		"values": {
			"items": [],
			"rows": 1,
			"entitySchemaName": "OrderProduct",
			"caption": "primaryColumnSetOrderProduct_caption",
			"position": 0,
			"operation": "insert"
		},
		"parentName": "settings",
		"propertyName": "columnSets",
		"index": 1
	},
	{
		"operation": "insert",
		"name": "Product_row_123",
		"values": {
			"row": 2,
			"content": "Nom du produit",
			"columnName": "Name",
			"dataValueType": 1,
			"operation": "insert"
		},
		"parentName": "primaryColumnSet",
		"propertyName": "items",
		"index": 2
	},
	{
		"operation": "insert",
		"name": "Quantity_row_123",
		"values": {
			"row": 3,
			"content": "Quantité",
			"columnName": "Quantity",
			"dataValueType": 1,
			"operation": "insert"
		},
		"parentName": "primaryColumnSet",
		"propertyName": "items",
		"index": 3
	},
	{
		"operation": "insert",
		"name": "Price_row_123",
		"values": {
			"row": 4,
			"content": "Prix de vente",
			"columnName": "Price",
			"dataValueType": 1,
			"operation": "insert"
		},
		"parentName": "primaryColumnSet",
		"propertyName": "items",
		"index": 4
	},
	{
		"operation": "insert",
		"name": "Discount_row_123",
		"values": {
			"row": 5,
			"content": "Réduction",
			"columnName": "DiscountAmount",
			"dataValueType": 1,
			"operation": "insert"
		},
		"parentName": "primaryColumnSet",
		"propertyName": "items",
		"index": 5
	},
	{
		"operation": "insert",
		"name": "Product_row_123",
		"values": {
			"row": 6,
			"content": "Détails du produit",
			"columnName": "Product",
			"dataValueType": 10,
			"operation": "insert"
		},
		"parentName": "primaryColumnSet",
		"propertyName": "items",
		"index": 6
	}
]



Best regards

Patrice

Patrice Vigouroux,

 

Hello, 

 

Many thanks for sharing your solution with us! :)

Please let us know in case of any additional questions. 

 

Best regards, 

Anastasiia

Show all comments

Hi,

In Order section there is a OOB lookups field called "Customer". On click we can select either Account or Contact because both list are appearing for selection.

I have a requirement to implement the similar functionality like combining multiple list into one lookup field.

Please help with the configurations.

Like 0

Like

2 comments
Best reply

Hi Janhavi,

 

You need to study how this lookup is implemented on the BaseOrderPageV2 schema and implement the same logic for your column. It's simple - create two lookup columns (UsrContact and UsrAccount that will point to the Contact and Account objects respectfully), add the following attribute to the section edit page schema:

"Client": {
					"caption": {"bindTo": "Resources.Strings.Client"},
					"dataValueType": this.Terrasoft.DataValueType.LOOKUP,
					"multiLookupColumns": ["UsrContact", "UsrAccount"],
					"isRequired": true
				},

Add the localizable string with the "Client" code and then insert this column somewhere on the page (I've been using the contact profile container as a parent):

{
					"operation": "insert",
					"parentName": "Header",
					"propertyName": "items",
					"name": "Client",
					"values": {
						"layout": {"column": 0, "row": 7, "colSpan": 24, "rowSpan": 1, "layoutName": "ProfileContainer"},
						"controlConfig": {
							"enableLeftIcon": true
						}
					}
				}

As a result you will get the needed lookup:

Best regards,

Oscar

Hi Janhavi,

 

You need to study how this lookup is implemented on the BaseOrderPageV2 schema and implement the same logic for your column. It's simple - create two lookup columns (UsrContact and UsrAccount that will point to the Contact and Account objects respectfully), add the following attribute to the section edit page schema:

"Client": {
					"caption": {"bindTo": "Resources.Strings.Client"},
					"dataValueType": this.Terrasoft.DataValueType.LOOKUP,
					"multiLookupColumns": ["UsrContact", "UsrAccount"],
					"isRequired": true
				},

Add the localizable string with the "Client" code and then insert this column somewhere on the page (I've been using the contact profile container as a parent):

{
					"operation": "insert",
					"parentName": "Header",
					"propertyName": "items",
					"name": "Client",
					"values": {
						"layout": {"column": 0, "row": 7, "colSpan": 24, "rowSpan": 1, "layoutName": "ProfileContainer"},
						"controlConfig": {
							"enableLeftIcon": true
						}
					}
				}

As a result you will get the needed lookup:

Best regards,

Oscar

Oscar Dylan,

It worked 

Thanks!

Show all comments

Hello Everyone.

I want to log in a separate file every communication with a Web-Service (request , response time etc).Is there any built-in , or tools from Marketplace to realize this task. Or I should customize the source -code.  

Like 0

Like

3 comments
Best reply

Petrika,

 

Perfect, then additionally you can use the same approach with EntitySchemaQuery, but create record is some section and then use the standard "Export to excel" functionality to get the file with request calls. So each time something is calling the GetErSumSq method you can create a record in some separate section (for example called "Integration call" and add information like DateTime.Now (to get the date and time when the method was called and which value was returned (sum))). Also you can try looking into the HttpContext, HttpContextAccessor and AppConnection to see which information is available there that can be used to additionally log the method call.

 

Best regards,

Oscar

Hi Petrika,

 

This should be done directly in the code of the 3rd party endpoint to which the call is performed (in case we are discussing the 3rd party webservice call from the business process). Logs of the integration call on the Creatio side are accessible only via standard IIS logs. Or you can enable the process tracing to see the status of the call.

 

In case the webservice is stored in the Creatio configuration (standard anonymous or regular webservice) then you can either add a part of inserting a record to some specific table in Creatio (via InsertQuery class for example) and retrieve data from there.

 

Best regards,

Oscar

Thank you very much for your immediate response Oscar. I have got an idea now.  This is what i am trying to do. I have created a button in the Front-End (Get Sum Ws) which calls in the Back-End a basic web service that caculates the sum of the AmountHC in Details Rows.

This is the code in the back-end

namespace test1323.Files.cs
{
    [EntityEventListener(SchemaName = "PetrikaExpenseReport")]
    [ServiceContract]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    class DemoService : BaseService
    {
 
        [OperationContract]
        [WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]
 
        public decimal GetErSumSq(string name) 
        {
 
            EntitySchemaQuery entity = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "PetrikaExpenseReport"); 
 
            entity.AddColumn("Id");
            entity.AddColumn("PetrikaTotalAmount");
            entity.AddColumn("PetrikaName");
            entity.PrimaryQueryColumn.IsVisible = true;                                                                   
 
            IEntitySchemaQueryFilterItem parentfilter =
            entity.CreateFilterWithParameters(FilterComparisonType.Equal,"PetrikaName",name);
            entity.Filters.Add(parentfilter);                                                                            
            EntityCollection records = entity.GetEntityCollection(UserConnection);                                      
            Guid parentId = records[0].GetTypedColumnValue<Guid>("Id");
 
           EntitySchemaQuery rows = new EntitySchemaQuery(UserConnection.EntitySchemaManager, 
           "PetrikaExpenseReportLines");
 
            rows.AddColumn("PetrikaAmountHC");
            rows.AddColumn("PetrikaAmountFC");
            rows.AddColumn("Id");
 
            IEntitySchemaQueryFilterItem childfilter =
            rows.CreateFilterWithParameters(FilterComparisonType.Equal, "PetrikaExpenseReport", parentId);
            rows.Filters.Add(childfilter);                                                                            
            EntityCollection lines = rows.GetEntityCollection(UserConnection);
 
            decimal sum = decimal.Zero;
 
            foreach (var r in lines) 
            {
                sum = sum + r.GetTypedColumnValue<decimal>("PetrikaAmountHC");
            }
            records[0].SetColumnValue("PetrikaTotalAmount", sum);                                             
            records[0].Save();
            return sum;
        }
}
}

I want to log in a separate file every communication (request , response time etc) with GetErSumSq.

Petrika,

 

Perfect, then additionally you can use the same approach with EntitySchemaQuery, but create record is some section and then use the standard "Export to excel" functionality to get the file with request calls. So each time something is calling the GetErSumSq method you can create a record in some separate section (for example called "Integration call" and add information like DateTime.Now (to get the date and time when the method was called and which value was returned (sum))). Also you can try looking into the HttpContext, HttpContextAccessor and AppConnection to see which information is available there that can be used to additionally log the method call.

 

Best regards,

Oscar

Show all comments