How do I call code but supress all windows?

I am trying to batch create blanket sales orders, but it keeps giving me error and warning messages (credit limits, warnings, etc.) I thought (it’s been a while since I used it but…) there was a way to call a codeunit that supressed all pop up, warning, confirmations, etc. so that I can create a whole bunch of Sales Orders from Blanket Sales Orders without having the users keep clicking away or manually changing the code anywhere. Thx

From the Online-help:

quote:


Codeunit.RUN Use this function to load and execute the unit of C/AL code you specify. See also c.RUN. [Ok] := Codeunit.RUN(Number [, Record]) Ok Data type: boolean If you do not include the optional return value, and an error occurs while the system is executing the codeunit, it terminates the execution of the C/AL code that called this codeunit. If you include the return value and there’s an error, the system continues to execute the calling C/AL code. This means you must handle any errors. The possible values are shown below. If Ok is… It means that… TRUE No errors occurred FALSE An error occurred during the execution of the codeunit If you include the return value, the system automatically clears the variables used in the codeunit object before and after it executes the object. If you use the return value in an IF statement which is inside a write transaction, a run-time error occurs unless you commit your data updates before you call Codeunit.RUN.


So basically include the returnvalue like in Ok := CodeUnit.RUN;or IF Codeunit.RUN THEN.. to avoid errors. A good example is Report 296.

Take a look at the SetHideValidationDialog function on the Sales Header table. It may do just what your looking for.

Correct, SetHideValidation is another way, but it includes coding. I was referring to errors (TESTFIELD, ERROR) in my first posting - Confirmations, pupops, warnings etc. in a Codeunit can’t be avoided without some coding.