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