Hello, 

I'm using [Autonumber] field for managing record number data automatically like in the documentation   , Set up an [Autonumber] field | Creatio Academy 

Now, i need to reset the increment  to the 0  if the user clicks  on a button

How to reset the increment ? any idea !

Thank you 

Like 1

Like

1 comments

Hi,

There's no direct way to reset the auto number field. 

It's based on the Sequence object in the DB, you can run the script that will restart the sequence. For example, you could create a business process that will execute a script that will restart the sequence. 



Best regards,

Yuri

Show all comments

How can i hide / show a field based on the user role in freedom UI with business rules or with js code?

Thank you

Like 2

Like

7 comments
Best reply

You can do this with code on a Freedom UI page. 

1) Make sure you add "@creatio-devkit/common" to the page as sdk

2) First add an attribute to the viewModelConfig. I'll call the attribute "IsUserInRole since we'll set it to true/false if the user is in the role. 

viewModelConfig: /**SCHEMA_VIEW_MODEL_CONFIG*/{
    "attributes": {
        "IsUserInRole": {}
    }
}/**SCHEMA_VIEW_MODEL_CONFIG*/

3) Bind the attribute to the visible property of the control by adding the following to the control in the viewModelDiff

"visible": "$IsUserInRole"

4) Now when the view model is initialized, basically the Freedom UI equivalent of the onEntityInitialized on classic pages, do a query using the model to determine if the current user is in the role. We'll use that result to set the attribute:

{
    request: "crt.HandleViewModelInitRequest",
    handler: async (request, next) => {
        await next?.handle(request);
        // get current user
        const sysValuesService = new sdk.SysValuesService();        
        const sysValues = await sysValuesService.loadSysValues();
        const currentUserContact = sysValues.userContact;
 
        // create model query
        userRoleModel = await sdk.Model.create("SysUserInRole");
        const filter = new sdk.FilterGroup();
        await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SysRole.Name", "The Role Name Here");
        await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SysUser.Contact", currentUserContact.value);
 
        // workaround for filters, will be fixed in 8.1
        const newFilter = Object.assign({}, filter);
        newFilter.items = filter.items;
 
        const results = await userRoleModel.load({
            attributes: ["Id"],
            parameters: [{
                type: sdk.ModelParameterType.Filter,
                value: newFilter
            }]
        });
 
        // now set attribute
        request.$context.IsUserInRole = results.length > 0;
    }
}

I didn't test that code, but it should be pretty close. If anything you might need to play with the filter for the model query.

Ryan

Hello,

 

Unfortunately, there is no way to add visibility to the field based on user role via Section Wizard.

 

But we've registered it in our R&D team backlog for consideration and implementation in future application releases.

 

Thank you for helping us to improve our product. 

Bogdan,

but is it possible to calculate page parameter based on Operation permission? And then use this parameter in business rule?

You can do this with code on a Freedom UI page. 

1) Make sure you add "@creatio-devkit/common" to the page as sdk

2) First add an attribute to the viewModelConfig. I'll call the attribute "IsUserInRole since we'll set it to true/false if the user is in the role. 

viewModelConfig: /**SCHEMA_VIEW_MODEL_CONFIG*/{
    "attributes": {
        "IsUserInRole": {}
    }
}/**SCHEMA_VIEW_MODEL_CONFIG*/

3) Bind the attribute to the visible property of the control by adding the following to the control in the viewModelDiff

"visible": "$IsUserInRole"

4) Now when the view model is initialized, basically the Freedom UI equivalent of the onEntityInitialized on classic pages, do a query using the model to determine if the current user is in the role. We'll use that result to set the attribute:

{
    request: "crt.HandleViewModelInitRequest",
    handler: async (request, next) => {
        await next?.handle(request);
        // get current user
        const sysValuesService = new sdk.SysValuesService();        
        const sysValues = await sysValuesService.loadSysValues();
        const currentUserContact = sysValues.userContact;
 
        // create model query
        userRoleModel = await sdk.Model.create("SysUserInRole");
        const filter = new sdk.FilterGroup();
        await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SysRole.Name", "The Role Name Here");
        await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SysUser.Contact", currentUserContact.value);
 
        // workaround for filters, will be fixed in 8.1
        const newFilter = Object.assign({}, filter);
        newFilter.items = filter.items;
 
        const results = await userRoleModel.load({
            attributes: ["Id"],
            parameters: [{
                type: sdk.ModelParameterType.Filter,
                value: newFilter
            }]
        });
 
        // now set attribute
        request.$context.IsUserInRole = results.length > 0;
    }
}

I didn't test that code, but it should be pretty close. If anything you might need to play with the filter for the model query.

Ryan

Thank you. That helps a lot.

Ryan Farley,



I have tried a similar case, where on saving a record writing a validation to check whether it has unique "Code".

 

