Problem With Matrix Form While using With Date Table

rakesh-ranjan
Member Posts: 7
Hello Every Body..
I have problem with matrix form , i am using matrix record as date record for defining months and base record is customer record. it is running well , while i make a lookup on any field is show correct data but when i leave the control . all record is matrix window is clear. again when i pass the year it doesn't work .
Code in onaftergetrec
Date1.RESET;
Date1.SETRANGE("Period Type",Date1."Period Type"::Year);
Date1.SETFILTER("Period Name",'%1',FORMAT(year));
IF Date1.FINDFIRST THEN
BEGIN
CurrForm.MatrixWindow.MatrixRec.SETRANGE("Period Type",CurrForm.MatrixWindow.MatrixRec."Period Type"::month);
CurrForm.MatrixWindow.MatrixRec.SETFILTER(CurrForm.MatrixWindow.MatrixRec."Period Start",'%1..%2',Date1."Period Start",
Date1."Period End");
Matrixheader := {FORMAT(CurrForm.MatrixWindow.MatrixRec."Period Start") + ' To '+
FORMAT(CurrForm.MatrixWindow.MatrixRec."Period End")}
CurrForm.MatrixWindow.MatrixRec."Period Name";
//FOR i := 2 TO 10 DO
PeriodLength := '1M';
PeriodStartDate := CurrForm.MatrixWindow.MatrixRec."Period Start";
PeriodENDtDate := CALCDATE(PeriodLength,CurrForm.MatrixWindow.MatrixRec."Period Start" );
END;
// Exp1:=0;
DtldCustLedgEntry.RESET;
DtldCustLedgEntry.SETCURRENTKEY("Entry Type","Source Code","Posting Date","Customer No.");
DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Entry Type",DtldCustLedgEntry."Entry Type"::"Initial Entry");
DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Source Code",'sales');
DtldCustLedgEntry.SETFILTER("Posting Date",'%1..%2',PeriodStartDate,PeriodENDtDate-1);
DtldCustLedgEntry.SETRANGE("Customer No.","No.");
DtldCustLedgEntry.CALCSUMS(Amount);
Exp1 := DtldCustLedgEntry.Amount;
//CurrForm.UPDATECONTROLS;
Code on LookUp rec
Date4.RESET;
Date4.SETRANGE(Date4."Period Type",Date4."Period Type"::Year);
Date4.SETFILTER(Date4."Period Name",'%1',FORMAT(Year));
IF Date4.FINDFIRST THEN
BEGIN
CurrForm.MatrixWindow.MatrixRec.SETRANGE("Period Type",CurrForm.MatrixWindow.MatrixRec."Period Type"::"2");
CurrForm.MatrixWindow.MatrixRec.SETFILTER(CurrForm.MatrixWindow.MatrixRec."Period Start",'%1..%2',Date4."Period Start",
Date4."Period End");
CurrForm.MatrixWindow.MatrixRec.SETFILTER(CurrForm.MatrixWindow.MatrixRec."Period Name",Matrixheader);
PeriodLength := '1M';
PeriodStartDate := CurrForm.MatrixWindow.MatrixRec."Period Start";
PeriodENDtDate := CALCDATE(PeriodLength,CurrForm.MatrixWindow.MatrixRec."Period Start" );
END;
// Exp1:=0;
DtldCustLedgEntry1.RESET;
DtldCustLedgEntry1.SETCURRENTKEY("Entry Type","Source Code","Posting Date","Customer No.");
DtldCustLedgEntry1.SETRANGE(DtldCustLedgEntry1."Entry Type",DtldCustLedgEntry1."Entry Type"::"Initial Entry");
DtldCustLedgEntry1.SETRANGE(DtldCustLedgEntry1."Source Code",'sales');
DtldCustLedgEntry1.SETFILTER("Posting Date",'%1..%2',PeriodStartDate,PeriodENDtDate-1);
DtldCustLedgEntry1.SETRANGE("Customer No.","No.");
FORM.RUNMODAL(0,DtldCustLedgEntry1);
Please help me
I have problem with matrix form , i am using matrix record as date record for defining months and base record is customer record. it is running well , while i make a lookup on any field is show correct data but when i leave the control . all record is matrix window is clear. again when i pass the year it doesn't work .
Code in onaftergetrec
Date1.RESET;
Date1.SETRANGE("Period Type",Date1."Period Type"::Year);
Date1.SETFILTER("Period Name",'%1',FORMAT(year));
IF Date1.FINDFIRST THEN
BEGIN
CurrForm.MatrixWindow.MatrixRec.SETRANGE("Period Type",CurrForm.MatrixWindow.MatrixRec."Period Type"::month);
CurrForm.MatrixWindow.MatrixRec.SETFILTER(CurrForm.MatrixWindow.MatrixRec."Period Start",'%1..%2',Date1."Period Start",
Date1."Period End");
Matrixheader := {FORMAT(CurrForm.MatrixWindow.MatrixRec."Period Start") + ' To '+
FORMAT(CurrForm.MatrixWindow.MatrixRec."Period End")}
CurrForm.MatrixWindow.MatrixRec."Period Name";
//FOR i := 2 TO 10 DO
PeriodLength := '1M';
PeriodStartDate := CurrForm.MatrixWindow.MatrixRec."Period Start";
PeriodENDtDate := CALCDATE(PeriodLength,CurrForm.MatrixWindow.MatrixRec."Period Start" );
END;
// Exp1:=0;
DtldCustLedgEntry.RESET;
DtldCustLedgEntry.SETCURRENTKEY("Entry Type","Source Code","Posting Date","Customer No.");
DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Entry Type",DtldCustLedgEntry."Entry Type"::"Initial Entry");
DtldCustLedgEntry.SETRANGE(DtldCustLedgEntry."Source Code",'sales');
DtldCustLedgEntry.SETFILTER("Posting Date",'%1..%2',PeriodStartDate,PeriodENDtDate-1);
DtldCustLedgEntry.SETRANGE("Customer No.","No.");
DtldCustLedgEntry.CALCSUMS(Amount);
Exp1 := DtldCustLedgEntry.Amount;
//CurrForm.UPDATECONTROLS;
Code on LookUp rec
Date4.RESET;
Date4.SETRANGE(Date4."Period Type",Date4."Period Type"::Year);
Date4.SETFILTER(Date4."Period Name",'%1',FORMAT(Year));
IF Date4.FINDFIRST THEN
BEGIN
CurrForm.MatrixWindow.MatrixRec.SETRANGE("Period Type",CurrForm.MatrixWindow.MatrixRec."Period Type"::"2");
CurrForm.MatrixWindow.MatrixRec.SETFILTER(CurrForm.MatrixWindow.MatrixRec."Period Start",'%1..%2',Date4."Period Start",
Date4."Period End");
CurrForm.MatrixWindow.MatrixRec.SETFILTER(CurrForm.MatrixWindow.MatrixRec."Period Name",Matrixheader);
PeriodLength := '1M';
PeriodStartDate := CurrForm.MatrixWindow.MatrixRec."Period Start";
PeriodENDtDate := CALCDATE(PeriodLength,CurrForm.MatrixWindow.MatrixRec."Period Start" );
END;
// Exp1:=0;
DtldCustLedgEntry1.RESET;
DtldCustLedgEntry1.SETCURRENTKEY("Entry Type","Source Code","Posting Date","Customer No.");
DtldCustLedgEntry1.SETRANGE(DtldCustLedgEntry1."Entry Type",DtldCustLedgEntry1."Entry Type"::"Initial Entry");
DtldCustLedgEntry1.SETRANGE(DtldCustLedgEntry1."Source Code",'sales');
DtldCustLedgEntry1.SETFILTER("Posting Date",'%1..%2',PeriodStartDate,PeriodENDtDate-1);
DtldCustLedgEntry1.SETRANGE("Customer No.","No.");
FORM.RUNMODAL(0,DtldCustLedgEntry1);
Please help me
0
Comments
-
Did you step through the debugger? What steps have you taken to determine the possible cause?0
-
look in to production forecast form it may help to you.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