Link to home
Start Free TrialLog in
Avatar of kali958
kali958Flag for United States of America

asked on

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.
Avatar of SysExpert
SysExpert
Flag of Israel image

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 !
Avatar of kali958

ASKER

There are no local copies. The nsf is on the server in a folder and the ntf is on the root of the server.
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 ?

Avatar of kali958

ASKER

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?
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?
Avatar of kali958

ASKER

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.
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.
Avatar of kali958

ASKER

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?
Avatar of marilyng
marilyng

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!
ASKER CERTIFIED SOLUTION
Avatar of cezarF
cezarF
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kali958

ASKER

With the @MailForward, do I even need the EditGoToField? The email is always sent to the same department?
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.
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.
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.
Avatar of kali958

ASKER

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?
Since all the rest works: no, I don't think so. An Updall won't hurt though...
Avatar of kali958

ASKER

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!
Avatar of kali958

ASKER

Sjef, do you think there is something more than just the @UpdateFormulaContext?
Nope, it's just that I think a Split would have been fair in this case. Never mind, better next time :)
I disagree... Cezar's suggestion was spot on.
Oh, whatever...