I have the formula on a Notes workflow application. The formula is on a button and does the routing plus notification.
The formula works fine and the only problem I am running into is that when a document has been authorized by the final approver, the final notification is not sent out unless there is names on the notify field. I would like the final notification to be sent out irregardless of where theres a name on the notify field or not.
Please help.
/* This is the formula on my button */
@If(@IsDocBeingEdited; ""; @Command([EditDocument]));
@If(@IsValid; @Success; @Return(""));
v_approvers:= @Trim(@Replace(@ProperCase(approvers); @ProperCase( @Name([CN]; @UserName) ); ""));
@SetField("SaveOptions"; "1");
@SetField("approvers"; v_approvers);
@SetField("signatures"; ("Approved on " + @Text(@Now) + " by " + @Name([CN]; @UserName)) : signatures);
@SetField("approvals"; ("Approved on " + @Text(@Now) + " by " + @Name([CN]; @UserName)) : approvals);
@SetField("status"; "Approved by " + @Name([CN]; @UserName) +
@If(@Trim(approvers)= ""; "."; ". Notified " + @Subset(approvers; 1) + " on " + @Text(@Now)));
@SetField("SendTo"; user_name : @Subset(approvers; 1) );
@SetField("CopyTo";
@If(@Contains(@LowerCase(status); "notified");
notify;
@If(@IsError(@DbColumn("":""; "":""; "vfinalnotify"; 1));
notify;
notify : @DbColumn("":""; "":""; "vfinalnotify"; 1))
)
);
@MailSend(@Unique(SendTo); @Unique(CopyTo); "";
@If(@Trim(approvers)= "";
"APPX: " + @Left(desc; 50) + " [Approved by the Management]";
"APPX " + @Left(desc; 50) + " [Submitted to " + @Subset(approvers; 1) + " for Approval]");
@If(comments= ""; ""; comments + @NewLine) + @NewLine + @NewLine +
@If(CopyTo = ""; ""; "cc copy: " + @Name([CN]; @Implode(CopyTo; ",")) + @NewLine) +
"Please click on the attached link to view the document" + @NewLine;
"";
[IncludeDoclink]);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])
/* Formula on Copy To field */
@If(@Contains(@LowerCase(status); "notified");
notify;
CopyTo
)
The formula works fine and the only problem I am running into is that when a document has been authorized by the final approver, the final notification is not sent out unless there is names on the notify field. I would like the final notification to be sent out irregardless of where theres a name on the notify field or not.
Please help.
/* This is the formula on my button */
@If(@IsDocBeingEdited; ""; @Command([EditDocument]));
@If(@IsValid; @Success; @Return(""));
v_approvers:= @Trim(@Replace(@ProperCase(approvers); @ProperCase( @Name([CN]; @UserName) ); ""));
@SetField("SaveOptions"; "1");
@SetField("approvers"; v_approvers);
@SetField("signatures"; ("Approved on " + @Text(@Now) + " by " + @Name([CN]; @UserName)) : signatures);
@SetField("approvals"; ("Approved on " + @Text(@Now) + " by " + @Name([CN]; @UserName)) : approvals);
@SetField("status"; "Approved by " + @Name([CN]; @UserName) +
@If(@Trim(approvers)= ""; "."; ". Notified " + @Subset(approvers; 1) + " on " + @Text(@Now)));
@SetField("SendTo"; user_name : @Subset(approvers; 1) );
@SetField("CopyTo";
@If(@Contains(@LowerCase(status); "notified");
notify;
@If(@IsError(@DbColumn("":""; "":""; "vfinalnotify"; 1));
notify;
notify : @DbColumn("":""; "":""; "vfinalnotify"; 1))
)
);
@MailSend(@Unique(SendTo); @Unique(CopyTo); "";
@If(@Trim(approvers)= "";
"APPX: " + @Left(desc; 50) + " [Approved by the Management]";
"APPX " + @Left(desc; 50) + " [Submitted to " + @Subset(approvers; 1) + " for Approval]");
@If(comments= ""; ""; comments + @NewLine) + @NewLine + @NewLine +
@If(CopyTo = ""; ""; "cc copy: " + @Name([CN]; @Implode(CopyTo; ",")) + @NewLine) +
"Please click on the attached link to view the document" + @NewLine;
"";
[IncludeDoclink]);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])
/* Formula on Copy To field */
@If(@Contains(@LowerCase(status); "notified");
notify;
CopyTo
)