Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7116 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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[].

Posted

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......

Posted

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 &

Posted

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

Posted

Replace Field Contents does not require the field's presence either.

Posted

A scripted Replace Field Contents works the same way. Or do you mean Replace as used in previous versions?

Posted

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

Posted

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)

Posted

Freeze Window

Go to Record/Request/Page [First]

Loop

{do something}

Go to Record/Request/Page [Exit after last, Next]

End Loop

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.