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

script performing recurring script


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

Recommended Posts

I need to write a script using a search for a particular sale and show all sellers that participated in that sell. Then I need to perform another script over and over again, but check to make sure that I don't use the same seller number more than once in the script.

ie..

enter find mode

go to field [db1_pro_sale_date]

show custom dialog [Title: ""; Message: "Enter Sale Date"; Buttons: "OK", "Cancel", ""; Input #1: (db_pro_sale_date)]

Peform Find

sort by: [db1_seller_number]

The result would be all records for the [pro_sale_date] sorted by the seller number.

The second script would be:

go to db2

enter find mode

set field [db2_seller_number],(db1_seller_number)

perform find

do it again but omit the db1_seller_number if already used.

Is this possible?

Link to comment
Share on other sites

It is possible (of course) using a looping script. The trick here is that I believe a single seller in db1 has multiple records in the found set. I think what you want is to do something in db2 once for each seller (not each found record). You can do this by looping through db1 records and only executing the script in db2 for a different seller:

Goto Record/Request/Page[first]

Set Field[gSellerNumTemp, ""]

Loop

If[db1_seller_number <> gSellerNumTemp]

Perform Script[external, db2]

End If

Set Field[gSellerNumTemp, db1_seller_number]

Goto Record/Request/Page[next, exit after last]

End Loop

You don't have to perform a find in db2. You can create a relationship from db1 to db2 based upon matching db1_seller_number <--> db2_seller_number. Then just add the step:

Go to Related Record[Your relationship, show only related records]

before the Perform Script[external,db2] script step.

-bd

Link to comment
Share on other sites

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