Filtering data by username in Employee Portal

kdimitrov
Member Posts: 6
Hello to all,
we need to use Employee Portal Webparts for publishing data to customers and other partners, e. g. a customer should be able to see all his purchases or complaints and their state of processing.
Is there any way of setting a filter connected to the login name of this customer so that he can see only his own purchases and complaints ?
So far I did not find such a possibility in the configuration tools of the EP.
Many thanks to anyone who can give me solution for this task !!!!
Krassimir Dimitrov
we need to use Employee Portal Webparts for publishing data to customers and other partners, e. g. a customer should be able to see all his purchases or complaints and their state of processing.
Is there any way of setting a filter connected to the login name of this customer so that he can see only his own purchases and complaints ?
So far I did not find such a possibility in the configuration tools of the EP.
Many thanks to anyone who can give me solution for this task !!!!
Krassimir Dimitrov
0
Answers
-
[Topic moved from Navision forum to Navision e-Commerce forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Krassimir,
This is possible, with and without additional coding.
With coding:
I think there's an example of how to do this somewhere in this forum.
You would have to modify cdu 6816 (EP Read Data) and add the userid to the DecodeXML.FilterRecordWithStandard- and DecodeXML.FilterRecord-functions.
In these filterfunctions in cdu 6813 (EP Decode XML) you have to add the userid as parameter and add functions like this:
IF TableNo =YourTableNumberHere THEN
SupportFunctions.BuildFilterStringFilterString,FilterType::Const,'YourFilterFieldHere',UserId);
Without coding:
You can also create a seperate webpart for each customer and apply a default filter in the webpart. With 10 customersthis is the easiest solution.
Hope this helps.
Best regards,
Hans0 -
Thank you Hans!
I have implemented a similar solution - I have extended the filter in codeunit 6815 functions GetStandGrpReqTypeFilterFields and GetStandGrpReqTypeFilterKeys with the user-id:
EPGrpRTFilterKeys.SETFILTER("Group Code", '%1|%2', GroupCode, EmployeeUserID);
I take the EmployeeUserID from a global variable in codeunit 6811 - I set it in function ProcessXMLDocument and then read it with a new function GetEmployeeUserID. For this purpose the codeunit must be SingleInstance in order to keep the value of the global variable.
I save the UserID similarly to Group Code in the table 6832 - for this purpose I had to remove the value of the TAbleRelation property of the field 'Group Code'0 -
I want to ask you if there is any possibility to filter results by dates in EP.
For example, i have a list of results from a table ordered by date and I want to display the results only for the actual month.
Im trying to filter the results only for EP but with no success.
I also try to adapt your solution to my case and still no success.
Can anyone give me a hint?0 -
Hi,
This is an example of how i use this sort of filters (i have added this code to codeunit 6813 in function FilterRecord):
IF TableNo =YourTableNo THEN
SupportFunctions.BuildFilterStringFilterString,FilterType::Filter,'YourDateField',STRSUBSTNO(Text001,TODAY));
where Text001 is: '>=%1'
In this example a filter "Enddate >= TODAY" is applied.
In your case you should first calculate the first (01-01) and last date (31-01) of the current month. Then if you change the Text001 to "%1..%2", the code would look something like this:
IF TableNo =YourTableNo THEN
SupportFunctions.BuildFilterStringFilterString,FilterType::Filter,'YourDateField',STRSUBSTNO(Text001,Firstdate,Lastdate));
Good luck.0 -
I have made the code changes that you suggested to CU 6813 and 6816 to filter the userid to the record. it works for Card webparts but on List webparts I get an error:
Navision error (10500): A '=' is missing in TransferFormulaData. WHERE(Salesperson Code=CONST("MLS"),ORDER(Ascending) )
The code I added to 6813 is:
IF TableNo = 13 THEN
SupportFunctions.BuildFilterString(FilterString,FilterType::Const,'Code',USERID);
The code I added to 6816 is:
DecodeXML.FilterRecordWithStandard(XMLDocInFilters,TableNo,GroupCode,RequestType,ListRecordRef,UserID);
and:
DecodeXML.FilterRecord(XMLDocLineFilters,TableNo,LineRecordRef,UserID);
I also added the parameter to the the functions of useridin in the CU 6815.
Any ideas would be greatly appreciated!!??
On other thing I might add -
I am trying to filter the Salesperson Userid to a Salesperson Card in EP. Then i am adding some reports to the SP EP Card. Then I am trying to filter the Contact List to the SP Card - this filter will not (at least I do not know how to get it to filter) pass from the SP card to the Contact List...
So i was adding code to filter table 5050 to the Salesperson and then when the EP opens the Contact List form gives me the error I listed above... ](*,)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