Notifications
Announcements
No record found.
Hello everyone so i'm trying to make a job that add a registration number, registration type and description to a customer like photo below
can anyone help me please?
Hi wassim,
This registration tab is added as an extension. Refer to the form "LogisticsPostalAddress.Extension".
So, you need to join CustTable >>DirPartyTable >> LogsiticsPostalAddress >> LogisticsLocation >> DirPartyLocation >> TaxRegistration table. You can check each table relations.
You need to make use of the above 7 tables to insert records in to the TaxRegistration table.
Thanks,
Girish S.
thnk you for your quick response Girish. do you think there is a way to pass the DirPartyLocation to the job without entring it manually?
If you have CustTable then with the help of that you can get DirPartyLocation and pass it to the job.
Refer to the below link. You can refer to Solution 2 on the link.
https://community.dynamics.com/365/financeandoperations/b/365finopsknowledge/posts/get-customer-address-by-type-in-dynamics-ax-d365-f-o-x
How do i get custtable?
Initially you said you need to add the registration number against customer. Thats the reason why I mentioned custTable.
CustTable will store details of the customer.
Okey so this is the requirement o the task i need to add Registration Number to multiple customers from a excel file that containes a AccountNum, CountryRegionId,
TaxRegistrationTypeName and a RegistrationNumber .
i will be using CustCustomerV3Entity.
my question is what existing methode in CustCustomerV3 should i use to insert into TaxRegistration.
this the business logic i will be using
class HmcImportRegistrationJob { /// /// Runs the class with the specified arguments. /// /// The specified arguments. public static void main(Args _args) { TaxRegistration taxRegistration; DirPartyTable dirPartyTable; CustTable custTable; DirPartyLocation dirPartyLocation; CustAccount accountNum = "DE-001"; TaxRegistrationTypeCountryId countryRegionId = "USA"; TaxRegistrationTypeName taxRegistrationTypeName = "BRN"; TaxRegistrationNumber taxRegistrationNumber ='Z12345678'; TaxRegistrationType taxRegistrationType = TaxRegistrationType::findByType(taxRegistrationTypeName); TaxRegistrationTypeApplicabilityRule rule = TaxRegistrationTypeApplicabilityRule::findByTypeCountryId(taxRegistrationType.RecId, countryRegionId); custTable = CustTable::find(accountNum); select dirPartyTable where dirPartyTable.RecId == custTable.Party; select dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId; taxRegistration.DirPartyLocation = dirPartyLocation.RecId; taxRegistration.TaxRegistrationTypeApplicabilityRule = rule.RecId; taxRegistration.RegistrationNumber = taxRegistrationNumber; taxRegistration.ValidFrom = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()); taxRegistration.ValidTo = maxDate(); taxRegistration.insert(); } }
CustCustomerV3Entity doesn't have TaxRegistration table. So, there won't be any existing method.
What about the code you have written?
Is that working?
yes it's working it's inserting the data.
i thougt maybe overriding postGetStagingData or insertEntityDataSource?
or do you have any better solution?
thank you Girish
But I think above said method can be used when the TaxRegistration table exist as datasource in the entity.
Instead you can create a new entity with all the required tables along with TaxRegistration table. So that you can use that entity.
i just need CustCustomerV3Entity because it contains CustTable.
from the custaccount i can determine dirpartylocation
and from CountryRegionId, TaxRegistrationTypeName i can determine TaxRegistrationTypeApplicabilityRule
for the RegistrationNumber i will just use the one in the file
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 565 Most Valuable Professional
André Arnaud de Cal... 450 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader