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 ,
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; } }
Good to hear it was solved. Could you verify the answer for future users? Thanks.
Hi Mohit,
Thanks for the reply. I was already using these things and was able to resolve my problem.
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
André Arnaud de Cal...
292,160
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156