AnsweredAssumed Answered

Some Calculations are not performed when record created via Script

Question asked by MikeBradshaw on Jul 8, 2012
Latest reply on Jul 9, 2012 by philmodjunk


Some Calculations are not performed when record created via Script



I hope someone can point me in the right direction I have a script that transfers the line items from a quote to an order. For the most part this works, however where i am struggling is to do with currencies.

I have a base currency that the company operates in, a currency that was used for the quote and a currency that is used to purchase the items (by me). All 3 of which could be different.

I have a relationship established between the main order table and the line items, with the main order table and the preferences, product tables.

The script that does the transfer of the line items, firstly creates a new main record for the order and populates this with the main info from the estimate. It then reads the entries for the estimates line items into variables and then creates the necessary new records in the Order Line Item table and uses the Set Field command to write the value from the variable into the relevant field. All seems OK, however if I try to write the Currency Field over to the new record I just get a blank field. If I do a look up I get a blank field and if I try to use a Calculation which basically copies the value from the Preferences (my currency) the Main Order table Order Currency, or the Products Table Supplier Currency I also get a blank field.


I thought that the calculations and lookup would be performed when the record is created (or the key changed).

I have no idea why this is not working as I do not have issues with Lookups or calculated values anywhere else.

I am usung FMP11 on a Mac.

I hope this is enough info.