Coding OnAfterGetGetrecord trigger disables customercreation

chandrurec
Member Posts: 560
Hi all,
I have written the following coding in Form OnAfterGetRecord trigger to show only the location thats corresponds to the respective Location tagges for that user retail user setup.
recRetailUser.RESET;
IF recRetailUser.GET(USERID) THEN
IF NOT recRetailUser."POS Super User" THEN
BEGIN
IF recRetailUser."Location Code" <> '' THEN
BEGIN
IF "Location Code" <> '' THEN
BEGIN
FILTERGROUP(2);
SETFILTER("Location Code",'%1',recRetailUser."Location Code");
FILTERGROUP(0);
END;
end;
END
ELSE
RESET;
But when I create a new customer, the customer is not getting created .
If anyone knows whats the preoblem in code , Kindly give me the modified code or let me know the solution to make it work.
Thanks in advance.
Regards,
chandru.
I have written the following coding in Form OnAfterGetRecord trigger to show only the location thats corresponds to the respective Location tagges for that user retail user setup.
recRetailUser.RESET;
IF recRetailUser.GET(USERID) THEN
IF NOT recRetailUser."POS Super User" THEN
BEGIN
IF recRetailUser."Location Code" <> '' THEN
BEGIN
IF "Location Code" <> '' THEN
BEGIN
FILTERGROUP(2);
SETFILTER("Location Code",'%1',recRetailUser."Location Code");
FILTERGROUP(0);
END;
end;
END
ELSE
RESET;
But when I create a new customer, the customer is not getting created .
If anyone knows whats the preoblem in code , Kindly give me the modified code or let me know the solution to make it work.
Thanks in advance.
Regards,
chandru.
0
Comments
-
chandrurec wrote:to show only the location thats corresponds to the respective Location tagges for that user retail user setup.
do you want to lookup only location(set for particular user in retail setup)while creating new customer?0 -
Hi Vijay_g,
I want to see only the customers belonging to the location tagges in retail user setup. For this purpose only, I am writing the code in OnAfterGetRecord trigger of the form.
Regards,
chandru.0 -
then write your code to onopen trigger.0
-
Hi Vijay_g,
When I write the coding in OnOpen trigger, its not working when I scroll through the records.
Regards,
chandru.0 -
Try it...
recRetailUser.RESET; IF recRetailUser.GET(USERID) THEN IF NOT recRetailUser."POS Super User" THEN IF recRetailUser."Location Code" <> '' THEN BEGIN FILTERGROUP(2); SETFILTER("Location Code",'%1',recRetailUser."Location Code"); FILTERGROUP(0); END;
0 -
Hi Vijay_g,
I tried the coding sent by you but still the same error persists.Filtering is happening but when I try to create a new customer , I cannot create it which is what I mentioned in the first post.
Thanks & Regards,
chandru0
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