赛捷软件论坛's Archiver

klaus.sang 发表于 2008-10-7 00:25

使用代码生成Transaction时处理Credit Limit

使用代码创建Transaction时,经常会遇到当超出Credit Limit时程序报错的情况,这个时候需要手动写入Approve代码,由于Accpac代码设计的缺陷,这里需要使用Try Catch代码,以OE Shipment为例,处理Credit Limit代码如下:<BR><BR>Try<BR>&nbsp;&nbsp; OESHI1headerFields.Item("GOCHKCRDT").Value = "1"<BR>&nbsp;&nbsp; OESHI1header.Process()<BR>Catch ex As Exception<BR>&nbsp;&nbsp; &#39;信用额度超出时产生异常,需要强行忽略<BR>End Try<BR>&#39;Approve by<BR>OESHI1headerFields.Item("APPROVEBY").Value = "ADMIN"<BR>OESHI1headerFields.Item("GOAPPROSEC").Value = "1"&nbsp;&nbsp; <BR>&#39;Approve人员的密码 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>OESHI1headerFields.Item("APPPASSWRD").PutWithoutVerification(ADMIN)&nbsp;&nbsp;&nbsp;&nbsp; <BR>OESHI1header.Process()<BR>OESHI1headerFields.Item("GOCHKCRDT").Value = "1"<BR>OESHI1header.Process()<BR><p>[此帖子已被 stone 在 2008-10-6 21:23:23 编辑过]

klaus.sang 发表于 2008-10-7 00:26

Re:使用代码生成Transaction时处理Credit Limit

改代码是VB.net语法,VB6有所不同,不过原理类似

stone 发表于 2008-10-7 05:21

Re:使用代码生成Transaction时处理Credit Limit

<P>天王发贴了!!</P>

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.