I am trying to add a filter on the lookup owner based on the account field, but the filter is not working. Does anyone have an idea why?

Thanks!

handlers: /**SCHEMA_HANDLERS*/[
        {
            request: "crt.LoadDataRequest",
            handler: async (request, next) => {
                // filter the contact lookup for the account
                             
                if(request.dataSourceName !== "LookupAttribute_85sj3qr_List_DS") {
                    return await next?.handle(request);
                }
         
                // get the account                  
                const account = await request.$context.Parameter_q8l08xk;
                if (account) {
                    const filter = new sdk.FilterGroup();
                    await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Account", account.value);
         
                    
                    const newFilter = Object.assign({}, filter);
                    newFilter.items = filter.items;
         
                    request.parameters.push({
                        type: "filter",
                        value: newFilter
                    });
                }
                             
                return await next?.handle(request);
            }
        }
            
        ]/**SCHEMA_HANDLERS*/,

Like 0

Like

2 comments

First, enable debug mode by executing the following in the browser console:

See https://customerfx.com/article/debugging-client-side-code-in-creatio-fo…

Once enabled, open the code for the page and set some breakpoints. Is a dataSourceName for "LookupAttribute_85sj3qr_List_DS" getting triggered? Maybe the name is wrong?

Is request.$context.Parameter_q8l08xk correctly retrieving the account?

Ryan

Everything looks Correct , and the issue was that I forgot to add the SDK "@creatio-devkit/common" to the page .
Thank You 

Show all comments

Hello all,

 

Is there a way to block users from copying records? I can't find any operation permission but we're trying to force user's to create new records rather than copying existing records.

Like 1

Like

1 comments

Hello,

 

In Creatio, you can manage user permissions to control access to various operations, including creating, editing, and deleting records. However, there isn't a specific permission to block users from copying records directly.

 

To achieve your goal of preventing users from copying records, you can consider the following approaches:

Custom Business Rules: Implement custom business rules or scripts that prevent the copying of records. This can be done by adding validation logic that checks if a record is being copied and then prevents the operation.

User Permissions: Review and adjust user permissions to limit access to certain records or fields. While this won't directly prevent copying, it can restrict what users can do with the records they have access to.

Training and Guidelines: Educate users on the importance of creating new records rather than copying existing ones. Provide clear guidelines and training to ensure they understand the process and the reasons behind it.

Audit and Monitoring: Implement auditing and monitoring to track record creation and copying activities. This can help you identify and address any instances where users are copying records inappropriately.

Show all comments

How to filtering lookup with static filter that i have 1 object that is relation to contact and account, and i want to filter if the account is has been added to the object then the account not display in the lookup

Like 2

Like

1 comments

The necessary filtering can be implemented in section page source code. In order to do that you will have to write the handler for crt.LoadDataRequest request that appears when the lookup is opened.

Here is the example of the implementation:
 

/**SCHEMA_MODEL_CONFIG_DIFF*/,
	handlers: /**SCHEMA_HANDLERS*/[
		{
			request: "crt.LoadDataRequest",
			handler: async (request, next) => { 
				if(request.dataSourceName !== "PDS_UsrDoctor_sm2qg7w_List_DS") {
					return await next?.handle(request);
				}
				console.log('Lookup Load Data...');
				const cardModel = await sdk.Model.create("UsrHospitalVisitCardV3");
 
				// now load the records and provide the filters             
				const cards = await cardModel.load({
					attributes: ["UsrDoctor"]
				});
				console.log(cards);
 
				if (cards) {
					const filter = new sdk.FilterGroup();
					filter.logicalOperation = sdk.LogicalOperatorType.Or;
					cards.forEach(async (card) => {
						if(card.UsrDoctor && card.UsrDoctor.value){
							await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Id", card.UsrDoctor.value);
						}
					});
 
					// note, these lines are only needed due to an issue with filters in Creatio-DevKit SDK
					// expected to be fixed in Creatio 8.1
					const newFilter = Object.assign({}, filter);
					newFilter.items = filter.items;
 
					request.parameters.push({
						type: "filter",
						value: newFilter
					});
				}
 
				return await next?.handle(request);
			}
		}
	]/**SCHEMA_HANDLERS*/

 
