Hi All,
I am trying to create a view and I have used the view as the datasource of my form but I want to use a display method
I have seeen the example in the standard view "CustGrossMarginbyAccount_NA" how they have created a display method
display SalesContributionMarginMST contributionMarginMST()
{
SalesCostValue salesCostValue;
salesCostValue = this.costValue();
return this.LineAmountMST - salesCostValue;
}
I have created a display method like below :
display AmountMST remainAmountMST()
{
CustTrans CustTrans;
CustTrans = CustTrans::find(this.RecId1);
return CustTrans.remainAmountMST();
}
then i have created a real field and I have selected the view and in the datasource

and it gives an error
Severity Code Description Project File Line Suppression State
Error Path: [AxForm/CustTransOpenInvoice/Design/Controls/FormGrid/Controls/FormRealControl2/DataMethod:The data method 'remainingAmountMST' was not found on the data source 'CusttransOpenInvoice' or its base table/view. RentAndServices (VAR) [RentAndServices K:\AosService\PackagesLocalDirectory\RentAndServices\RentAndServices\AxForm\CustTransOpenInvoice.xml 0
display AmountMST remainingAmount()
{
AmountMST amount = CustTrans::find(CusttransOpenInvoice.RecId).remainAmountMST();
return amount;
}
Even I have created a display method in the datasource level and it is not reflecting the correct value
Kindly help I am using D 365 FO