How to refresh SalesLine if I change SalesHeader
selece28
Member Posts: 316
Hi all,
I have a problems
My client want me to customize Sales Order Form, so that if i change the Location Code on the Header, all Location Code in the Line is change according to the Location Code in Header.
Here's the scenario
My client want the Sales Order only sale items from 1 location (No multiple location)
If i input the Location Code on the Header, then input the Line, the Location Code will follow the Location Code in the Header.
But after i input some Line, lets say 10 lines. Then i realize i input the wrong Location Code, can i just change it on the Header, and the Line will follow?
I add the following C/AL code in the Location Code -OnValidate() on the Sales Header table:
This Code works but it only refresh the line if i close the form then re open or click the line one by one. Is there any way to refresh all the line after i change the Location Code on the Header? I'm confuse ](*,)
Thanks in advanced
I have a problems
My client want me to customize Sales Order Form, so that if i change the Location Code on the Header, all Location Code in the Line is change according to the Location Code in Header.
Here's the scenario
My client want the Sales Order only sale items from 1 location (No multiple location)
If i input the Location Code on the Header, then input the Line, the Location Code will follow the Location Code in the Header.
But after i input some Line, lets say 10 lines. Then i realize i input the wrong Location Code, can i just change it on the Header, and the Line will follow?
I add the following C/AL code in the Location Code -OnValidate() on the Sales Header table:
SalesLine.RESET;
SalesLine.SETRANGE("Document No.","No.");
IF SalesLine.FIND('-') THEN BEGIN
REPEAT
SalesLine."Location Code" := "Location Code";
SalesLine.MODIFY;
UNTIL SalesLine.NEXT = 0;
This Code works but it only refresh the line if i close the form then re open or click the line one by one. Is there any way to refresh all the line after i change the Location Code on the Header? I'm confuse ](*,)
Thanks in advanced
______________
Regards,
Steven
Regards,
Steven
0
Answers
-
Design the form and add to the location filter onaftervalidate trigger. currform.update(true);0
-
Yes all the line is updated when i change the Header
But now the Header won't change
I add the [currform.update(false);] in the Header form, is that right?
How to make the Header change and the line change according to the Header
Thanks______________
Regards,
Steven0 -
Never mind, i figure it out
i use currform.update(TRUE);
It works
Thank you ara3n, my problems solved______________
Regards,
Steven0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
