add the first Quantity value to previous data and display it using display method
add the first Quantity value to previous data and display it using display method
Hello Henry, its ok. Ill just try to convince my client to display it on a report Thank you.
Thank you for the advice Martin. My requirement exist in Master planning/Common/Planned/View/Requirement profile in Accumulated column but when i trace it its really really hard to understand haha maybe its not time yet but i will not give up on this one. Thank you.
Hi Jason, sorry previously I misunderstood your requirement. if you want to show cumulated qty on form grid control, normally use report will be better.
You're new to AX and insist on doing it. I work in AX for years and I don't think it's a good idea. Also, think about whether you commonly see such design in the standard application and whether it doesn't have a reason. aybe you should think again about if it's the best approach.
If you want running totals, I suggest you build a report.
If you want to use a form anyway, can you please address Sergei's remark? You shouldn't write any code before deciding how the form should behave.
Thank you Henry Xie.. my requirement is to add the current qty and the previous qty and display the sum beside the current qty and on the next line i want to get the previous sum qty the add it to the next line current qty. but i don't how to get the previous record on form datasource.
example:
Qty Sumqty
1 1
2 3 (prev Sumqty + current qty)
5 8 (prev Sumqty + current qty)
-5 3 (prev Sumqty + current qty)
Hello Sergei Minozhenko! my requirements is to add another display method that add previous qty value and the next qty value on a grid.. my problem i don't know how to get the previous value.
Thank you Bala Chandra. I will try it... sorry for asking you this. im a newbe in ax. speaking of Temporary table im just wondering when its value or data will be deleted?
Hi Jeson,
You can place your display method in a table, form data source or directly on a form (similarly with reports).
I will be demonstrating the usage of display methods by a quick example.
1, add a display method on a form datasource
the method looks:
public display Qty DisplayQty(InventTrans _inventTrans)
{
return _inventTrans.qty;
}
2, Add this display method to a form grid control. drag this display method drop to grid. there will be create new field control.
change the [datasource] = InventTrans and the [Data method] = DisplayQty properties of the grid new field control.
Find details in https://docs.microsoft.com/en-us/dynamicsax-2012/developer/using-the-display-method-modifier?redirectedfrom=MSDN
Hi Jeson,
What kind of requirements do you have? You can sort or filter data on the form in different ways and the results of this field will be unpredictable.
Hi Jesen,
You can use tmpFrmVirtualLines table and write the logic to push the previous qty to this table. From this table data can be shown using display method.
You can refer to standard code \Forms\PurchLineCopy\Data Sources\VendInvoiceTrans\Methods\copy
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156