request: "crt.SaveRecordRequest",handler: async (request, next) => {
// Add any code to execute *before* the save here
 
var accountModel = await sdk.Model.create("Account");
 
const filter = new sdk.FilterGroup();
var codeValue = await request.$context.StringAttribute_enupz4g;
await filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "SMCode", codeValue);
 
	const newFilter = Object.assign({}, filter);
	newFilter.items = filter.items;
 
	const accounts = await accountModel.load({
		attributes: ["Id"],
		parameters: [{
		type: sdk.ModelParameterType.PrimaryColumnValue,
		value: newFilter
		}]
	});
	if(accounts.length > 0){
		isSave = false;
		//Show warning Message
		request.$context.executeRequest({
		type: "crt.ShowDialogRequest",
		$context: request.$context,
		dialogConfig: {
		data: {
		message: "Code already already exists",
		actions: [{
			key: "OK",
			config: {
			color: "primary",
			caption: "OK"
			}
		}]
		}
		}
	});
	}
else{
return next.handle(request);
}
}



I followed your code to check any account has the similar code. Seems like, there is an issue in the filter it throws the below error.







Can you help me in adding the proper filter in this Freedom UI? Or provide a sample code to add filters to retrive data from an entity.



Regards,

Adharsh S

Adharsh,

Change this part: 

const accounts = await accountModel.load({
	attributes: ["Id"],
	parameters: [{
		type: sdk.ModelParameterType.PrimaryColumnValue,
		value: newFilter
	}]
});

To this: 

const accounts = await accountModel.load({
	attributes: ["Id"],
	parameters: [{
		type: sdk.ModelParameterType.Filter,
		value: newFilter
	}]
});

Note, the difference in type. You're specifying a filter, not providing a primary column value. 

Ryan

This is a very common requirement for all clients, this really should be added to the no code Page Designer. Similarly with Operation permissions to be used in visibility conditions.

Show all comments

Hello Community, 

 

I wanted to hide Task Properties button in the pre-Config page.

Any suggestions in achieving it is really helpful.

Thanks

Gargeyi.G

File attachments
Like 0

Like

2 comments

To hide the task properties button in particular pre configured page 



- Create a module for css "UsrPreConfiguredPageCSS" and add the code in LESS :



#{{PageCode}}TaskDetailsButtonContainerContainer{

    display: none;

}



- Add the CSS file in the page client module.





Here {{PageCode}} will be UsrClientUnit_d105110

Hope this helps.



Regards

Goparna Nasina

It would be best to uncheck the "Create activity" checkbox in the pre-configured  page settings in process designer.

https://academy.creatio.com/docs/release/release-notes/7182-release-not…

Solving it with CSS styles is wrong and could stop working at any moment. It uses parts of CSS that are not publicly documented or checked for backward compatibility.

Show all comments

Hi all,



I have multiple edit pages for a section in classic UI and I want to upgrade my instance to freedom UI. How can I set up several form pages in Freedom UI for a section?







Thanks in advance & regards

Goparna Nasina

Like 4

Like

5 comments
Best reply

Goparna Nasina,

This is now possible in Creatio 8.1.

Ryan

Not yet possible in Freedom UI.

Hi community,



Any update on the multiple edit pages in Freedom UI?

Currently we have 3 edit pages for opportunity in our classic UI instance and we wanted to convert the opportunity page to freedom UI page.

Kindly let us know how this can be done.



Thanks in advance

Goparna Nasina

Goparna Nasina,

This is now possible in Creatio 8.1.

Ryan

Ryan Farley,

Thanks Ryan

Ryan Farley,

 

I've a freedom UI section with three edit page, which depends on a lookup field.

Is it possible to control which user can use a specific edit page?

In the classic UI using record permission on lookup values and  a bit of javascript code I can hide the edit pages based on the current user.

Thank you

Show all comments

Hi Community, 

 

I have a requirement to load default quick filter when user opens the record. Currently whenever user changes the filter, the default filter is updated with the latest filter changes. 

 

How can I load the default filter on opening/ adding a record ?

Any suggestions is really helpful.

Like 0

Like

3 comments

Hello,

 

Your business task can be only achieved with the help of separate development process. 

You can use 'entity schema query' filters in particular. Here is the guide on this topic

https://academy.creatio.com/docs/developer/front_end_development/data_o…

 

You can also use this community post with the example of such logic https://community.creatio.com/questions/default-filter-section

Hello Bogdan,

 

could you please help me how can I do it in freedomUI?

GargeyiGnanasekhar,

 

We don't have such example of it's implementation in Freedom UI

Show all comments

Hi,

 

In the classic UI, it was possible to display the image fields on list pages (like for Products). As I am experiencing in the Freedom UI, if I add an image field to the list, the image doesn't display.

 

Is it possible to display images in a list in Freedom UI?

Like 1

Like

1 comments

Hello,

 

Unfortunately, there is no option to display the image fields on list pages in Freedom UI. 

We have registered an idea and forwarded it to our R&D team for further review.

 

Best regards,

Yuliya Gritsenko

Show all comments

Hello Community, 

 

I have a requirement to design a custom search filter in list page in Freedom UI, so that I have a text field and a button.

Now, on entering a number (Plate Number) in the field and on click of button, I wanted to filter only the records that contain the plate number. 

The filter works perfectly. But now when I navigate to any other section, I am seeing a popup message (Un save popup) as shown below.

