Invaild or non existant document error

I have a call log database. In it are two email buttons. Once is Submit to Filing and Submit to Team.

On the Submit to Filing, it uses the following code:

@Command([EditDocument];"1");
@If(!@Command([ViewRefreshFields]);@Return("");"");
@If(@IsNewDoc;FIELD Time_Ends:=@Now;Time_Ends);
FIELD Status :=Status:"Submitted";
FIELD Person := Person: @Name([CN];@UserName);
FIELD Action := Action: "Sent to Filing";
FIELD ActionDate := ActionDate:@Now;
FIELD Sent_By :=@Name([CN];@UserName);
FIELD Sent_Date :=@Now;
FIELD Date_File :=@Today;
@Command([MailForward]);
@PostedCommand([EditGotoField]; "EnterSendTo");
@PostedCommand([EditInsertText]; "Filing-Individual")

Basically it just takes the current call log, saves it and puts it in a email memo so that it can be sent to Filing - but now my users are getting this error Invaild or non existant document once in a while when they send the memo. It will send the memo and save it and it does not impact the database, but I dont know why they are getting this. The other code is for submitting the call log to a Team Email box for review. The code is

@If(!@Command([ViewRefreshFields]);@Return("");"");
@If(@IsNewDoc;FIELD Time_Ends:=@Now;Time_Ends);
FIELD Status :=Status:"Forwarded";
FIELD Person := Person: @Name([CN];@UserName);
FIELD Action := Action: "Forwarded for Review";
FIELD ActionDate := ActionDate:@Now;
FIELD Date_Forward :=@Today;
T:=@Prompt([OkCancelEdit]; "Comments"; "Type your Email comments below.";"");
FIELD Comments :=T;
@Command([ViewRefreshFields]);
@MailSend(Email_Address ; CC ; "" ;"Please review following request";@NewLine+@NewLine+"Email Comments: "+Comments+@NewLine+@NewLine; "";[IncludeDoclink]);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow]);
@Prompt([Ok];"Submitted Request";"Your request has been submitted to "+S_Team);
@PostedCommand([Compose];"Call")

Any help would be great.
kali958Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SysExpertCommented:
Are there local replicas or is this all on hte server ?

It could be corrupted template so do a refrsh design or replace design with the correct temple on the server.

If local, you may need to do something server.

I hope this helps !
kali958Author Commented:
There are no local copies. The nsf is on the server in a folder and the ntf is on the root of the server.
SysExpertCommented:
Then try a refresh design, and if that des not help then a replace design.

What version is the server and clients ?


COuld this be a connectivity issue or an overloaded server ?

Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

kali958Author Commented:
I have tried the refresh and replace of the design

Versions are 6.0.2

This does not happen a lot, just every once in a while for a user but it is not impacting the data, do you think that it could in the long run?
Sjef BosmanGroupware ConsultantCommented:
From the code you presented I cannot quite deduce why the error would pop up.

First guess:
    @If(!@Command([ViewRefreshFields]);@Return("");"");
The document must be in edit-mode to be allowed to execute a ViewRefreshFields command. In you second button, there's no
    @Command([EditDocument];"1");
In your first button, even that command may fail, if the user doesn't have sufficient rights (but I suppose that's not the case?).

It might also be these lines:
    @Command([MailForward]);
    @PostedCommand([EditGotoField]; "EnterSendTo");
    @PostedCommand([EditInsertText]; "Filing-Individual")

These PostedCommands may sometimes be out of context. In which document are these lines to be executed? Are these lines always executed correctly?

Is this all the code on the forms? Anything else in this form that could be relevant, LotusScript code or whatever in the QuerySave and/or PostSave?
kali958Author Commented:
I do not have any thing in the QuerySave or PostSave at this time on the actual form.

The main email I hear that the users are getting the error is the Submit to Filing. The document should be in Edit mode when they click this button due to they should be entering the call data and their final action is to Send it to Filing. I need to have the document opened in the email, so it can be scanned and not a document link. (does that make sense).

Do you think that if I changed it from the @PostedCommand and just change them to @Command? Would I even need them to be posted?

There is not much more on the form. There is a Print and Close button and a Save and Add Another button.
Sjef BosmanGroupware ConsultantCommented:
I wouldn't know if that will do any good, to change the PostedCommands without thoroughly testing. You need this to be reproducable, otherwise you're just shooting in the dark. And so are we.

Better ask your users to pay extra attention when they push that button and the error pops up: what's the status of the document and form, how did they get there, what view is active at that particular moment, etc. etc.
kali958Author Commented:
I was at a user's desk working thru the workflow - I am wondering if it could not be something with the actual persons email box. Due to the error only happens once the mail memo is created and they click Send. The database itself is okay I think...is there any more detail I could get you on this?
marilyngCommented:
Hi sjef_bosman,
> @PostedCommand([EditGotoField]; "EnterSendTo");
Agreed, I've had problems in past trying to do a goto field.. and usually it responded with the error.  Instead I use edit next.  I think what happens is that the code is processing before the form is opened and the fields available.

Regards!
cezarFCommented:
try to add

   @UpdateFormulaContext;

after the @Command([MailForward]);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kali958Author Commented:
With the @MailForward, do I even need the EditGoToField? The email is always sent to the same department?
Sjef BosmanGroupware ConsultantCommented:
I suppose "Filing-Individual" has to be entered into the form, in the right field? Did you already try to add the @UpdateFormulaContext? It won't hurt, I think.
marilyngCommented:
cezar, can always count on you to be the encyclopedia of new Notes commands... fabulous suggestion.. Of course that should do it, because the previous code needs to switch to the new form in order to find and move to the fields.
Sjef BosmanGroupware ConsultantCommented:
I was just leading up to that with "These PostedCommands may sometimes be out of context", but the real question for me were those two last lines: what are they doing there? I prefer to have a very clear picture of the problem before suggesting possible solutions.
kali958Author Commented:
I was trying to follow an example I saw of a Mail Forward command, maybe the last two do not need to be posted?

I have tried the @UpdateFormulaContext, I have a user that is going to test it today to see if this has made a impact.

Do you think that there is a index issue with the database?
Sjef BosmanGroupware ConsultantCommented:
Since all the rest works: no, I don't think so. An Updall won't hurt though...
kali958Author Commented:
So for the @UpdateFormulaContext has helped. I have only one associate getting the error and I am going to sit with them today to see if there is a user error or issue. Thanks!
Sjef BosmanGroupware ConsultantCommented:
:-(
kali958Author Commented:
Sjef, do you think there is something more than just the @UpdateFormulaContext?
Sjef BosmanGroupware ConsultantCommented:
Nope, it's just that I think a Split would have been fair in this case. Never mind, better next time :)
marilyngCommented:
I disagree... Cezar's suggestion was spot on.
Sjef BosmanGroupware ConsultantCommented:
Oh, whatever...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.