osiris612mb Posted May 25, 2005 Posted May 25, 2005 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
Ender Posted May 25, 2005 Posted May 25, 2005 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[].
osiris612mb Posted May 25, 2005 Author Posted May 25, 2005 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......
-Queue- Posted May 25, 2005 Posted May 25, 2005 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 &
osiris612mb Posted May 26, 2005 Author Posted May 26, 2005 locking of fields is not an issue right now, so i was able to re-create your script without those steps.. Thanks a lot
Søren Dyhr Posted May 27, 2005 Posted May 27, 2005 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
-Queue- Posted May 27, 2005 Posted May 27, 2005 Replace Field Contents does not require the field's presence either.
Søren Dyhr Posted May 27, 2005 Posted May 27, 2005 Ah yes i confused it scripted replace ...but it's one of those grayed out when IWP'ing. --sd
-Queue- Posted May 27, 2005 Posted May 27, 2005 A scripted Replace Field Contents works the same way. Or do you mean Replace as used in previous versions?
Søren Dyhr Posted May 27, 2005 Posted May 27, 2005 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
Aaron Bratcher Posted June 2, 2005 Posted June 2, 2005 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)
-Queue- Posted June 2, 2005 Posted June 2, 2005 Freeze Window Go to Record/Request/Page [First] Loop {do something} Go to Record/Request/Page [Exit after last, Next] End Loop
Aaron Bratcher Posted June 3, 2005 Posted June 3, 2005 Go to Record/Request/Page [Exit after last, Next] Cool. Thanks.
Recommended Posts
This topic is 7116 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now