Jump to content

Increase values in portal record


Agentshevy

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

Recommended Posts

On a simple invoice DB I built, while adding line items, how can I automatically increase the quantity of the product for products that have already been added.. Rather than having duplicate items occupy the invoice...  Items are added via script... Thanks 

Link to comment
Share on other sites

Script trigger can handle it nicely (please see attached).  Overview:

  • Script trigger attached to LineItem Quantity field OnObjectExit tests if there same product is on same invoice
  • If so, entered quantity is added to the 'other' duplicate (see relational graph for filtered join).
  • Then the current portal row is deleted.

An added benefit of deleting the record is that, if one uses Revert Record/Request at this point, other changes in the parent could be lost as well.  In addition, if one reverts the current new record in the portal, FM refuses to set the related quantity and still allow reversion of the 'parent' line item. 

CombineLines.fmp12.zip

Edited by LaRetta
  • Like 1
Link to comment
Share on other sites

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