Processing Only Report
 
            
                
                    Lamba                
                
                    Member Posts: 263                
            
                        
            
                    I have to update a field present in Purchase header, from purchase line, for that i have creatd a processing only
report. The report was created on Purchase Header.
The code on the OnAftergetRecord on Purchase Header is:
SETRANGE("No.",PurchLine."Document No.");
SETRANGE("Buy-from Vendor No.",PurchLine."Buy-from Vendor No.");
IF "Purchase Header".FINDFIRST THEN BEGIN
REPEAT
"Indent No." := PurchLine."Indent No"
UNTIL "Purchase Header"."No." <>''
END;
with DataItemTableView property as:SORTING(Document Type,No.) ORDER(Ascending)
Still the field doesn't updates on the Header. I have to update the Indent No. on the header from the Purchase line.
                report. The report was created on Purchase Header.
The code on the OnAftergetRecord on Purchase Header is:
SETRANGE("No.",PurchLine."Document No.");
SETRANGE("Buy-from Vendor No.",PurchLine."Buy-from Vendor No.");
IF "Purchase Header".FINDFIRST THEN BEGIN
REPEAT
"Indent No." := PurchLine."Indent No"
UNTIL "Purchase Header"."No." <>''
END;
with DataItemTableView property as:SORTING(Document Type,No.) ORDER(Ascending)
Still the field doesn't updates on the Header. I have to update the Indent No. on the header from the Purchase line.
0                
            Comments
- 
            You have to take Purchase Line as dataitem..
 Will you have same Indent No. in all Purchase Lines of same Purchase Header?
 You need to write PurchaseHeader.Modify also in repeat loop..0
- 
            now wrote the code on Purchase line:
 SETRANGE("Document No.","No.");
 SETRANGE("Buy-from Vendor No.",PurchHdr."Buy-from Vendor No.");
 IF "Purchase Line".FINDFIRST THEN BEGIN
 REPEAT
 PurchHdr."Indent No." := "Indent No";
 PurchHdr.MODIFY;
 UNTIL "Document No." <>''
 END;
 with DataItemTableView as:
 SORTING(Document No.,Line No.,Document Type) ORDER(Ascending)
 Still not working!!0
- 
            And the indent no. remains same in all cases0
- 
            Instead of fiddling with the code, tell what you want the code to do, because even that isn't completely clear.
 - What use is the indent no. on the header ?
 - What should be shown in case there is more than one line, with different indent nos. ?
 - Why do you "link" the header and the lines based on "document no." and "Buy-From Vendor no." ?0
- 
            The indent no on line remains the same always.
 Now i have created the report on Purchase hdr and Purchase line.
 with DataItemLink of Purchase line as :Document Type=FIELD(Document Type),Document No.=FIELD(No.)
 and with following code on OnAftergetrecord of Purchase line as:
 IF "Indent No" <> '' THEN BEGIN
 "Purchase Header"."Indent No." := "Indent No";
 "Purchase Header".MODIFY(TRUE);
 END;
 and its done.
 Thanx for ur Time Guys 0 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

