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

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

Recommended Posts

Posted

Morning all;

As usual seeking the valuable input from the group. 

I have  a script that is executed by a button that time stamps two fields and one field that sets a values the flag "Yes". 

Field: DateRecordReadyForInvoicing

Field: TimeRecordReadyForInvoicing

Field: FalgRecordReadyForInvoicing, set field to "Yes."

Then I have a button that prints the records with a flag value of "Yes."

My challenge comes in, in clearing the "yes" from the flag field,

I am using the following script but don't seem to be abl to get it to work.

Perform Find "Yes"

Loop 

Exit Loop if flag value is "empty"

Clear "Flag" Field

End loop

It seem to clear the first record but not the found set

 

Any advice is greatly appreciated. 

Thanks

Rudy

Posted (edited)

To loop among the records of the found set and set a field, do this (after performing a find):

Go to Record [ First ]
Loop
  Set Field [ YourTable::FlagRecordReadyForInvoicing; "" ]
  Go to Record [ Next; Exit after last ]
End Loop
Commit Records

Alternatively you could do (again, after performing a find):

Replace Field Contents [ No dialog; YourTable::FlagRecordReadyForInvoicing; Replace with calculation: "" ]
Commit Records

 

 

Edited by comment
Posted (edited)

Hi Rudy,

If you must mark records, the less you touch them the better.  Attached is an example which:

1. reduces number of fields
2. cuts down on frequency you touch the data
3. provides timestamp when invoice was printed

Using timestamp when printed has additional benefits of 1) an audit trail when a group of invoices was printed and 2) allows benchmark stats between when Invoice is ready and when finally generated.

I do not know your process. You may wish to print the list of those skipped or loop a second time and print any skipped from the first round.  You may wish to add robust error trapping - I used an empty field as proof the Set Field[] failed instead.  You may wish to create a calculation of the status (instead of using button bar as I did) if an export is required but this is a rough expansion of Comment's response and not a contradiction of it.

Just some things to consider. 🙂

Invoicing.fmp12

Edited by LaRetta

This topic is 1191 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.