Hey Everyone!
I am a little stuck on this one. Here is the basic structure of the problem:
- Form A (Add_Case)
- Lookup Field (Multi-select): Form B (Add_Contact)
- Single Line Field: Hidden_Permission
- Function: concatPermField
- Single Line Field (Hidden_Permission) is connected to the Function concatPermField and Runs On Success of Form A (Add_Case)
- Form B (Add_Contact)
- Bi-Directional Lookup: Form A (Add_Case)
- Decision Box: Permission_to_share_case_information
Here's the issue: If user creates a contact via Form B (Add_Contact), then checks the Decision Box to True (Permission_to_share_case_information), then the user creates a case via Form A (Add_Case), goes down to Lookup Field (Multi-select) Form B (Add_Contact), adds multiple contacts, and one of the contacts Contact_Group.contains("Client's") = True, then the function works perfectly, and the output of Single Line Field (Hidden_Permission) field equals Function parameters. BUT, if user then goes back to one of the contacts attached to Form A (Add_Case) and changes Decision Box to FALSE (Permission_to_share_case_information), the Single Line Field: Hidden_Permission in Form A (Add_Case) does not update/reflect the change on Form B's Decision Box.
My temporary solution: I created a workflow in Form B (Add_Contact) - see attached screenshot. This work flow works, however, I have to go back to the record from Form A (Add_Case), click the edit record button, then save the record to reflect the change from Form B (Add_Contact) Decision Box (Permission_to_share_case_information).
Is there something I can add to my function or workflow that would automatically update the Single Line Field: Hidden_Permission in Form A (Add_Case) upon changing the setting in Form B (Add_Contact) on the Decision Box (Permission_to_share_case_information) field?
Thank you for any and all help in advance!!!
Function Code:
- string Cases.concatPermField(int case_id)
- {
- case_record = Add_Case[ID == case_id.toLong()];
- case_perm = "";
- for each contact in case_record.Contacts
- {
- if(contact.Contact_Group.Name.contains("Client's") && contact.Hidden_Permission = True)
- {
- case_perm = contact.Name.first_name + " " + contact.Name.last_name;
- }
- else
- {
- case_perm = "Client Only";
- }
- }
- case_perm = case_perm;
- return case_perm.toString();
- }