Hi All,
I was facing a lot of problem to find pegging records in planned production order in D365 F&O, after struggling a lot I found a solution so here I am with you..👇
public display InventTransRefId cplRefID()
{
ReqTrans reqTrans,reqTransSettled;
ReqTransCov reqTransCov;
select reqTrans
where reqTrans.RefId == this.RefId
&& ReqTrans.RefType == this.RefType
&& reqTrans.PlanVersion == this.PlanVersion
join reqTransCov
where reqTransCov.ReceiptRecId == reqTrans.RecId
join reqTransSettled
where reqTransSettled.RecId == reqTransCov.IssueRecId;
if (reqTrans.RefId != '')
{
return reqTransSettled.RefId;
}
}
Many Thanks, Atul Kumar