In acumatica project screen(PM301000) i have add two custome fields. those are UsrOnBudget and UsrCompletedPrec. i need to develop when i check UsrOnBudget check box get PMRevenueBudget.CuryAmount and divide by PMCostBudget.CuryAmount And that value show on UsrCompletedPrec field. Those To Customized Field locate in CT.ContractExt. How can I achieve it?
Solved
Check Box Customization
Best answer by aaghaei
- In the Field Updated Event Handler I see the first parameter is missing. It should be something like _(Events.FieldUpdated<Contract, ContractExt.usrOnBudget> e)
- In CalculateCompletedPerc your las line of code is never going to be executed as you are returning anyways before that point.
Also I suggest
- move your decimal percentage = (actualCostQty / actualRevenueAmount) * 100; into the if so you won’t get error in case you have actualRevenueAmount zero.
- assign either zero or your calculated formula to a variable and return at the end of your method
- Use Base.Projects.Update(contract) as you already have it initiated in the Base.
- Instead of using LINQ you can use GroupBy <AggregateTo<Sum<YourField>>> and tally your project revenue and cost.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.