Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2022 Release Wave 2Check out the latest updates and new features of Dynamics 365 released from October 2022 through March 2023
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
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.
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
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;
epDistributionController = EPDistributionController::newController(this,MonetaryAmount::ExtendedPrice);
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.
Is this working for you? I have to check the EPDistributionController part.
Yes It is working!
Please mark the correct answer(s) as verified.
Business Applications communities