Hi,
In this post, we will view the code to use absolute function of SysComputedColumn in D365FO.
Please refer to my earlier post to know the details about the view DAXCustomerTransMeasures.
Step 1: Created a method "computeAbsValue" to display the sum of ReportingCurrencyAmount for a customer for different transaction types using absolute method of SysComputedColumn. ReportingCurrencyAmount holds negative value of the AmountCur.
public static str computeAbsValue()
{
TableName viewName = tableStr(DAXCustomerTransMeasures);
str reportingCurStr = SysComputedColumn::returnField(viewName, identifierStr(CustTrans), identifierStr(ReportingCurrencyAmount));
return SysComputedColumn::sum(SysComputedColumn::abs(reportingCurStr));
}
Assigned view method "computeAbsValue" to the newly created field "ReportingAmountTotal".
Step 2: Build the solution. In the table browser able to see the reportingCurrency (positive) amount for a customer for different transaction types.
Output:
Regards,
Chaitanya Golla
*This post is locked for comments