Setting an record to modified


This is an interesting one, We have a fairly complex freight calculation system and a button to force it to recalculate on the form if something doesn’t look quite right as shown here :-

Syteline Customer Orders Freight Personlaisation

Syteline Customer Orders Freight Personlaisation

 

The Recalculate freight button is linked to an event handler that calls a method  as follows :-

SP!.PBTI_ih_sp_CustomerOrderFreightCalc( PARMS(BSTR P(CoNum), RVAR P(Freight)) )

 

So those of you who are familiar with this will know that the “RVAR” is a Return Variable, and the “P” represents property, so as a result we thought this would be fine, the screen updates to show the newly calculated figure. What we didn’t realise initially was that the record was not being marded as modified if this was the only change that was happening. As a result the user was then processing the order and when the invoice popped out, the freight was wrong.

I have add to add this Sub to the event handler

The Code

Sub PBTI_SetObjectModified()

ThisForm.PrimaryIDOCollection.SetCurrentObjectModified(True)

EndSub

 

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.