You need to sign in to do that
Don't have an account?
Want to add validation in picklist Before Closing a Case
Hi folks,
I have a custom code for dependent Picklist lightning component which is inserted in the case ,like below,now my requirement is whenever user wants to close the case ,i need to display a message in my custom picklist lightning component as below
"Level 1, level 2 and level 3 field must be populated before saving."
Here is the case stages as "CLOSED" and custom picklist component screenshot

Your help is highly apreciated
Regards,
Fiona
I have a custom code for dependent Picklist lightning component which is inserted in the case ,like below,now my requirement is whenever user wants to close the case ,i need to display a message in my custom picklist lightning component as below
"Level 1, level 2 and level 3 field must be populated before saving."
Here is the case stages as "CLOSED" and custom picklist component screenshot
Your help is highly apreciated
Regards,
Fiona
Hi Fiona,
Here is what I suggest without making any changes in the lightning component.
1. On the Case Object Create a Rollup Summary Field
2. Use the following Validate Rule on the Case Object

Here is the validation rule code for you convenience
I hope this will help, what you are looking for
All Answers
Is Level 1, Level 2 and Level 3 are custom fields on the case or they are just and input field in the component. Do you know where you store those information on the Case Level?
here is controller. js Here is apex from which data coming
Thanks,
Fiona
Hi Fiona,
Here is what I suggest without making any changes in the lightning component.
1. On the Case Object Create a Rollup Summary Field
2. Use the following Validate Rule on the Case Object

Here is the validation rule code for you convenience
I hope this will help, what you are looking for
Was the last solution working?
I would also like to help on this if not yet resolved
https://developer.salesforce.com/forums/ForumsMain?id=9062I000000IYdpQAG
Please let me know if my solution works or you are looking in a different way.
Thanks ,but still dont see the validation message,created a roll up summary then added a validation rule like
Which SObject you created a rollup summary? Can you share some details Also on which SObject you created a validation rule (They both should be created on the Case SObject). Any details that help me find the issue.
validation rule on case object
will reiterate Level1 ,Level2 and Level3 are fields in ERT_Case_Type__c custtom object and Case has Master detail relationship with ERT_Case_Type__c
Strange so when you try to save the Case with Status = Closed and there is not record in teh ERT_Case_Type__c. You don't see any message from the validation rule. Can you check what you get in the rollup summary when you a record and when you don't (=0)
Is this the way you child ERT_Case_Type__c custom sobject is define
Can you check how that Rollup Summary field shows up on the UI?
This is most out of box solution I can think off. Any other solution will lead us to customization.
Do you need help on this https://developer.salesforce.com/forums/ForumsMain?id=9062I000000IYdpQAG or you are good?