Hello everyone,
I want to reset my accounting distribution whenever I change the default dimension on custom EP form. kindly share if you got any idea.
I found the method ResetDistribution in EPdistributionController class but it required parameter (Common _context) which I did not understand how to generate and pass.
Hi Khurshid,
Do you have an accounting distribution screen in EP as well which you are trying to re-populate by resetting?
If not, can't you write the code in field modified at the table level?
Thank you, Gunjan for Replying,
I am doing it in the Expense Report custom page. when I change financial dimension e.g Employee 0001 to 0002. changes appear on Distribute amount form but when I change Employee 0001 to empty. distribute amount form is showing Employee 0001 until I reset the distribution through reset button.
I want reset distribute amount on modified method of default dimension.
I tried to explore EPDistributionController class but failed to construct it in my method.
Is there any way to reset from TrvExpTrans table or dataset?
I was thinking about resetting when you save the expense report line. You can try checking like this before super() call in update() method -
if (this.DefaultDimension != this.orig().DefaultDimension) { //Reset accounting distribution }
I want to know how to do it through x++, I don't want to just delete related Distributions from Accounting distribution and create a new one.
I want to do it in a proper way like reset method in EPDistributionController class.
Properly initialized related class and do reset
Hello Gunjan,
I wrote this code to Reset Accounting distribution in update method of TrvExpTrans
if(this.DefaultDimension != this.orig().DefaultDimension) { select RecId from accountingDistribution where accountingDistribution.SourceDocumentHeader == TrvExpTable::find(this.ExpNumber).SourceDocumentHeader && accountingDistribution.SourceDocumentLine == this.SourceDocumentLine; if(accountingDistribution) { epDistributionController = EPDistributionController::newController(this,MonetaryAmount::ExtendedPrice); epDistributionController.resetDistribution(accountingDistribution.RecId); } } super();
The purpose is to update distribution on updating the default dimension.
Thank you, Gunjan! for support.
Kindly check my code final time and let me know if I am missing something.
regards,
khurshid wali
Is this working for you? I have to check the EPDistributionController part.
Yes It is working!
Great!
Please mark the correct answer(s) as verified.
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 Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 765 Super User 2025 Season 2
CA Neeraj Kumar 743
Sumit Singh 551