Item No. Validate on Sales Line

I’m trying to validate the item number on the sales lines to update the Unit Cost on the order with the cost currently on the card using a report. However, if the Status on the sales header is “Released” I would like the report to skip that order’s sales line. What would be the best way to accomplish this. I’ve tried many different ways but can’t seem to accomplish the desired results. Thanks in advance.

Hi,

Try

if SalesHeader.GET(“Document Type”,“Document No.”) then

if SalesHeader.status <> SalesHeader.status::open then

currreport.skip;

Aha! That’s it! I was closer than I thought. Thanks for the quick answer Dave.

Glad to help [:D]

There is an existing base function “TestStatusOpen” on table 37 “Sales Line” that will accomplish this task.

That’s going to cause an error though if the status is not open though. I think he wants to skip the record if it’s not open, not for the user to get kicked out of the report.

Yea, didn’t read it close enough. Rule #1: Make coffee, then answer questions. [:$]