Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Scripting a Find request...ARRGGH!


HowardS

Recommended Posts

I expect that those of you who are professional developers or FM power users will find a simple solution to this problem, but I'm baffled...

 

I'm continuing to work on my Product Importing db -

Here's the background:

 

I have a table called "Items" which holds each line item from an order. Each record is related to table "Orders" by the "OrderNumber" field.

 

There is layout "List - Order" in table "Order" which displays a portal of records with fields Order Number, Ship Date, Customer Order #, etc, based on a self-join relationship through "OrderNumber".

 

There is layout "Invoice" in table "Item" which displays all of the records (items) in an order, based on a find in field "OrderNumber".

 

I would like to have a button (script) in the "List - Order" portal layout which will automate the process.

 

I can't figure out how to take the data in the "OrderNumber" field on the current record in the portal and use it to find the appropriate records to put into the "Invoice" layout.

 

Any help is gratefully accepted!!

 

Thanks

 

Howard

Link to comment
Share on other sites

Which version of FM are you using? Have you tried Going to Related Records with the checkbox for 'show only related records' This will give you the records based off the OrderNumber from the portal.

 

If not, and I am minsunderstanding you, you can pass the record number along in a global field. Enter find mode, then set the field. Then perform find.

 

-John

Link to comment
Share on other sites

Thanks, John.

Yes, I tried that, but somehow I must have the syntax or the field definition wrong.

Can you give me an example of how it would look?

 

Howard

Link to comment
Share on other sites

Sorry for the delay...I've been away for a couple of days.

I'm using FM7.

I'm a bit of a retro newbie: I used to use FM waaaay back in MacSE days...so...what's a "GTRR"??

 

I've also tried doing SetField functions, but I can't seem to get them working. For example, I've tried to move the data in the "OrderNumber" field in the current record into a temp field, then back into the OrderNumber field to do a find:

 

Set Field [HoldOrderNumber; OrderNumber]

Go to Layout ["Invoice"]

Enter Find Mode [Restore;Pause]

Set Field [OrderNumber; HoldOrderNumber]

Perform Find

 

When I try to debug and go and look at the HoldOrderNumber field, nothing's in it!

 

Also, I'm going to do a new post that maybe you can help with, too. I want to automatically create a new related record in a "Financial" table everytime that I create a new record in the "Items" table. The relationship is tied by field "ItemCode".

 

Thx

 

Howard

Link to comment
Share on other sites

Howard make sure that HoldOrderNumber is set as a global field. Also, uncheck the option for the Pause. There should be no pause.

 

GTRR stands for 'Go to Related Record'

 

-John

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use