FileCloseWindow & Cannot Locate Field

Hi,

I have the following code in a button for the user to select name(s) from a view. It then forwards another form which inherits values from the open document. (not all the fields, only the ones on the “forward” form.

I receive an error when the new memo is created with the forwarded document in, all the info. is there, but it gives me the error “Cannot Locate Field”. All the fields exist, I’ve even added the SendTo, Subject and Body field to the “forward” form. No luck. However, when the error appears, I just click on OK and it will send.

Another issue I’m having, once the document is forwarded into the new memo, it still displays the open “forwareded” document. How can one close that window. I’ve tried putting @Command ([FileCloseWindow]) after sending, but it doesn’t seem to know how to get a hold of that open doc. Any ideas?


@If(@IsDocBeingEdited;@Success;@Command([EditDocument]));

vNN := @PickList( [Custom] ; “Server” : “Database” ; “View” ; “Title” ; “Text”; 3 );

@Command([RefreshHideFormulas]) ;

FIELD txtMailSent := “Yes”;

FIELD kwrdStatus := “3”;

FIELD Territory := vNN;

vDisclamer := “txtMDisclaimer”;

@Command([Compose];“FwdForm”);

@Command([MailForward]) ;

@Command([EditGotoField];“SendTo”);

@Command([EditInsertText];@Implode(vNN;", "));

@Command([EditGotoField];“Subject”);

@Command([EditInsertText];“Subject Text”);

@Command([EditGotoField];“Body”);

@Command([EditInsertText];vDisclamer)

**

Thank you

Subject: FileCloseWindow & Cannot Locate Field

Frankly, at this level of fields manipulation, it would be a lot more efficient to write all this is Lotusscript rather than in formula language.

As for the “Cannot locate field”, it might be your EditGotoField (“SentTo”). I am not sure, but from memory, I seem to recall that the field you see in the memo is not the SendTo field, its a field designed for data capture, the real sendTo field is a computed field hidden inside the form - so a goto will nto work on it. But I am not sure of that, it’s been ages since the last time I used formula for this kind of job).

Good luck!

Subject: RE: FileCloseWindow & Cannot Locate Field

the field is “EnterSendTo”

Subject: RE: FileCloseWindow & Cannot Locate Field

Yeah, I was thinking on rewriting it in LotusScript. It was an existing db which was created by another developer about 7 years ago. Just thought I would tweak it to get it to work properly, without any major changes to the database as they’ve been happy with it for 7 years. But I’m going to rather do it in Script then, the code will be much more manageable.

Thanks

Subject: RE: FileCloseWindow & Cannot Locate Field

Wow Paul! Thank you. EnterSentTo worked wonderfully!

Now, the only thing I need to figure out how to close the open “forward” document? Then I don’t have to change all the code to script just yet (yes I know it is better practice), but I’m limited for time, as they want it working 100% by Friday. :frowning: Anyway, I’d better start trying things. But please, if you have any suggestions, I would appreciate it. Even just an arrow in the right direction.

Subject: RE: FileCloseWindow & Cannot Locate Field

One last thing to try before rewriting in script is an @UpdateFormulaContext before the FileCloseWindow. This might do the trick.

Emily.

Subject: RE: FileCloseWindow & Cannot Locate Field

you will likely need to switch to lotus script to accomplish this task.