What am I missing?

I want to update a field on a parent document from a response document. A search of the online help and a search of this forum all point to using the $Ref field and @SetDocField to do this.

I have a field on the parent document named “Approved”. I have a field on the response document named “Approved”. I have a button on the response document with the following code:

FIELD Approved := “Y”;

@SetDocField ($REF; “Approved”; “Y”);

When I click the button, the “Approved” field on the response document is updated. But the field on the parent document is not changing. I have tried both $REF and $Ref.

UPDATE

I went in striped out all the other code in the button and left just those two lines of code. Now I’m getting a dialog error box when I click on the button. “Invalid UNID;UNID must be a 32 digit hex string.”

I looked at the value of the $REF field in a response document. It has 37 digits in the string.

Now I am COMPLETELY confused about using $Ref!!!

Joe

Subject: What am I missing?

Is the response document already saved? Otherwise is won’t have a valid $Ref field!

If you’re working on a new response document, maybe you should try this:

FIELD Approved := “Y”;

@command([FileSave]);

@SetDocField ($REF; “Approved”; “Y”);

Subject: RE: What am I missing?

Ahhh…THANK YOU!!! THANK YOU!!!

That was the part I was missing! I knew it had to be something simple that I just didn’t know about. I’m not a Notes developer by any stretch of the imagination. But every once in a while, I get asked to play one at work. LOL

It now works like a charm.

Joe