May 25, 200520 yr I have a basic script that does a find, great that works, now once they choose another option with a dialogue box i want a set field or replace fields to take place on all found records. In other words; I want a "g" to be entered into a field when the user prints out a report within a certain found set so that the next script wont "find" those entries next time by omitting records with a "g". What would I use to enter a "g" in all found records? I used set field and it only changed the first record not all of them. Thanks
May 25, 200520 yr The Replace Field Contents[] script step can set a value in a field for all records in the found set, but in a multi-user solution, it's better to use a loop with Set Field[].
May 25, 200520 yr Author I have tried that script and it did nothing. Hmm. And just curious why would a multi-user solution make a difference? And how would you write this loop, I tried something I found in the help files but it didn't work either, but that very well could have been my novice skills......
May 25, 200520 yr Replace Field Contents should work, provided that the target field is not a calculation field or set to not allow modification. A Set Field loop, as Ender suggested, is better in a multi-user system because you can trap for locked records when attempting to set a field. In general, your loop would look something like Freeze Window Set Field [Prefs::Unprocessed; ""] Go to Record/Request/Page [First] Loop Set Field [field; "data"] If [Get(LastError)] Loop Set Field [Prefs::Unprocessed; Prefs::Unprocessed & serial &
May 26, 200520 yr Author locking of fields is not an issue right now, so i was able to re-create your script without those steps.. Thanks a lot
May 27, 200520 yr The Replace Field Contents[] script step can set a value in a field for all records in the found set, but in a multi-user solution, it's better to use a loop with Set Field[]. Set Field[ doesn't rely on presence on the layou, probably the issue here! --sd
May 27, 200520 yr Ah yes i confused it scripted replace ...but it's one of those grayed out when IWP'ing. --sd
May 27, 200520 yr A scripted Replace Field Contents works the same way. Or do you mean Replace as used in previous versions?
May 27, 200520 yr Or do you mean Replace as used in previous versions? I do! Now we have 3: 1) Calc'function 2) the alt-shift-= 3) the shift-cmnd-F (wordprocessor type) --sd
June 2, 200520 yr in a multi-user solution, it's better to use a loop with Set Field[]. Cool! Now the question is... how do I perform a set of actions in a loop for a found set? (New to FM essentially and no scripting reference around here)
June 2, 200520 yr Freeze Window Go to Record/Request/Page [First] Loop {do something} Go to Record/Request/Page [Exit after last, Next] End Loop
Create an account or sign in to comment