How to refresh the form?
Andwian
Member Posts: 627
I want to make the Whse. Shipment created after Function | Create Whse. Shipment automatically Released, with these code:
Codeunit 5752 Get Source Doc. Outbound\CreateFromSalesOrder(SalesHeader)
After I get back to the Whse. Shipment, the Whse. Shipment actually released, but the form shown Open, thus I have to Refresh it to change it to Release.
How do I can change the Status without having the user to refresh the form?
Codeunit 5752 Get Source Doc. Outbound\CreateFromSalesOrder(SalesHeader)
...
IF WhseRqst.FIND('-') THEN BEGIN
GetSourceDocuments.USEREQUESTFORM(FALSE);
GetSourceDocuments.SETTABLEVIEW(WhseRqst);
GetSourceDocuments.RUNMODAL;
GetSourceDocuments.GetLastShptHeader(WhseShptHeader);
FORM.RUN(FORM::"Warehouse Shipment",WhseShptHeader);
// Add these lines:
IF WhseShptHeader.Status = Status::Open THEN
ReleaseWhseShipment.Release(WhseShptHeader);
END;
After I get back to the Whse. Shipment, the Whse. Shipment actually released, but the form shown Open, thus I have to Refresh it to change it to Release.
How do I can change the Status without having the user to refresh the form?
Regards,
Andwian
Andwian
0
Comments
-
You can try something like this:
CurrForm.UPDATE(FALSE);
REc.GET(rec that you ned)
CurrForm.UPDATE(FALSE);
or i use somtime and some more crazy code:
CurrForm.UPDATE(FALSE);
IF rec.findfirst THEN
CurrForm.UPDATE(FALSE);
REc.GET(rec that you ned)
CurrForm.UPDATE(FALSE);0 -
You acctuale release docuemnt after creating shipment, you can put some global falg in 5752 codeunit like (releaseWhseShipment boolean), call funcion in sales oreder button to set it to true and put some code to release document in 5752 codeunit like:
CreateFromSalesOrder(SalesHeader : Record "Sales Header")
WITH SalesHeader DO BEGIN
TESTFIELD(Status,Status::Released);
CheckLocation(TRUE);
WhseRqst.SETRANGE(Type,WhseRqst.Type::Outbound);
WhseRqst.SETRANGE("Source Type",DATABASE::"Sales Line");
WhseRqst.SETRANGE("Source Subtype","Document Type");
WhseRqst.SETRANGE("Source No.","No.");
WhseRqst.SETRANGE("Document Status",WhseRqst."Document Status"::Released);
IF WhseRqst.FIND('-') THEN BEGIN
GetSourceDocuments.USEREQUESTFORM(FALSE);
GetSourceDocuments.SETTABLEVIEW(WhseRqst);
GetSourceDocuments.RUNMODAL;
GetSourceDocuments.GetLastShptHeader(WhseShptHeader);
// Add these lines:
IF releaseWhseShipment THEN
IF WhseShptHeader.Status = Status::Open THEN
ReleaseWhseShipment.Release(WhseShptHeader);
FORM.RUN(FORM::"Warehouse Shipment",WhseShptHeader);
END;
END;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
- 322 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