Post with "update all" doesn't "quite" work


#1

Morning all,
New user here transitioning from Filemaker.

The post command with “update all” works but only updates the first record of those that match. Any suggestions for a beginner?

Thank
Pierre


#2

The “updateall” option means that the target database will have “all” the records selected when the search is executed and then the first record that matches the search formula will be acted upon. If you are going to post the same value or values to multiple records you would be best served to do this with your own procedure. Something along these lines:

setactivedatabase "mySecondFile" // whatever is the name of the target file
selectall
select keyField=keyValue // all names would be set to your needs
field dataField
formulafill dataValue
selectall // here you can save or do other things before leaving the second db
setactivedatabase ""

This simply makes the second database active and you select all the records. You then select only those records that match your keyValue in the keyField. Next you go to the dataField and fill the matching records that are selected with the dataValue.

This is the method in the simplest form and can easily be expanded to fill additional fields with additional data as well as doing other things while in the temporarily active second database.


#3

As I understand it, the “all” mode just makes sure the post command is looking for a match in the whole database rather than whatever the currently-selected subset might be. To change more than one record you’d likely want to go with a formulafill statement.


#4

An additional note to the example procedure I suggested above. If you are using a fileglobals to pass values to the temporarily active second database you will have to instead assign their values to local variables so they will be available while the second database is active.


#5

Thanks to Bill and Gary,

Solved my problem. As is often the case: bad interpretation.

P