Problems-Hints and a question for Employee Portal

Arhontis
Member Posts: 667
Hello everyone...
I had some problems with EP and found some solutions that might come handy in the future...
1) I wanted to be able to filter Vendor Ledger Entries depending on userid, but could not do it... So I added a parameter pUserID (text50) to the FilterRecord function in the EP Decode XML codeunit, added some code at the end of that function like:
I also modified the three calls of that function in the EP Read Data codeunit like:
2) I wanted to be able to use filters like CM or CW in the connection header/Line fileds in the "Line field Default Value" but no success... So I just entered some code in the CreateFilterHeadLine function in the EPEncode XML codeunit (almost at the end) like:
Of course it is a little hardcoded, ans someone could always make checks if the field is a date field and generate whichever date filter wants, but I didn't have much time... needed only the CM and CW option to use...
And a question... has anyone made multiple paging with a Header/Line group? I have enormous data and cannot have a detail of thousand lines over the net... Currently I have limited the recs with the CM and CW to show only the last active recs... and used a report to show all of them (in paging of course)
I used Nav4 SP2 for the above implementations... and the SP3 is not that different... only 2 or 3 changes in EP objects have been made...
I had some problems with EP and found some solutions that might come handy in the future...
1) I wanted to be able to filter Vendor Ledger Entries depending on userid, but could not do it... So I added a parameter pUserID (text50) to the FilterRecord function in the EP Decode XML codeunit, added some code at the end of that function like:
// Add the correct String to the End of the Filter //my code start IF (TableNo=25) THEN BEGIN//check if table is vendor ledger entry IF pUserID='ITISME' THEN//building the filter by checking the vMyFilter := 'some test' ELSE vMyFilter := 'another test'; SupportFunctions.GetFieldCaption(TableNo,50006,FieldName); SupportFunctions.BuildFilterString(FilterString,FilterType::Filter,FieldName,vMyFilter); END; END; //my code end SupportFunctions.BuildFilterString(FilterString,FilterType::AddEnd,'','');(my custom filed is the 50006 at the GetFieldCaption above)
I also modified the three calls of that function in the EP Read Data codeunit like:
DecodeXML.FilterRecord(XMLDocLineFilters,TableNo,LineRecordRef,UserID);//the UserID ad the end
2) I wanted to be able to use filters like CM or CW in the connection header/Line fileds in the "Line field Default Value" but no success... So I just entered some code in the CreateFilterHeadLine function in the EPEncode XML codeunit (almost at the end) like:
END ELSE BEGIN IF AddElement( XMLCurrNode,'FIELD', FormatFunctions.IntegerToText(EPConnHeadLine."Line Field No."),DocNameSpace,XMLNewChild) > 0 THEN EXIT; //my code starts here IF EPConnHeadLine."Line Field Default Value"='CM' THEN vTempFilter := FORMAT(CALCDATE('-1M',TODAY))+'..'+FORMAT(TODAY) ELSE IF EPConnHeadLine."Line Field Default Value"='CW' THEN vTempFilter := FORMAT(CALCDATE('-1W',TODAY))+'..'+FORMAT(TODAY) ELSE vTempFilter := EPConnHeadLine."Line Field Default Value"; //my code ends here IF AddElement( XMLCurrNode,'VALUE', //EPConnHeadLine."Line Field Default Value",//comment this line vTempFilter,//modified line by using the vTempFilter DocNameSpace,XMLNewChild) > 0 THEN EXIT; END; END; XMLCurrNode := XMLCurrNode.parentNode; // </FILTER> UNTIL EPConnHeadLine.NEXT = 0; END; XMLCurrNode := XMLCurrNode.parentNode; // </FILTERGROUP> END;(used a text var to build my text... )
Of course it is a little hardcoded, ans someone could always make checks if the field is a date field and generate whichever date filter wants, but I didn't have much time... needed only the CM and CW option to use...
And a question... has anyone made multiple paging with a Header/Line group? I have enormous data and cannot have a detail of thousand lines over the net... Currently I have limited the recs with the CM and CW to show only the last active recs... and used a report to show all of them (in paging of course)
I used Nav4 SP2 for the above implementations... and the SP3 is not that different... only 2 or 3 changes in EP objects have been made...
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