Product Receipt validation in Extension using COC D365FO
Using following code you can perform custom validation on product receipt using COC
[ExtensionOf(classstr(PurchPackingSlipJournalCreate))]
final class
SLD_PurchPackingSlipJournalCreate_Extension
{
protected boolean check()
{
PurchParameters purchParam=PurchParameters::find();
boolean flag= next check();
flag= flag
&& this.validatePackingSlip(flag);
return flag;
}
public boolean validatePackingSlip(boolean flag)
{
if(flag && this.purchParmUpdate.DocumentStatus==DocumentStatus::PackingSlip)
{
}
return flag;
}
}