To clear this error, I tried to save the number entered in the field and the issue is gone until I search for other number. 

Now I received a system error as shown below. 

How can I resolve this?

 

Any suggestions are really helpful.

File attachments
Like 0

Like

1 comments

Good day,

Please try performing a full compilation of the environment.

It is also worth noting that the issue is atypical and requires further investigation from the support team. If the problem is not resolved, please contact our support service: support@creatio.com.



 

Show all comments

Hi,



On our contact page we have business rules regulating the business & mobile phone.



If mobile phone not filled in, business phone is mandatory and vice versa.



On classic UI page, the mandatory " * " signal dynamically disappears when filling in the form.



This does not happen on the new Freedom UI minipage, in the picture here below, the * should have disappeared in front of mobile phone, as the business phone is filled in.



(It will properly save though, in terms of data, the business rules work).



Like 0

Like

1 comments

Hello,

 

Thank you for sharing this information with us. We have created a task to have the responsible R&D team address this behavior in future releases.

Show all comments

Hi,



Is it possible to set a country as default for phones in Freedom UI ?



Always stuck on USA (+1) by default...







Thanks,



Damien

Like 2

Like

10 comments
Best reply

Hello.

In order to set default flags config
{
      "operation": "merge",
      "name": "MobilePhone",
      "values": {
        "displayPhoneMask": true,
/* set view mode with the flags */
        "alwaysShowFlags": true,
/*this block adds required configuration - you should place all parameters here*/
        "countrySelectionConfig": {
          "nationalMode": false,
          "autoHideDialCode": false,
          "excludeCountries": ["ru", "by"],
/*useful feature to set favourites countries - they will be placed at the top */
          "preferredCountries": ["ua", "de", "uk", "pl", "md", "ro", "cz", "sk", "us"],
          "initialCountry":"ua"
        }
      }
    }
BW,
Oleksandr Lisovyi, MasterCRM

Sorry cannot remove the "£", post editing is not working on the community today



Hello Damien,

 

We have checked your request and unfortunately it is not possible to set a phone mask with a certain code by default at the moment, but I registered this idea for our developers so that they would consider the possibility of implementing such functionality in future releases.

Thank you,



This new dropdown list always defaulting to US is actually a decrease towards poorer UI experience vs blank field we used to have (more clicks, slowed down input)



Especially that you cannot type in the country code +41 and it "naturally" goes to the right country, you need to do a manual letter search each time.



On a positive note --> it makes sure  everyone fills in the country codes now and the numbers show in the correct format of the country.

Could you please provide us with updates on this question? May be you have reference for crt.PhoneInput?

Hi, 

Yes, our clients are still asking how can we change the default country, does not make sense for all the international users to be stuck on USA as default. Any update ?

Thanks, 



Damien

When will this functionality be added? Because it's very inconvenient to constantly select a mask. 

Mira Dmitruk,

Good morning

 

Do you know in wich table is the phone codes?, I want in the meantime delete all countries not needed to made easier found the country codes we usually need.

 

Or another way to disable/delete not needed phone codes?

 

Thanks in advance

Julio

Hi everyone. 

 

How can we select the country code by default? 

We must have a system setting to select the country.

luis.goncalves@imdigital.pt,

Hi Luis, the only way I have found is to define, in the object to which the phone numbers belong, the default value with the prefix you need.

 

The problem, is that when saving the record, all phone numbers are saved with that prefix, whether the user has filled them a number or not.

 

Then if you decide to do something with the uncompleted numbers, with a process with a start signal regarding edited record or new record and if the phone numbers have not been filled decide what to do with them, keep as they are or reset to an empty phone number ...

 

Hello.

In order to set default flags config
{
      "operation": "merge",
      "name": "MobilePhone",
      "values": {
        "displayPhoneMask": true,
/* set view mode with the flags */
        "alwaysShowFlags": true,
/*this block adds required configuration - you should place all parameters here*/
        "countrySelectionConfig": {
          "nationalMode": false,
          "autoHideDialCode": false,
          "excludeCountries": ["ru", "by"],
/*useful feature to set favourites countries - they will be placed at the top */
          "preferredCountries": ["ua", "de", "uk", "pl", "md", "ro", "cz", "sk", "us"],
          "initialCountry":"ua"
        }
      }
    }
BW,
Oleksandr Lisovyi, MasterCRM

Show all comments

Hello Community, 

 

I have a requirement to sort the lookup values where value is a text field which contains both letters and number. I wanted to sort it in asc for the numbers first. 

How can we achieve this?

Any Suggestions is helpful 

 

Thanks

Gargeyi.G

 

Like 0

Like

1 comments

Hello,

 

There are no basic system tools to change the alphabetical filtration order. In order to implement custom filtration order additional development will be needed. 

I'd suggest to check the below posts where similar business tasks have been already discussed:

https://community.creatio.com/questions/sorting-values-lookup-field-bes…

https://community.creatio.com/questions/sorting-drop-down-lookup

https://community.creatio.com/questions/freedom-ui-sorting-lookup

https://community.creatio.com/questions/change-order-lookup-values-list

Best regards,

Anastasiia

Show all comments