最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

COC : try/catch/finally

网络文摘 William 2004浏览 0评论
In D365 F&O Platform Update 21 Microsoft has finally made it possible to use try/catch/finally in chain-of-command methods around the next statement So, this construct is now available: {

// <-Set up some globals or save off and change some table fields values temporarily

try { next ; // <- This was not allowed previously as the rule was that next had to be outside of any blocks—a first-level statement

} finally {

// <–Reset globals and/or restore table field values that were temporarily changed

} } Without this, it was not possible to guarantee the cleanup since an exception would bypass the remainder of the method.
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址