This content has been marked as final. Show 9 replies
Sure, we can use validation for this:
Add this to the Field Validation:
PRE('<FieldName>') = IfNull(FieldValue('<FieldName>'),'XXX')
Replace FieldName with the actual field name.
Thanks. This worked perfectly.
Appreciate your help.
Will this validation effect the records that are being updated using integration / web services?
Yes. It will.
So this validation check would not let update the field using integration? Is there a way we could make an exception that it would only allow updates through integration/webservices.
We normally make field updates on Parent record and they get updated in child record through integration process.
Yes, there is a function called ExcludeChannel("Web Services") that will not apply the validation rule to an update that's being made through a Web Services Call. I'm not sure how this would work though, never tried this on Field Validations. It's mostly used with Workflows.
All you need to do to the previous Validation Rule is add AND ExcludeChannel('Web Services'). Please make sure you test this well.
Let me know if it works
Actually, I just thought of a better way of doing this. This should definitely work
You probably would have only 1 user login that would communicate with your CRM On Demand instance via web services. Get the User ID of that username and add this line to the validation.
AND UserValue('<UserId>') not equal to 'XXXX-XXXXX'. For some reason the not equal to sign is not displaying after I submit the post. just replace the not equal to with the opening and closing angle bracket (less than symbol greater than symbol)
Edited by: Royston Goveia on Dec 12, 2012 11:23 AM
I am testing with the Exclude Channel thing and if if doesn't work then will try User Id.
One more thing, what condition should I add to the following expression that I would also check the Null value, because now its letting you update the field if it is blank
PRE('<stParent_Wet_Out_Location_1_ITAG>') = IfNull(FieldValue('<stParent_Wet_Out_Location_1_ITAG>'),'XXX')
Thanks in advance.
Why do we need to use the IfNull condition? -----------------> PRE('<FieldName>') = IfNull(FieldValue('<FieldName>'),'XXX')
What would happen if you have a field with a value and you blank it out and save it (as NULL)... would it not put in the 'XXX' value in there?
Also should it not be the other way around? Current Field Value = Previous Field Value i.e. FieldValue('<FieldName>')=PRE('<FieldName>')
What is the logical difference between:
PRE('<FieldName>') = FieldValue('<FieldName>')
FieldValue('<FieldName>') = PRE('<FieldName>')