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

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

Recommended Posts

Posted

This seems like the most basic Find function but I can't make it work. I need a script to go from my portalled Invoice to the related Line Items database and find all the related records. They are related by Invoice Number.

In other words once I am in the Line Items, I need to be able to enter find mode, and somehow use the Invoice number as the Find criterion.

Seems like in Filemaker 5, I could just enter Find mode, then tell the script to go to the Invoice Number field and Paste the contents of the clipboard, then perform the Find. Well, the field never gets pasted into. I can't find any way to script a find request by using the contents of another field, either.

So what works?

Posted

But i'm confused wouldn't a line item have many invoices related to it?

Either way... you work that bit out.

What i suggest you do is add an additional table occurance related by your invoice number and simply use go to related records from line items.. Or if they are related already as your post suggests, just go straight over that relationship using GTRR (go to related record(s))

~Genx

Posted

Sorry i misread your post, just use Go To Related Records directly from Invoice Items to the same TO through which you are viewing your line items on your layout (the portal TO).

Posted

I'm sorry but that just wasn't clear to me. Let's forgewt about the portal for now.

What I am really asking is how can I make a script to out to an external table and search for a variable -- without operator input?

Posted

Jim--

What GenX is saying is that the scenario you describe can be done without a scripted find. If you put a button on the Invoice portal that uses the Go To Related Record command, you can have it go to a layout that is built on a Table Occurrence of your lineitems linked by InvNum, showing only the related items (i.e. the items on that invoice). Whew!

If you still want to script a find, make a script like so:

/* Optional but probably necessary to set a global value to hold the search value */

Set Field[GlobalVals::GlobalSearchField; CurTable::YourFieldToBeSearched]

/* The part where you do the searching... */

Go To Layout[YourSearchLayout]

Enter Find Mode[]

/* Note: You can set any search field with any valid info--Stored globals, hard-coded vars, etc. */

Set Field[CurrentTable::YourSearchField; GlobalVals::GlobalSearchField]

Perform Find[No Dialog]

HTH,

David

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