Question

Need Help Preventing Same Value Selection for Two Fields in Creatio

Hello Creatio Community,

I'm working on a section featuring two fields: a numeric "Project Number" field and a lookup "Parent Project Number" field. I need to set up a safeguard that prevents users from choosing the same value in both fields. Seeking advice on how to implement this effectively within Creatio's environment.

Appreciate your insights

Like 0

Like

1 comments

Hello,

one of the ways to implement this would be using validation, though you would only see that fields are same during save process. to implement this you'd be replacing code for client schema page where you need this check - specifically code for method asyncValidate - its a method describing validity of page before saving. Examples of using it can be found on community, for example here https://community.creatio.com/questions/use-asyncvalidate-minipage

in method you'd descibe interaction you need - if check thats comparing values of 2 fields (need to take actual value of lookup field to compare it to numeric) and if they match throw 

validationResult.success = false;
and message descibing unsuccessfull validation in validationResult.message
then the save wouldnt happen and user would get a message that you specify
Show all comments