AnsweredAssumed Answered

Problem with altering the discount option in the FMPro12 'Invoices' Starter Solution

Question asked by Bazz on Dec 30, 2013
Latest reply on Jan 2, 2014 by philmodjunk

Title

Problem with altering the discount option in the FMPro12 'Invoices' Starter Solution

Post

     Hi Phil et al,

     I'm trying to alter the startup solution so that it displays a discount via line item on a lookup? basis from a related field in the Customers table.

     Background….

     I added two product items, one called "testproduct12" and one called "testproduct13" to use as test products to determine if my discount logic works. 

     i then added a "Customer Discount" field to the Customers table. It's a calculation field which reads:  if (Invoice Data::Item = "testproduct12" ; .12; if (Invoice Data::Item = "testproduct13" ; .13))

     I then altered the portal found on the Invoice Details layout so that it correctly referenced my new Customers::Customer Discount field.

     Result…..      

     This all works fine for the first line in the portal whereby if i select "test12product" then .12 returns correctly and if I select "testproduct13" then .13 is returned correctly.

     Problem…..

     The problem occurs on line 2 of the portal where the value returned remains the same as that for the 1st line of the portal no matter which product is selected on line 2. i.e. if line 1 reads "testproduct12" then .12 is returned on line 2 even if line 2 reads "testproduct13"

     Can you assist with a script? solution which will restart for each line on the portal or am I barking up the wrong tree? (I did try adding a discounts table but I could not get this to work no matter where I joined the table)

     Many thanks in advance,

     Bazz

      

      

      

Outcomes