Renaming Customer Price Group Loses Prices

dave_c
Member Posts: 46
When you rename a customer price group the sales code on the sales prices isn't updated to the new name. It just stays with the old name so the price group no longer has any prices associated with it. I can see why this happens, the ValidateTableRelation property is not set on the sales code field of the sales price table. I cannot understand the business logic behind it though. Does anyone have any ideas before I log a call with Microsoft?
0
Comments
-
I found the same problem when renaming customers:
viewtopic.php?f=32&t=64845
I haven't been able to find anything about it, and don't have the ability to log with Microsoft currentlyI was going to test re-enabling the ValidateTableRelation and having a play with it, or failing that, just write some code in the rename trigger of the Customer to update related discounts/prices for now.
If you log it with MS, please let me know what they say
Cheers,
Mark0 -
Hi,
I should have update this thread at the time. I logged it with Microsoft and it was fixed in CU9. They've added code to the delete and rename triggers of the Sales Price Line:OnDelete() UpdateSalesPrices(FALSE); OnRename() UpdateSalesPrices(TRUE);
to call the below new function:LOCAL UpdateSalesPrices(CreateNewSalesPrice : Boolean) SalesPrice.SETRANGE("Sales Type",SalesPrice."Sales Type"::"Customer Price Group"); SalesPrice.SETRANGE("Sales Code",xRec.Code); IF CreateNewSalesPrice THEN IF SalesPrice.FINDSET THEN REPEAT NewSalesPrice := SalesPrice; NewSalesPrice."Sales Code" := Code; NewSalesPrice.INSERT(TRUE); UNTIL SalesPrice.NEXT = 0; SalesPrice.DELETEALL(TRUE);
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