PurchReq report--how to display the Project name

Hi,

In the above report, I would like to display the Project name, if the Purchase requisition was created in relation to a project.

Steps which I did

  1. Wrote a method on VendReqJour table to fetch the Project ID and it is working fine in the report. (shown below)

  2. Tried to write a method which will consider the above method and fetch the Project name from ProjTable (But did not work)

Please tell me whether this is the right approach or else please advise me with the right code

Thnx


display str purchreq_projid()

{
str purchreq_projid;
purchreqtable purchreqtab;
;

select purchreqtab where purchreqtab.purchreqid == this.purchreqid;

return purchreqtab.projid;
}

Use this

ProjTable::find(PurchReqTable::find(this.PurchReqId).ProjId).Name;

Dear Kranthi,

You mean I shall write a method as follows:

display str Project_name()

{
str Project_name;
;

ProjTable::find(PurchReqTable::find(this.PurchReqId).ProjId).Name;

;

return Project_name;
}

Thnx

display ProjName projectName()

{

ProjId projId;

ProjName projName;
;

projId = PurchReqTable::find(this.PurchReqId).ProjId;

if (projId)

{

projName = ProjTable::find(projId).Name

}

return projName;

}

Dear Kranthi,

It works…

Thnx