使用try catch语句可以解决此问题。在X++中,try catch语句用于捕获和处理异常。在你的代码中,你可以使用try catch来捕获并处理next语句报错的异常。

以下是使用try catch来解决此问题的示例代码:

consInvoiceType = CustConsInvoiceType_JP::construct(custConsInvoice_JP); custTable = CustTable::find(custConsInvoice_JP.CustTable); if(custTable.MnkClosingPattern == MnkClosingPattern::Special) { consInvoiceType.confirmByClosingSpecial(); custConsInvoice_JP = custConsInvoice_JP::find(custConsInvoice_JP.RecId); if(custConsInvoice_JP.Status != CustVendConsInvoiceStatus_JP::Confirmed) { ret = true; } } else { try { ret = next doStandardConfirm(); } catch(Exception::Error) { // 处理next语句报错的异常 // 可以在这里添加你想要执行的代码 }

X++ 我想在某种场合跳过next语句结果报错了:call to next should be done only once and unconditionally 使用try catch怎么解决?中文回答 consInvoiceType = CustConsInvoiceType_JPconstructcustConsInvoice_JP; cus

原文地址: https://www.cveoy.top/t/topic/icYd 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录