Announcements
Hi,
I am new to AX , I have to add one display field ( Customer Account) in Salestable form . I have written code in Salesline FormDatasource but it returns an error
"Error executing code: FormDataSource (data source), method displaycustacnt called with invalid parameters". Here is my code
display CustAccount displaycustacnt(SalesTable _salestable) { SalesLine salesline1; select CustAccount from salesline1 where Salesline1.SalesId == _salestable.SalesId; return salesline1.CustAccount; }
Hi Ram,
it's not possible to filter by display fields. You need to have a physical field in order to do filtering. This is because the value in display field is calculated only when it's displayed on your screen. If you have 10 000 records in your table, only 20 display field values are calculated if you see 20 records on your form. So, the system doesn't know the values of the remaining 9 980 display fields and it's not possible to do any filtering.
If you have some specific business requirement, don't hesitate to share it with us. Perhaps we can propose a solution.
Hi Nikolaos,
Thanks it worked, and also i have to set the filter by field and filter by selection options in it.
Regards,
Ram
You can override jumpRef method to add "View details" for your field.
Hi Nikolaos,
I said for an example. Is there any way to achieve view details option in the display field.
Regards,
Ram
Hi Ram Kumar,
as I already wrote, you don't need a display method to show CustAccount of SalesLine in SalesTable form. Instead of using a display method, set these properties on your field:
- Data source: SalesLine
- Data field: CustAccount
You should only use display methods when you want to display some value which is not directly present in the form data source tables.
And the "View details" will also work with this approach. Although I think it should work also if your display method's return type is CustAccount.
Hi Nikolaos,
Thanks it works. I have to add view details option for that display field. help me on this
Regards,
Ram
If the display method is added to SalesLine data source, then the parameter must be of type SalesLine.
But I don't understand the purpose of this display method. You can just show SalesLine.CustAccount directly on the form, no need for display methods.
André Arnaud de Cal...
294,125
Super User 2025 Season 1
Martin Dráb
232,871
Most Valuable Professional
nmaenpaa
101,158
Moderator