In the development process, to improve functions and data!
We will give you a friendly interface prompt!
The following is a data error checking mechanism that I often write at work today!
/** Add by xyf 20090923 <br/> remark: <br/> check ty saleorder (custpurchid) of csm_packinglistline tableline <br/> If custpurchid is empty that thorw error user <br/> */<br/> void checkpackinglist () <br/>{< br/> csm_packinglistline _ listline; <br/> csm_packinglisttable _ listtable; <br/> container _ con <br/>; <br/> If (csm_packinglisttable_ds.mark () <br/>{< br/> _ listtable = csm_packinglisttable_ds. Getfirst (1); <br/> while (_ listtable) <br/>{< br/> While select _ listline <br/> where _ listline. packingid = _ listtable. packingid <br/>{< br/> If (_ listline. custpurchid = '') <br/> _ con + = [" 1 "] + [strfmt (" % 1: % 2; % 3: % 4 ", "@ ydt4197", _ listtable. packingid, '@ ydt3234', _ listline. SEQ)]; <br/>}< br/> _ listtable = csm_packinglisttable_ds.getnext (); <br/>}< br/> else <br/> While select _ listline <Br/> where _ listline. packingid = csm_packinglisttable.packingid <br/> {<br/> If (_ listline. custpurchid = '') <br/> _ con + = [" 1 "] + [strfmt (" % 1: % 2; % 3: % 4 ", "@ ydt4197", _ listline. packingid, '@ ydt3234', _ listline. SEQ)]; <br/>}< br/> If (_ con) <br/>{< br/> infolog. viewbuild (_ con, true); <br/> throw error ("Sorry, It is stopping right now! "+"/N "+ 'because ty sales order is empty, please check it'); <br/>}</P> <p>}
You can select multiple form types and check the data. If any data exception is found, it is interrupted.ProgramRun. A detailed error message is displayed!
The running result is as follows: