Hi community,

 

I have a custom entity A, that has a relation with a Contact entity. 

I would like to edit the related contact in the context of the entity A. Is this possible in Freedom UI?

Could I open a dialog with the Edit form of the Contact?

If it's not possible, I believe I have to navigate to the Contact to edit it.



Thanks,

Ignacio.

 

Like 0

Like

3 comments

Hello Ignacio,



I believe it could be achieved by an Expanded list.

 

For example as it's already realized for Contacts in Accounts:

 

Thank you Bogdan. That could work in case of a multi instance list, like the list of Contacts. What If I have only one contact related to a custom entity, like the example described? 

 

Ignacio,

 

We have only this example of its implementation

Show all comments

Good day, Colleagues!

Does anyone possibly have a code example on the new Freedom page showing how to calculate the difference of values ​​of two page fields and write it into a third field? For example: payment balance = Amount-PaymentAmount Maybe there's also a code example on how to get the exchange rate on the date specified in the Date field according to the Currency field or an example of how to refer to another object to get a value from it.

Like 2

Like

3 comments

You can see how to wire up a code to respond to a field change here:

https://customerfx.com/article/responding-to-an-event-when-a-field-is-c…

As far as getting and setting the values, this article will show you how to do that: 

https://customerfx.com/article/reading-and-setting-field-values-via-cod…

Ryan

Ryan Farley,



Thank you, I will give it a try.

Ryan Farley,

 

How can I achieve the same requiremet, but for the fields that are inside a detail with editable list?

 

Thank you in advance.

 

Best Regards,

Pedro Pinheiro

 

 

Show all comments

Hello 

Can someone help me to know, how I add a detail in a page that I am editing in the application Hub? 

I been searching how to do it but I can't find it. 

Thanks you. 

 

Like 0

Like

2 comments

Hello,

 

Please refer to this article for the detailed information. 



Best regards,

Anastasiia

This does not help. Please tell us how to add a detail in FUI and how to edit that detail by adding columns to it how it is done in classic UI.

Show all comments

Hello Everyone ,

 

I have tried to Create a custom Detail in my Custom Section but not able to bind it with "Id" of the Parent Object as in Classic ui When we Create Detail it Automatically fetch the Current Record if and we are able to see the list in detail for current record. Can anyone help how to do the same in Freedom UI

 

Like 0

Like

1 comments

Good day,

In the new interface, the details are configured similarly to the mechanism used in the old interface. It also includes automatic mapping to the ID of the current record, so there is no need to add it separately. For example, in the "Orders" detail added to the "Account" section by default, we can see that the detail displays records where Account.Id (of the current record) is equal to Order.AccountId.

Thank you for your question.

Best Regards,

Pavlo

Show all comments

Hello,

 

Can any one help me how to get "Description" of a lookup type field and Populate it in any Other Field via code in freedomUI ? 

Like 0

Like

2 comments
Best reply

I'm positive there is a way to register the field as an attribute for the Lookup's data source, I've just not figured out or tested how to do that yet. Likely info here https://academy.creatio.com/docs/developer/front_end_development_freedo…

As for now, you could do the following - in this example I have a lookup for ContactType and will retrieve the Description once selected. You'll ned to know the actual attribute name for the lookup which you can see in the viewDiffConfig for the control as:

control: "$SomeAttributeName"  (this is the attribute name, minus the "$")

Then, add a change request handler like this: 

{
	request: "crt.HandleViewModelAttributeChangeRequest",
	handler: async (request, next) => {
		// listen for changes to the Lookup field attribute
		if (request.attributeName === "LookupAttribute_spr6dlv" && !request.silent) {
			// get the selected value
			var lookupVal = await request.$context.LookupAttribute_spr6dlv;
			// retrieve the description
			const model = await sdk.Model.create("ContactType");
			const results = await model.load({
				attributes: ["Description"],
				parameters: [{
					type: sdk.ModelParameterType.PrimaryColumnValue,
					value: lookupVal.value
				}]
			});
			const desc = results[0].Description;
			// set the other column's attribute with the description
			request.$context.SomeOtherAttribute = desc;
		}
 
		return next?.handle(request);
	}
}

