I have the requirement to check the number of names in the to, cc, and bcc fields to see if the number is greater than 50. If it is, I am supposed to show a yes/no prompt box that will ask them if they meant to send it to that many people. I have the code for the send button that looks like the following:
MEMO_SEND:=“1024”;
total_list := @Trim(EnterSendTo : EnterCopyTo : EnterBlindCopyTo);
number_of_sendees := 0;
num_names := @Elements(total_list);
@For(n:= 1; n<= num_names; n:= n + 1; temp_name := @If(n = 1; @Subset(total_list; 1); n = num_names; @Subset(total_list; -1); @Subset(@Subset(total_list; n); -1));
temp_lookup := @DbLookup("": "NoCache"; "852560A0:00505DB4"; "($VIMGroups)"; temp_name; "Members");
@If(!@IsError(temp_lookup); @Set(“number_of_sendees”; number_of_sendees + @Elements(temp_lookup)); @Set(“number_of_sendees”; number_of_sendees + 1)));
@If(number_of_sendees > 50; @Do(
answer := @Prompt([YesNo]; "Send to Large Audience?"; "Please be advised, you are sending this email to a large audience. Continue?");
@If(answer != 1; @Return(""); ""));"");
FIELD ActionInProgress:=MEMO_SEND;
@If(@Command([FileSave]);@Command([FileCloseWindow]);@Return(“”))
Now…here is the tricky part, I have to make sure that check runs if the user hits the esc key (we have the option Present Mail Send Dialog on).
Any idea of how to run the code on the escape key command?
Thanks in advance.