Tracing a part on hold message in Sales Order Entry

Hi Haso - You nailed it! I was able to get this to work using the your method, and even added checking the date (with a few struggles). Here’s the final result (if it helps anyone else).

image

2 Variables:
image

Execute Custom Code block:

var ttQuoteRow = ttQuoteDtl.Where(w => !w.Unchanged()).FirstOrDefault();

DateTime today = DateTime.Today;

bool isPartOnHold = Db.Part.Any(x => x.Company == ttQuoteRow.Company && x.PartNum == ttQuoteRow.PartNum && x.OnHold == true && x.OnHoldDate <= today);

if (isPartOnHold) {
  throw new Ice.BLException("Part is on-hold and hold date has expired. Please delete line. Contact purchasing if this needs to be corrected.");
}

I found @Aaron_Moreng & @josecgomez thread helpful for the ‘today’ syntax : BPM variable scope - #2 by josecgomez

Thanks again.