Am experiencing problems with the code below. Trouble is after upgrading a database with the following code in it, the email notification doesn’'t seem to work 100% of the time (email isn’t always sent - seems to work okay if you’re on the same server as the mail-file of the person in the e-mail notification “name” field). Very weird.
Return(null) may not execute the code further, if the first condition is true or error. So try replacing it with double quotes (“”) which makes the code continue. Then with null valkue if may be a problem for further execution of code.
Thanks ever so much for your speedy & sound advice.
But I think what is really the problem is the action which I have in my outline - the send to mgr button does indeed work okay with the code I supplied from my views, apologies for my previous posting.
However, what I think is causing the trouble is the following action I have in the outline - it’s when the document is created with this method that the @mailsend doesn’t route correctly.
list:=“one person”:“a group”;
form:=@Prompt([OKCancelList]:[NoSort]:“Travel Request Type”;“The form is for: “;””;list);
See Yazdi’s comments, also I suspect the problem is that you’re trying to send an email with a doclink to a document that has not yet been saved for the first time. Since the document’s UNID is not finalized until it is saved, a link cannot be created until the save is completed.
Thanks very much for your posts & apologies for posting that 1st snippet of code as I don’t think the error lies there.
I definitely do want to save the doc & close it though. Would definitely agree with you that there’s no need to check the return value of the prompt.
I have that code in a standard form action & it works fine, my mistake. What doesn’t work is creating the same form from an action in the outline with the below code. I mean it creates the forms okay according to what’s picked but when I go to send for manager approval via the form action, the email is not sent & no ‘e-mail sent for delivery’ appears in the status bar when the form action button is clicked on. I know I’m being exceptionally thick - it works fine when I create the form from an action in a view but from the outline it simply doesn’t.
Would greatly appreciate what you think is going wrong in this scenario.
list:=“one person”:“a group”;
form:=@Prompt([OKCancelList]:[NoSort]:“Travel Request Type”;“The form is for: “;””;list);
I’m now thinking that I may need to use @SetTargetFrame & @UpdateFormulaContext to try to resolve my problem. The above code is in an action in an outline in a frame postioned on the left-hand side. Not sure if I need this in the outline action or the action on the travel form (as per first code posting). Can a frame name be anything e.g. “view” or are there system-defined frame names which you shouldn’t use?