siroos12 Posted August 2, 2018 Posted August 2, 2018 (edited) Hi all, I have this clients that doesn't exists in QB but It keeps returning below error when I try to add it to QB: CODE: 3100 SEVERITY: Error MESSAGE: The name "Monica Talas" of the list element is already in use. Can any one suggest what am I doing wrong here? So, "Monica Talas" does not exists in QB as a customer, We have a vendor called "Monica Talas AB". When ,my script run a query for "Monica Talas", it cannot find it. Then the script attempts to add it to QB using "PCQB_RqNew("CustomerAdd" ; "" )". After setting up customer's variables and run "PCQB_RqExecute", I receive above error. Here is how I structured mt script: #Query customers in QB (Request) Set Variable [ $$Result; Value:PCQB_RqNew("CustomerQuery" ; "" ) ] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "NameFilter::MatchCriterion" ; "StartsWith") ] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "NameFilter::Name" ; globals_CUSTOMERS::CustomerName)] Set Variable [ $$Result; Value: PCQB_RqExecute ] Set Variable [ $$Status; Value: PCQB_SGetStatus ] If [ $$Result = 0 ] #Customer found, set the ListID and EditSequesnce Set Variable [ $$Result; Value:PCQB_RsOpenFirstRecord ] Set Field [ globals_CUSTOMERS::_ID_QBCustomerListID; PCQB_RsGetFirstFieldValue("ListID") ] Set Field [ globals_CUSTOMERS::QBEditSequence; PCQB_RsGetFirstFieldValue("EditSequence") ] Set Variable [ $$Result; Value:PCQB_RqNew("CustomerMod" ; "" ) ] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "ListID" ; globals_CUSTOMERS::_ID_QBCustomerListID) ] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "EditSequence" ; globals_CUSTOMERS::QBEditSequence) ] Else #Customer does not exists on QB so, push it to QB Set Variable [ $$Result; Value:PCQB_RqNew("CustomerAdd" ; "" ) ] End If Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Name" ; globals_CUSTOMERS::CustomerName) ] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "IsActive" ; 1) ] #Legal company name for billing Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "CompanyName" ; globals_CUSTOMERS::CustomerName) ] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "FirstName" ; customers_CONTACTS||PrimaryContact::FirstName)] Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "LastName" ; customers_CONTACTS||PrimaryContact::LastName)] #Execute Set Variable [ $$Result; Value: PCQB_RqExecute ] Set Variable [ $$Status; Value:PCQB_SGetStatus ] If [ $$result = 0 ] Set Variable [ $success; Value:True ] Else Set Variable [ $message; Value:"Customer was not synced to QuickBooks: ¶¶Status: " & $$Status & " Customer: " & globals_CUSTOMERS::CustomerName & " Order: " & ORDERS::OrderNumber & "¶¶" & GetErrorEnvironment ] Go to Layout [ original layout ] Exit Script [ Result: #SetParam("Success" ; $success) & #SetParam("Message" ;$message) ] End If Edited August 2, 2018 by siroos12
Geoffrey Gerhard Posted August 2, 2018 Posted August 2, 2018 It's likely that the Customer record exists in QB, but is Inactive. The default view of the Customer List in QB is Active Only, as is the CustomerQueryRq. Update your CustomerQuery script to include "ActiveStatus" with a value of "All" to be certain that the proposed CustomerName is unique. HTH! Geoffrey Gerhard Creative Solutions Incorporated 14000 Creekside Drive Matthews, NC 28105 704) 814-6852
Recommended Posts
This topic is 2296 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now