Customise Primary Key when using Extensions

Developer101
Member Posts: 569
[NAV 2017]
Question:
I know it is not possible to custom the primary key in the standard table and include that table in the extension.
But is there a work around?
What I am trying to do:
The context is - basically when Item is same on multiple sales or purchase lines, the GL entries roll up and show one line as total, I want to separate those lines and show descriptions from document itself. I hope this make sense.
To do that I need to customise table 49 and add description field and then add it to primary key of the table and this is where the issue of extension limitation hits.
Any ideas will be appreciated!!
Ciao!
Question:
I know it is not possible to custom the primary key in the standard table and include that table in the extension.
But is there a work around?
What I am trying to do:
The context is - basically when Item is same on multiple sales or purchase lines, the GL entries roll up and show one line as total, I want to separate those lines and show descriptions from document itself. I hope this make sense.
To do that I need to customise table 49 and add description field and then add it to primary key of the table and this is where the issue of extension limitation hits.
Any ideas will be appreciated!!
Ciao!
United Kingdom
0
Answers
-
How abount using OnBeforeInsert event and modify some field already in PK, but not used in your solution? Tax Area Code for 'ciao' speaking customers seems to be good candidateSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-031 -
Sounds like an idea!, will give it a go. thank you!!United Kingdom0
-
The issue is the length of the field
, Description is 50 chars long and Tax Area Code is 20.
United Kingdom0 -
Hi,
For my current installation, I'm using the field "Line No." of the Sales Line-Table to show the Description per Sales Line in the G/L Entry-table. Maybe it is possible to use the same Field and the field "Fixed Asset Line No." of Table 49 in your solution.My blog - https://www.HannesHolst.com/1 -
Developer101 wrote: »The issue is the length of the field
, Description is 50 chars long and Tax Area Code is 20.
Uppercase, remove spaces and hash the description, and take the first 20 characters of the hash. I'm pretty sure you won't see duplicatesSlawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
Slawek_Guzek wrote: »Uppercase, remove spaces and hash the description, and take the first 20 characters of the hash. I'm pretty sure you won't see duplicates
I wouldn't recommend that. Hashes aren't collission free, so different data can result in the same hash. Cutting the hash will increase that probability.
Counting the unique descriptions and filling one of the unused key fields of table 49 with the corresponding integer value might do the job.
0 -
I wouldn't recommend that. Hashes aren't collission free, so different data can result in the same hash. Cutting the hash will increase that probability.
I woudn't be much worried much about collisions...
Slawek Guzek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-030 -
My math skills are not good enough to prove you wrong, but the calculation of probability for the cut hash just feels wrong. Anyway, if there is a solution that might fail (with whatever probability) and another one that can't fail, I know which one I chose.0
-
Developer101 wrote: »[NAV 2017]
The context is - basically when Item is same on multiple sales or purchase lines, the GL entries roll up and show one line as total, I want to separate those lines and show descriptions from document itself. I hope this make sense.
Keep it simple.
just create a Dimension that maps one:one with the Item no. Then add this to the sales line. This will create a unique Dimension Set ID which will then group by dimension and thus do your grouping by Item automatically.
David Singleton2
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