In the example above "PDS_UsrDoctor_sm2qg7w_List_DS" is the name of the lookup that has to be filtered and "UsrHospitalVisitCardV3" is the object that contains that lookup and which records we should check.

You can also find some additional details and useful information in the articles:
https://customerfx.com/article/dynamically-filtering-a-lookup-on-a-creatio-freedom-ui-page/
https://customerfx.com/article/querying-data-using-filter-conditions-via-the-model-class-equivalent-to-enityschemaquery-in-a-creatio-freedom-ui-page/

Show all comments

Hi community,

In the oob version Product in order modal page when opening the business rules,

we see the Formula expression BusinessRuleFormulaExpression 

However when trying to create a rule of our own we cant apply formulas, its always the Constant Value

Is there any feature that needs to be active?

Sasor

Like 0

Like

1 comments

Hello Community,
Here is the scenario Im truing to solve.

We Have Opportunity (parent page) in freedomUI and Contact In Opportunity in Classic UI.

We want to capture the following event. When we click Close in 'Contact in opportunity', we want to capture this event, in the Opportunity Form Page. 

The scope behind this is to perform a list reload of the Contacts(have already tried Enable live update in the entities-doesnt work)

How can this be achieved?

Sasor

Like 0

Like

9 comments

++++

Hello,
 

You can implement the following code to reload the data source when you get to the Freedom UI page on the crt.HandleViewModelInitRequest.
 

Sample implementation for “Opportunities_FormPage”

