Announcements
No record found.
I have a data discrepancy, where I need to rename the vendor ids having same party number across all the legal entities to specific number. Anyway to achieve it? Q
Hi Harshal, You can use below sql script in SQL server to find how many records you need to change and based on number of records you can create the logic.
select PARTY from VendTable join DIRPARTYTABLE on VENDTABLE.PARTY = DIRPARTYTABLE.RECID group by VendTable.PARTY Having count(VendTable.PARTY) > 1
For x , you have to use crosscompany keyword to iterate all records, check these articles
http://allaboutax.blogspot.com/2019/05/duplicate-records-in-dynamics-365.html
https://www.d365stuff.co/update_recordset-but-cross-company/ (won't recommend to skip standard validations)
As discussed, primary key can be updated using below article
subscription.packtpub.com/.../renaming-the-primary-key
Hi Mohit,
Thanks for the reply. I was already using these things and was able to resolve my problem.
Good to hear it was solved. Could you verify the answer for future users? Thanks.
Hi ,
I used this piece of code -
while select crosscompany : conCompanies * from vendTable join PartyNumber from partyTable order by PartyNumber where partyTable.RECID == vendTable.PARTY && (partyTable.PartyNumber == '000000126') { if(partyNum == '' || partyNum == partyTable.PartyNumber) { vendTable.AccountNum = vendAccount; vendTable.renamePrimaryKey(); partyNum = partyTable.PartyNumber; } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 527 Super User 2026 Season 1
Giorgio Bonacorsi 473
Adis 284 Super User 2026 Season 1