Good Day all. I am having a slight problem that I hope someone can help me with.
I have a field(DocumentType, radio button, text) that when a user selects a value, it auto populates another field(RecipientRole, computed, text, multiple value) with the following code:
@If(@IsDocBeingRecalculated;@DbLookup(“”:“NoCache”;“85257153:00539DD4”; “(Mail Memo Configuration)”;DocumentType;“RecipientRole”);RecipientRole)
Next, I have a hotspot with the following code:
officechoice:=@PickList( [Custom]; “” ; “vwOfficeKeywords” ; “Office List” ; “Select ALL Offices to send this email to.” ; 1 );
FIELD role:=RecipientRole;
choice:=@If(
role=“Assurance Leaders”;
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 6);
role=“Liaison Partner”;
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 7);
role=“Risk Managing Partners”;
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 8);
role=“Team Captain”;
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 9);
role=“Review Team”;
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewTeam” ; officechoice; 2);
“”);
holdhistory := SendTo;
tempa := holdhistory : choice;
@SetField(“SendTo”;@Sort(@Trim(@Unique(tempa))))
As you can see, I also have a SendTo field that gets populated.
Everything is working great, until the RecipientRole field has multiple values(user can only select one DocumentType but, that DocumentType can contain numerous RecipientRoles)…The above code only seems to look at the first value of the RecipientRole field, do the lookup, set the field then exit out…
I have tried using @For for this but I can not get it to work…Here is that code:
officechoice:=@PickList( [Custom]; “” ; “vwOfficeKeywords” ; “Office List” ; “Select ALL Offices to send this email to.” ; 1 );
FIELD role:=RecipientRole;
choice:=@For(n := 1;n <= @Elements(role);n := n + 1;
@If(
@Matches(role[n]; “Assurance Leaders”);
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 6);
@Matches(role[n]; “Liaison Partner”);
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 7);
@Matches(role[n]; “Risk Managing Partners”);
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 8);
@Matches(role[n]; “Team Captain”);
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewOffice” ; officechoice; 9);
@Matches(role[n]; “Review Team”);
@DbLookup( “” : “Nocache” ;“”; “Lookup - ReviewTeam” ; officechoice; 2); “”));
holdhistory := SendTo;
tempa := holdhistory : choice;
@SetField(“SendTo”;@Sort(@Trim(@Unique(tempa))))
Any ideas/code would be greatly appreciated…Thanks in advance