define("Opportunities_FormPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {
...
        handlers: /**SCHEMA_HANDLERS*/[
              {
        // Load data grids
      request: 'crt.HandleViewModelInitRequest',
      handler: async (request, next) => {
          console.log("You returned to FreedomUI page");
            const result = await next?.handle(request);
            const handlerChain = sdk.HandlerChainService.instance;
            await handlerChain.process({
                type: 'crt.LoadDataRequest',
                $context: request.$context,
                config: {
                    loadType: "reload"
                },
                dataSourceName: "ContactRolesListDS"
            });
            return result;
      }
  }

Serhii Parfentiev,

Hello Serhii,

Have you actually tried it ? HandleViewModelInitRequest is not even triggered when you close the classic ui page (nothing in the console log)

Sasor

++++

++++

++++

++++

+++++++

Hi Community,

Is there any idea about this topic?

Sasor

Show all comments

I would like to disable the mini page that appears before the main page in Freedom UI. Currently, when we click on "Next Step," it first opens a mini page before navigating to the main page. Instead, I want it to directly open the main page without this intermediate step.

Like 3

Like

4 comments

Hello,

 

When clicking on the "Complete" button from the next steps, the system will show you the Freedom UI mini page, as this is a Next Steps core logic.

The only way to avoid opening this mini page is to develop your only Next Steps tiles and assign different logic for the complete button.

Dymytriy Vykhodets,

can you please help me where this core logic is written. so that i can try to create new logic.

Dymytriy Vykhodets,

the idea is to open the main page in place of mini page when we click on complete button

Alok Kumar,

Yes, we want to opent the main page directly

 

Show all comments

Hi everyone,

Trying to merging 2 different pairs of duplicate contact records and i receive the following errors: 

1. P0001: User with specified contact already exists
2. Npgsql.PostgresException: 42601

Has anyone ever encountered these errors? 

Like 0

Like

1 comments

Hi Shemroy!

This error can occur when the contacts you are trying to merge are linked to a system user.

When trying to merge them, the system attempts to link one contact to another user, but a contact cannot be linked to more than one user. This results in an error, since the system does not allow this situation.

Such user-linked contacts should not be merged. If necessary, you can deactivate one of the users and rename the contact to avoid confusion.

Since deleting a user is not supported by the system by design, deleting a contact linked to such a user is also not possible.
 

If you have any further questions, please let us know, we would be happy to help.
Thank you for choosing Creatio!

Show all comments

Hello, 

 

I've set 'Record deactivation' for my object. But I don't see any field for that in Data model attributes on my Freedom UI page.

 

How can I add this field 'Inactive' to Freedom UI page?

 

Thank you!

Like 1

Like

3 comments

Hello Vladimir,

I've the same question and I followed these steps for Contact section:

1. Create a replacement for the Freedom client schema. Please create a new client module, and for the URL in the browser, change schemaType=9 
for example like that: .../0/ClientApp/#/ClientUnitSchemaDesigner/new?packageId=db5d44a0-881e-ba1b-3396-a2dfae3fecee&packageName=test_contacts&schemaType=9
2. Set Parent object -  Contacts form page (Contacts_FormPage)

3. Change del module script 

viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
			{
				"operation": "insert",
				"name": "Checkbox_Custom",
				"values": {
					"layoutConfig": {
						"column": 1,
						"row": 2,
						"colSpan": 1,
						"rowSpan": 1
					},
					"type": "crt.Checkbox",
					"label": "$Resources.Strings.PDS_RecordInactive_Custom",
					"labelPosition": "auto",
					"control": "$PDS_RecordInactive_Custom"
				},
				"parentName": "SideAreaProfileContainer",
				"propertyName": "items",
				"index": 1
			}
		]/**SCHEMA_VIEW_CONFIG_DIFF*/,
		viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[
			{
				"operation": "merge",
				"path": [
					"attributes"
				],
				"values": {
					"PDS_RecordInactive_Custom": {
						"modelConfig": {
							"path": "PDS.RecordInactive"
						}
					}
				}
			}
		]

Hello,
 

The solution provided by Stefano is a good one. 

An alternative solution was discussed in this post: https://community.creatio.com/questions/recordinactive-checkbox-missing-freedom, and you can use the approach from there.
 

However, we still recommend adding the required column directly via page metadata, as described above.
 

We already have a backlog task to address this issue in future versions of the application.
 

Thank you for reaching out!

Stefano Bassoli,

Hello Stefano,

 

I just followed your advice and it worked well, thanks!

However, is it possible to select the field in the conditions part of the business rules? It doesn't show up there either.

 

Thanks,

Robert

Show all comments

I need to create one printing report for all records in section. I set up word report for this section. I set up button, but it makes separated report for every record.

As result i want to get literaly all records from section in my report. What should I do to get this result: ONE common report with all section records

Like 0

Like

1 comments

Hi,
 

Unfortunately, there is no direct way to perform such printing.

However, you can configure this logic using a workaround.
 

For example, if you want to export all records from the "Invoice" section into a single report, you can follow these steps:


1.Create an "Invoice report" object (optionally, you can create a section for it).

2. In the "Invoice" object, add a lookup column that references "Invoice report" (e.g., UsrInvoiceReport).

3. Create a single record in the "Invoice report" section.

4. Update all Invoice records, setting the UsrInvoiceReport column (from step 2) to the record created in step 3.

5. Create a report based on the "Invoice report" object and add a table section for the "Invoice" object, linking them as follows:
 

Invoice report.Id = Invoice.UsrInvoiceReportId
 

This way, you will generate a report that includes all records from the Invoice table, as they all reference the same record.
 

You can also use this same section for other objects like Document, Order, etc. by repeating steps 2-5.
 

Hope this helps! Take care! 😊

Show all comments

How to Hide the + Add a new step from Next Steps, as "+ Add a new step" button allows users to deviate from these established flows.

 

Like 0

Like

1 comments
Best reply

Hello,

 

Unfortunately, it is not possible to hide "+ Add a new step" button within the "Next step" using OOTB functionality. This can only be achieved with development tools, but we currently do not have examples of such an implementation.

Additionally, we have created a task for the responsible R&D team to consider adding this functionality in future releases.

Hello,

 

Unfortunately, it is not possible to hide "+ Add a new step" button within the "Next step" using OOTB functionality. This can only be achieved with development tools, but we currently do not have examples of such an implementation.

Additionally, we have created a task for the responsible R&D team to consider adding this functionality in future releases.

Show all comments