Function for update subform

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Not Verified) This post has 0 verified solutions | 3 Replies | 2 Followers

42 Posts
335 Points
Joined: 2012-10-1
Last Online:
2013-5-15 10:00
Alen posted on 2012-10-18 17:04

Hi All

Would U like to tell me function about update/refresh subform. Like I found that should be new function because CurrPage.Update doesn't work. I need to update 2 fields in purchase order subform.

All Replies

Male
49 Posts
980 Points
Joined: 2012-4-25
Last Online:
2013-3-16 1:02
Location: LA/USA
Solution (Not Verified) Jay replied on 2012-10-18 23:29
Suggested by Erik P. Ernst

Well you can call subform's UPDATE from inside parent page. One solution is:

In the subform page add a new fuction in C/AL Globals named UpdateForm (with a parameter as Boolean) then add the following code in the function:

CurrPage.UPDATE(<boolean parameter name>);

 

Now to refresh the line, go back to your parent page and add the below code in OnValidate tirgger of the control on the header that you are updating:

** supposed PurchLines is the name of the subform page part control

CurrPage.PurchLines.FORM.UpdateForm(TRUE);

 

 

42 Posts
335 Points
Joined: 2012-10-1
Last Online:
2013-5-15 10:00
Alen replied on 2012-10-19 9:14

No I don't need to update control in a main (Purchase Order page), I need in a sub form. The fields that I am changing are new fields in a a Subform Purchase Order Page.

Can I do the same for the subform? Should I explain more specific?

Male
6,752 Posts
156,978 Points
Joined: 1995-10-1
Last Online:
2013-5-22 11:00
Location: Middelfart, Denmark
DynamicsNAVMVP
SystemAdministrator
Erik P. Ernst replied on 2012-11-3 14:03

Alen,

The code by Jay is updating the subform (PurchLines) from the main page (currPage), so if that's not the problem, then what is? You should just call this code CurrPage.PurchLines.FORM.UpdateForm(TRUE);

But which version are you using and is it forms or pages? (You mention both in your post).

Best regards,
Erik P. Ernst
Webmaster 

DUG’s Admin's Blog

Don't forget to "Verify Solution" the post(s) that solved your problem. This credits the experts who helped, earns you points and marks your thread as Resolved so we all know you have been helped.

Page 1 of 1 (4 items) | Get this RSS feed | Bookmark and Share