Wrong value from display method

I am working on ax 2009

I have been given the task to add the totalamountmst field (tmpcustvendtrans) into the custtable.

For which i wrote the method in the custtable as :

display amountmst TotalBalance()


CustAccount custaccount;


return tmpcustvendtrans::CustTransBalanceCurrency(custtable.AccountNum).TotalAmountMst;


The data Field is : custtable and datamethod : TotalBalance.


I am able to add the required field into custtable , but now when i clicks on different field(accountnum) , its corresponding amount value is displayed in the whole field . I am working on this from last two days and now this is frustrating me a lot.

Thanks is advance.

Hope you understood my query well

You never set anything to custTable variable, therefore custTable.AccountNum will always be empty. You probably meant this.AccountNum.

You would easily find this problem if you used the debugger.

Already tried that

Your code in on the form. Move it to the table.

You know what Martin ??


Thanks a lot , it worked

[:)] You’re welcome.

Just please mark the verified solution.