Topic: Manufacturing Reports - Print Work Orders - DATABASE ERROR

This is the message that prompt out when accessing "Print Work Order" under "Manufacturing Reports"

DATABASE ERROR : Could not find work order 0
sql that failed was : SELECT wo.*,st.description As StockItemName,l.location_name, l.delivery_address,l.email, l.contact FROM workorders wo, stock_master st, locations l WHERE st.stock_id=wo.stock_id AND l.loc_code=wo.loc_code AND wo.id='0' GROUP BY wo.id

Please help.

Re: Manufacturing Reports - Print Work Orders - DATABASE ERROR

No idea. Seems you have invalid record with id '0' in your workorders table.

3 (edited by Apple 09/21/2011 04:07:53 am)

Re: Manufacturing Reports - Print Work Orders - DATABASE ERROR

Hi itronics,
Thank you for your reply.

I noticed this was due to no data is returned by the report's underlying recordset.

Can we display a message of "No record to display." instead of display "Database Error...". to the user.

If I were to set a test condition to intercept the above error, may I know where shall I set it because I can't figure out any underlying SQL from rep409.php.

Please advise. Thank you very much.

Re: Manufacturing Reports - Print Work Orders - DATABASE ERROR

Oh, I see the problem now. The false error is raised when there is no work order in a system smile. I will fix this  misleading message in next minor release. Thanks for pointing this out.
Janusz