4000-520-616
欢迎来到免疫在线!(蚂蚁淘生物旗下平台)  请登录 |  免费注册 |  询价篮
主营:原厂直采,平行进口,授权代理(蚂蚁淘为您服务)
咨询热线电话
4000-520-616
当前位置: 首页 > 新闻动态 >
热卖商品
新闻详情
.../ QB PHP集成更新mysql表时,是否可以跳过已在QuickBooks数据库...
来自 : CSDN技术社区 发布时间:2021-03-25

I am using Consolibyte\'s PHP/QB integration to insert/update customers to QB on a local machine.

When I initially run the PHP script to insert information from mysql DB to QB,everything went through--GREAT.

However, when I added a new customer into the mysql DB and ran the consolibyte script again, I received the following error:

Description:Error message received from application via getLastError(): 3100: The name \"John Smith\" of the list element is already in use.

I know that I can\'t insert a duplicate name, but is there a way I can tell the script to skip names that are already in the QB database, instead of aborting the script due to a duplication error?

According to the documentation, I can pass a unique identifier into QB and make it unique, but my objective is to skip this process as a whole

http://www.consolibyte.com/wiki/doku.php/quickbooks_error_codes

FUNCTION.PHP

function _quickbooks_customer_add_request($requestID, $user, $action, $ID, $extra, $err, $last_action_time, $last_actionident_time, $version, $locale) CustomerRef  ListID 80003579-1231522938 /ListID  /CustomerRef  $customer = mysql_fetch_assoc(mysql_query(\"SELECT * FROM qb_cust_test WHERE cust_id = \" . (int) $ID)); $xml = \' ?xml version=\"1.0\" encoding=\"utf-8\"?  ?qbxml version=\"2.0\"?  QBXML  QBXMLMsgsRq onError=\"stopOnError\"  CustomerAddRq requestID=\"\' . $requestID . \'\"  CustomerAdd  Name \'.$customer[\'f_name\'].\' \'.$customer[\'l_name\'].\' /Name  FirstName \'.$customer[\'f_name\'].\' /FirstName  LastName \'.$customer[\'l_name\'].\' /LastName  Phone \'.$customer[\'phone\'].\' /Phone  Email \'.$customer[\'email\'].\' /Email  /CustomerAdd  /CustomerAddRq  /QBXMLMsgsRq  /QBXML  return $xml; * Receive a response from QuickBooks function _quickbooks_customer_add_response($requestID, $user, $action, $ID, $extra, $err, $last_action_time, $last_actionident_time, $xml, $idents) mysql_query(\" UPDATE  qb_cust_test  SET  quickbooks_listid = \'\" . mysql_real_escape_string($idents[\'ListID\']) . \"\',  quickbooks_editsequence = \'\" . mysql_real_escape_string($idents[\'EditSequence\']) . \"\' WHERE  id = \" . (int) $ID);//continue if error is 3100$errmap = array( \'*\' = \'catch_all_errors\'

本文链接: http://quickbooksphonenum.immuno-online.com/view-770618.html

发布于 : 2021-03-25 阅读(0)
公司介绍
品牌分类
联络我们
服务热线:4000-520-616
(限工作日9:00-18:00)
QQ :1570468124
手机:18915418616