Inconsistent @SetField and "Someone else modified..."

Hi, all,

A very simple button is driving me nuts! I have a view categorized by Approved or Not Yet Approved. When an action button is clicked, it merely changes the value in field #1 and refreshes the doc so that field #2, computed on the value of the field #1, causes it to move from the Not Yet Approved category to the Approved.

Button code:

@If (LatestBI = “Initial BI”; @SetField (“FundApproved”; “Y”); LatestBI = “BI #2”; @SetField (“FundApproved_1”; “Y”); LatestBI = “BI #3”; @SetField (“FundApproved_2”; “Y”); LatestBI = “BI #4”; @SetField (“FundApproved_3”; “Y”); LatestBI = “BI #5”; @SetField (“FundApproved_4”; “Y”); “”);

@Command([ToolsRefreshSelectedDocs])

Problem: sometimes it “blinks” (a flash of progress bar) but the data does not change, so the doc does not switch categories; sometimes I get the “Someone else modified this document at the same time” (I know it means me), and sometimes it actually works fine. If I select three docs before clicking the button, it might work on two out of three, it might work on all three, it might blink with no error message but not change anything, or it might give me that message and not work at all.

Ultimately, I want to place this view on the Welcome page of the users who will be doing this every day, so I thought that might be affecting its behavior… I can understand if I changed a doc in the normal view and then got the “Someone else” message upon hitting the button in the view on the Welcome page, but I have seen it work and not work in all the different combinations above, in both the Welcome page view and in the regular view accessed after opening the db.

I can’t discern a pattern here, although I’m almost sure there must be one… I’ve done this same kind of thing dozens of times in different databases, using only FIELD (and maybe a separate @ToolsRefreshSelDocs agent), with no problem.

The other postings on this topic do not seem to describe the same inconsistent behavior. Why would it work sometimes or work on some selected docs and not others??

TIA

Mark

Subject: Inconsistent @SetField and “Someone else modified…”

Try @Command([ViewRefreshFields])

Subject: RE: Inconsistent @SetField and “Someone else modified…”

Thanks for your response, Bob - that did eliminate the “Someone else modified…” messages. But now it doesn’t refresh the doc at all, and the @SetField is still unpredictable, sometimes changing the field value, sometimes not. Any more ideas??

Subject: RESOLVED re: Inconsistent @SetField and “Someone else modified…”

Thanks to Stan Rogers (on an unrelated posting) I realized that I didn’t have to refresh the whole doc but just recalculate field #2. Once I coded that in and removed all attempts to refresh, it worked - to an extent. With the action button, it only worked on the doc with the heavy black outline around it, regardless of how many docs were selected (with checkmarks in the selection margin). With the same code as an agent in the Actions menu, it worked on all selected docs. I’d like to know why the button code only works on one doc at a time, but at least I can do the same thing a different way.

Subject: RE: RESOLVED re: Inconsistent @SetField and “Someone else modified…”

View actions only work on the document with the focus. Put the same code in your action button into an agent that is set to run on selected documents, change your action button to @Command([ToolsRunMacro];“agent name”) and it should work just fine.

Subject: Inconsistent @SetField and “Someone else modified…”

Don’t you need to save the document once you’ve changed the field?