KirkR Posted July 25, 2008 Posted July 25, 2008 Filemaker 9 Adv. I have an order enter FP7 program, and I want to integrate a working FP7 inventory program so that people can open a window, pick an inventory item to be added to a quote in the order entry program. In the Order Entry program I added the Inventory FM file as an external data source. I added the tables from the inventory program to the OE program (but not all the relationships defined in the Inventory program, nor the layouts). When I open a window to the inventory program (calling an open script from the inventory program in a new window) from the OE program, I can select a record, and script the fields to variables. To do this, I have created a COPY fields to VARIABLE script in the OE program, and have it tied to a button on the inventory program layouts list view, so that I can select it from inventory. Here is where the difficulty begins. I need to take these variables and SET FIELDS in the QUOTE. How do I select the quote layout on the OE program? It seems that as the script is being executed from the context of the inventory listing, it is only able to see the layouts in the Inventory program side. Do I need to copy the layouts, data relationships, and scripts from the inventory program to the Order Entry program to get this to work? What am I missing? Thanks, --Kirk
Fitch Posted July 26, 2008 Posted July 26, 2008 You don't have to copy anything over, although it does simplify scripting when it's all in one file. As you've discovered, when you're in Inventory and you need to go do something in OE, you have to call the script that's in OE. Not necessarily for every operation, but for Go to layout you do. Likewise, when you're in OE and you want something to happen in Inventory, you generally have to call a script in Inventory. If you're working with global variables, you need to know that they are file-specific. You can pass variables from one file to another with a script parameter; or you can use global fields to hold your temporary data. That said, there are other ways to accomplish this. You can for example make a layout in any file that's based on a table from any other file, as long as you have a Table Occurrence of it in your relationship graph. This allows you to do most or all of your scripting without hopping back and forth between files. It's also possible to work with related records and fields from another file's tables without requiring a special layout. But the layout you're on -- also known as the "context" -- would have to have a relationship to the external table. (Global fields are an exception, they can be written to and read without a relationship -- the field's table still has to be on your graph, it just doesn't have to be related.)
KirkR Posted July 27, 2008 Author Posted July 27, 2008 Thanks - this helps greatly. I wrote the OE program (customer / vendor / dealer / prospect management, quotes, sales order, work orders, time tracking to-do, price request, commissions, consignment mgmt, and procurement) as one file. The Inventory program was a separate effort, as it could be run independent of the OE program, figuring it would be a piece of cake to integrate. Your post resolves all the integration issues I ran into. By personal convention, I always create a generic table view layout of all fields for every core TO, just so I have a common place to reference fields - not that a user would ever see these layouts, but they are useful in scripting. I now have the generic LINEITEMSQUOTED and the GLOBAL TOs from the OE program in the INVENTORY program, and the script in the INVENTORY layout works great. The only glitch that took a bit of was using the passed QUOTE_ID (LINEITEMSQUOTED is a relational table in a portal on the QUOTE layout) from the OE program to get the INVENTORY item put into the right QUOTE. Thanks again for the help! --Kirk
Recommended Posts
This topic is 5962 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 accountSign in
Already have an account? Sign in here.
Sign In Now