As shown above, consumer Direct Status (Reference field from Client2 object) is a picklist field editable in the above page (Client status )and Drip Reason (Native in Client object ) is native field.
My requirement is when on changing the consumer Direct Status in client status page,if the value of Consumer Direct Status is DRIP,then we need make Drip reason field as required other wise no need to make required.
Can Any one help me how can i achieve the above.
You can write validation logic for your field which generates if no value is set in certain cases (depending on value of another field).
Hi sudhakar,
This can be achieve with a field validation of Drip Reason field, can be something like this codes.
if("{!R12345#value}" == "DRIP" && "{!drip_reason}" == "") { return "Drip Reason must be specified."; }
Regards,
Orchid
Try using a trigger "Validate Record Data" and specify the sample code above.
the drip reason field we are using in more than 1 page,and we want to make it required only in specific page as shown in above based on consumer Direct Status field change
i try to use following code in Validation record data and added the trigger in workflow action,but even through Consumer direct status value is Drip on loading the page and if i try to change value other than Drip then also it displaying error message,
if("{!R77816268.consumer_direst_status#value}"=="DRIP")
{
return "Drip Reason is required";
}
Try remove the timing "before update" if you specified this to the trigger, but I see something wrong by doing this the validation error came after the record was saved.
i removed the Trigger timing and tried, i too face same thing,it showing error message after saving the record instead of showing before save the record.
How can we overcome that?i.e how can we show error message below/beside the field after save ?
another option in to specify the validation in the drip reason field not in the consumer direct status since that has no validation link, and add a workflow status to the condition "{!status#code}" == "statusCode_here"
Something like:
if("{!R77816268.consumer_direst_status#value}"=="DRIP" && "{!drip_reason}" == "" && "{!status#code}" == "status_code") { return "Must be specified."; }
i did not get the complete thing,can you pls let me about 3rd condition i.e "{!status#code}" == "status_code")
Since you are having a workflow action, that will be an indicator when the validation will be run instead of a particular page.
thank you very much i got it,let me try the code
no it is not working,i think it not taking consumer_direst_status value onchange
Hi Sudhakar,
I see the issue now, the related field seems like not taking effect when changing the values and in the validation it is getting the "before" value. Let my try to report this issue to the team.
Just in case and if possible, try creating a picklist field instead of using the related field, this works for me when I test the picklist in a validation.
Regards,
Orchid
actually the problem why we are using reference field is we do not have space for creating picklist in Client due to Field limitations,that is why we are using reference field.
I see, since you hit the Maximum of 150 integer Fields this includes the picklist, try using Radio buttons if possible which can have Maximum of 50 (not sure if you also hit this 50?). Radio buttons can function or an alternative for single-select picklist too.
Regards,
Orchid
currently we have option for only formula fields and reference fields in client Object,we already crossed 500 fields limitations.
That's a lot, in private cloud you can change the max number of fields.
Regards,
Orchid