How to make field required On change the Picklist values - Forum - Rollbase - Progress Community

How to make field required On change the Picklist values

 Forum

How to make field required On change the Picklist values

  • Hi Team,

    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.

    Thanks,
    Sudhakar.

  • You can write validation logic for your field which generates if no value is set in certain cases (depending on value of another field).


  • the consumer Direct Status field is reference field so i do not have option to write validation

    Thanks,
    Sudhakar.

  • 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  

    Thanks,
    Sudhakar.

  • 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";

    }

    Thanks,
    Sudhakar.

  • 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 ?

    Thanks,
    Sudhakar.

  • 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")

    Thanks,
    Sudhakar.

  • 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

    Thanks,
    Sudhakar.

  • no it is not working,i think it not taking consumer_direst_status value onchange

    Thanks,
    Sudhakar.

  • 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