Wajahat wasti
Wajahat wasti

Reputation: 3

How to convert display methods into fields in ax2012

Dear great minds i want to convert this display method into field for PurchLine grid in ax2012 particularly i am facing issue to set condition where to set this condition ?

[SysClientCacheDataMethodAttribute(true)]
display PurchLineShowItemName itemName()
{
    PurchLineShowItemName purchLineShowItemName;

    if (this.ItemId)
    {
        purchLineShowItemName = this.inventTable().itemName(this.inventDim());
    }
    else
    {
        purchLineShowItemName = this.Name;
    }

    return purchLineShowItemName;
}

Upvotes: 0

Views: 1035

Answers (1)

Aliaksandr Maksimau
Aliaksandr Maksimau

Reputation: 2281

I would suggest you to create a view that will have a purchline as a datasource and 2 columns e.g.: PurchLineRecId and ItemName and the second column will be a computed field. Then you can implement this logic in a view method.

Walkthrough: Add a Computed Column to a View

After that you can add this view as form datasourse and join PurchLine by RecId.

Upvotes: 1

Related Questions