Ryan

Hi,

 

Example of retrieving description value of the lookup:

const accountCategoryModel = await sdk.Model.create("AccountCategory");
					const accountCategory = await accountCategoryModel.load({
						attributes: ["Id", "Name", "Description"],
						parameters: [{
							type: sdk.ModelParameterType.PrimaryColumnValue,
							value: "38ea507c-55e6-df11-971b-001d60e938c6"
						}]
					});
					console.log("The result: ", accountCategory);

value: "38ea507c-55e6-df11-971b-001d60e938c6" - Id here can be dynamically set as some variable that is received from the context. To set the result for the column (in this case for the UsrSubjectDetails):

request: "crt.HandleViewModelAttributeChangeRequest",
    handler: async (request, next) => {
      if (request.attributeName === 'UsrSubject') {
        const isFieldsShouldBeSynchronized = request.oldValue === await request.$context.UsrSubjectDetails;
        if (isFieldsShouldBeSynchronized) {
          request.$context.UsrSubjectDetails = "some value";
        }
      }

 

I'm positive there is a way to register the field as an attribute for the Lookup's data source, I've just not figured out or tested how to do that yet. Likely info here https://academy.creatio.com/docs/developer/front_end_development_freedo…

As for now, you could do the following - in this example I have a lookup for ContactType and will retrieve the Description once selected. You'll ned to know the actual attribute name for the lookup which you can see in the viewDiffConfig for the control as:

control: "$SomeAttributeName"  (this is the attribute name, minus the "$")

Then, add a change request handler like this: 

{
	request: "crt.HandleViewModelAttributeChangeRequest",
	handler: async (request, next) => {
		// listen for changes to the Lookup field attribute
		if (request.attributeName === "LookupAttribute_spr6dlv" && !request.silent) {
			// get the selected value
			var lookupVal = await request.$context.LookupAttribute_spr6dlv;
			// retrieve the description
			const model = await sdk.Model.create("ContactType");
			const results = await model.load({
				attributes: ["Description"],
				parameters: [{
					type: sdk.ModelParameterType.PrimaryColumnValue,
					value: lookupVal.value
				}]
			});
			const desc = results[0].Description;
			// set the other column's attribute with the description
			request.$context.SomeOtherAttribute = desc;
		}
 
		return next?.handle(request);
	}
}

Ryan

Show all comments

Hello ,

I have a requirement where "A" is a date field and "B" is a boolean. When a record is created, it should calculate the number of days left until "A" arrives. If the number of days left is less than 45, then the value of "B" should be changed to "true". 

Note : I m using Freedom UI. Also if this is possible through Bussiness Process please Advise.

Like 0

Like

4 comments

Good day,

 

This can be done by making a formula to count days between "today" and your filed "A" with a function .Days.

It should look something like the following:

 

([#Date value.5/31/2023#]-[#System variable.Current Date#]).Days

 

I will also will leave some community questions on the matter:

https://community.creatio.com/questions/auto-calculate-age-based-new-bi…

https://community.creatio.com/questions/need-use-caluculated-field-valu…

 

Cheers.

Artem,



I have Created A process but data is not reflecting as i want.

Screenshot of Process and records are attached 

This is my SubProcess



This is my Main Process





This is the list of Records





Here Course C is the field which displays the Days which is not Correct. 

Please Advise



 

 

Hey there,

 

If you are referring to the way the data is represented, it depends on the type of the column (in order to make the value not have zero after it - make the column integer)

 

If you want to show a checkbox that would be ticked if a certain number is reached and you do not want to use code, keep the column in which you store the number of days, and on the base of it, build a business rule that "if the number of days is reached, then make the box true"



https://academy.creatio.com/docs/user/nocode_platform/freedom_business_…

 

Thank you

Artem,

 Thanks for your reply.

I want the value in Field should be correct as it is 92 for all records allthough there are some records whose value should be 30 days or 60 days

 

Show all comments