Reputation:
How to write display method on data source - I've two joined table and I want to dynamically change values of grid column after control with Vendors are modified. My goal is to display different ExternalNumber after Vendors control is modified.
I've just written some code but it isn't working.
display str dispExternalItem()
{
CustVendExternalItem ex;
while select ExternalItemId from ex
where ex.ItemId == ReqTrans.ItemId
&& ex.CustVendRelation==CustVend.valueStr()
{
ExternalItemId.text(ex.ExternalItemId);
}
return ex.ExternalItemId;
}
Upvotes: 2
Views: 1240
Reputation: 7627
For edit
methods on datasources AX passes current buffer. Your edit method signature should look like:
display ExternalItemId dispExternalItem(VendTable _vendTable)
{
CustVendExternalItem ex;
select firstOnly ExternalItemId from ex
where ex.ItemId == ReqTrans.ItemId
&& ex.CustVendRelation == _vendTable.AccountNum
;
return ex.ExternalItemId;
}
Also your display method shoud return EDT (ExternalItemId
) instead of str
. And bind to cursor value instead of control string property.
Upvotes: 4