Add display method to PurchTableListPage form

Hi everyone,

I need some help, I need to add a field in the form PurchTableListPage, but the form have a Query as datasource, the query is PurchTableListPage. I want to add a display field to the grid but I can’t add the display method in the datasources. Could anybody help me? I have been trying with no solution.

Thanks in advance.

Hi David,

You can try adding the Display Method to the base table which is already assigned to the Query. You will than be able to add this to the form.

I already put the method in the PurchTable, but when I put a new field in the grid of the form nothing happens. The new field never display. Am I doing something wrong?

Create the display method on the table which Is already in the query of a listpage , then on design part create the field and in that set data method and data source.
Also u can check this blog "theaxapta.blogspot.in/…/how-to-add-new-fieldsmethods-in.html"

I already did that and nothing happens, here is my code, I put this in the PurchTable:

public display DestinationCodeDescription destinationCode()

{

return DestinationCode::find(VendTable::find(this.OrderAccount).DestinationCodeId).Description;

}

And this is the form in the AOT, you can see that I put the new field with the datasource name and the method of the table, but nothing happens

Am I doing this right, or maybe is my AX?

You will find a property called Display target, set it to client it will work. Display methods doesn’t work in EP

I still have problems, the field still doesn’t show with that property. How can I be sure that the method I made is in the PurchTableListPage Query?

You cannot add display method to datasource in the Query. Can you take a screenshot of all the properties of that displaymethod control ?

This is the first one:

The second one:

The third and last one:

Third.jpg

When you open the form, the display method is running, but it doesn’t display in the form

Try to personalize and add the display method to Grid and check if it is showing on the form

I already tried that, and nothing happend. This is strange, I put a display method in SalesLine table, and in Backorder Lines forms, I put a field with that method and I can see the message I put on!

So it sounds like the field is displaying but with no data? Have the got the Table set to “FetchOnlyActive”, if so, the field you are using inside your Display Method might be coming through BLANK and therefore makes it appear to be not working. Have you tried breakpointing and checking your data? Potentially even just returning a String value (eg: return ‘Has some data’) to ensure the method is working correctly.

Thanks to all of you, thanks kristian.hyde, Nash, ravidua31. Everyone helped a lot! After an exhaustive analysis, everthing was right, the method, the field in the form, the properties, everthing. I restore the form (right click in the form → personalize → Restore), and the field finally showed up.