RE: Adding a field with PurchId to PurchReqTableAll
Thankyou Girish S for your help.
I managed to accomplish the task as I found that PurchReqLine table contains a field PurchId and also a field PurchreqTable wish is RefRecId of purchreqTable
then added the Fallowing code as Display method as class extension of PurchReqTabel
[ExtensionOf(TableStr(PurchReqTable))]
final class PurchReqTable_Extension
{
public display PurchId getPurchId()
{
PurchReqLine purchReqLine;
PurchReqTable purchReqTable;
select firstonly PurchId from purchReqLine
where purchReqLine.PurchReqTable == this.RecId;
return purchReqLine.PurchId;
}
}
Then added a string field in PurchTabeList which is the form behind of the display menu Item PurchReqTableAll then set the Data source to PurchReqTbale and add the DataMethod PurchReqTable_Extension.getPurchId.
for the purchTable the task was easier as it contain both purchreqId and purchId so I just adde the fallowing cod as class extension
[ExtensionOf(tableStr(PurchTable))]
final class PurchTable_Extension
{
public display PurchReqId getPurchReqId()
{
PurchTable purchTable;
PurchLine purchLine;
select PurchReqId from purchLine
where purchLine.PurchId == this.PurchId;
return PurchLine.PurchReqId;
}
}
and added a field in purchtable form and set the data source and the data method