Add field in InventTrans

Hi,

My requirement is to display ‘Description’ field from ‘dimensions’ table in the overview tab of ‘InventTrans’ form. For this, I have created display method in the ‘InventTransPostingPhysical’ datasource of the form. The issue is ‘Description’ field displays same value for all the records. When the different records are clicked, the value gets modified. How do I display the exact value for each corresponding record.

The display method code is as follows

Display Description cnlINLocationDesc()

{

Dimensions dimensionsLoc;

;

dimensionsLoc = dimensions::find(SysDimension::Location,inventTransPostingPhysical.Dimension[6]);

return dimensionsLoc.Description;

}

Regards,

Raghav.

Hi,

that’s a classic “issue”.

Îf you build a display on datasource level, you have to pass along the parameter of the same data record as the table on which you built the data method on.

In your case your method should look like this:

Display Description cnlINLocationDesc(InventTransPosting _inventTransPostingPhysical)

{

Dimensions dimensionsLoc;

;

dimensionsLoc = dimensions::find(SysDimension::Location, _inventTransPostingPhysical.Dimension);

return dimensionsLoc.Description;

}

I tried with this solution. I’m getting the same output yet.

Regards,

Raghavendra.

In the ‘InventTrans’ form datasource, InventTransPosting is used twice, one is inventTransPostingPhysical and other is InventTransPostingFinancial. By passing the agruments (InventTransPosting _inventTransPostingPhysical), I doubt whether the actual ‘inventTransPostingPhysical’ is passed as argument.

Regards,

Raghavendra.

How can I pass ‘InventTransPostingPhysical’ data source to the display method ?

Regards,

Raghavendra.

Hi I ran accross this same issue. The solution is to put the code in the Table itself, not the table in the datasource. So go to the AOT and put your method in the InventTransPosting table methods. Then on the design of the form, add the new string edit, choose inventtransposting as the datasource, and type your method name in for the datamethod. Make sure to delete any of the methods on the form you already created so they dont conflict with each other.