Currform.Update

Angelo
Member Posts: 180
Hello Master,
In Nav 3.7, in Purchase Order and code behind Archive Document, :
ArchiveManagement.ArchivePurchDocument(Rec);
CurrForm.UPDATE(FALSE);
When I want to use the codes above and I insert the codes above in Release Purchase Document(CU 415), amount in PO Archive show amout : 0. In real, amount = 40000 but when I release(with my modified codes), amount = 0 in PO archive.
The problem is Currform.update(false).....if I code in CU 415, Currform.update(false) can not be added only : ArchiveManagement.ArchivePurchDocument(Rec);.
So, What shoul I do to archive PO when release?
In Nav 3.7, in Purchase Order and code behind Archive Document, :
ArchiveManagement.ArchivePurchDocument(Rec);
CurrForm.UPDATE(FALSE);
When I want to use the codes above and I insert the codes above in Release Purchase Document(CU 415), amount in PO Archive show amout : 0. In real, amount = 40000 but when I release(with my modified codes), amount = 0 in PO archive.
The problem is Currform.update(false).....if I code in CU 415, Currform.update(false) can not be added only : ArchiveManagement.ArchivePurchDocument(Rec);.
So, What shoul I do to archive PO when release?
0
Comments
-
Hi Angelo
What you could do is remove the code off the menu item ie take out the RunObject and Codeunit Release Purchase Document and put code into the OnPush trigger for the release of your purchase orders
Set a variable to call the releasing codeunit
then in the OnPush
Realease.run(rec);
archivemanagement.archivepurchdocument(rec);
currform.update(false);
Albert0 -
ArchiveManagement.ArchivePurchDocument(Rec);
where Rec is the Document you want to archive is all what you need.
CurrForm.UPDATE(False); is only refresh of the atual form - if you want archive the document in codeunit, you do not need that, because after the codeunit end, form is refreshed... (I think, but I am not sure)0 -
I think adding the call to the archive coduenit to the release function is the right thing to do.
The term CurrForm refers to "The Current Form", and can only be used from a form object, which is why it causes a compile error when you use it in a codeunit.
The form should automatically refresh, but that doesn't always happen for some weird reason. Adding the call to the codeunit in C/AL code instead of in the button properties will allow you to make the form refresh on your terms.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions