Programming question

tompynationtompynation Member Posts: 398
When you would add a Boolean to the Purchase Header table, lets say we call it
'Transport Order'.

The same field is added the to Purchase Line table, in here its a lookup field. It looks up his value from the Corresponding Purchase Order.

This field is added the the Purchase Order form, so the user can check/uncheck this field from the Purchase Order (Only in the header).
In the subform, on the purchlines it is not editable.

Now when we are inserting new purchase lines in the subform, this boolean from the header should get copied to these purchase lines.
This works good cause of the lookup.

When the user now unchecks this field, the subform should get updated so that we see the new status of this boolean in the purchase lines for the field 'Transport Order'.

For updating my subform i'm calling following function:

This in the Purchase Header:
Transport Order - OnValidate()
COMMIT;
CurrForm.PurchLines.FORM.UpdateForm(FALSE);

This UpdateForm method is a standard NAV inside the subform.
The only line in this method is the following:

UpdateForm(SetSaveRecord : Boolean)
CurrForm.UPDATE(SetSaveRecord);

But the subform is not updating i still have to click in it, and click away again?

How does this come, normally CurrForm.Update(FALSE) allways worked for me before to update the subform.... :?:

Answers

  • ara3nara3n Member Posts: 9,256
    On the Sales Order Form on the OnAfterValidate Trigger add

    CurrForm.UpdateForm(True);
    CurrForm.PurchLines.FORM.UpdateForm(FALSE);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • krikikriki Member, Moderator Posts: 9,110
    Or maybe even better:
    CurrForm.SAVERECORD;
    COMMIT;
    CurrForm.PurchLines.FORM.UpdateForm(FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • tompynationtompynation Member Posts: 398
    thanks, works good now
Sign In or Register to comment.