Reputation: 61
I am using QBO IPP PHP SDK QuickBooks V3 API. The errors are
"6000: [A business validation error has occurred while processing your request, Business Validation Error: Something this action required is no longer available. Another user may have deleted it. Please refresh your screen to see the current information.]"
"6000: [A business validation error has occurred while processing your request, Business Validation Error: You can only add or edit one name at a time. Please try again."
But When I get Customer Detail through same API then I get successfully All the customer details.
Any one can guide me. sorry, I forget to tell that I am using Canadian version Quick Books "https://ca.qbo.intuit.com".
Here is my Sample code for Add customer But the error is still not understandable for me.
I am using V3 API
$CustomerService = new QuickBooks_IPP_Service_Customer();
$Customer = new QuickBooks_IPP_Object_Customer();
$Customer->setTitle('MR');
$Customer->setGivenName('Abdul');
$Customer->setMiddleName('Hanan');
$Customer->setFamilyName('Cheema');
$Customer->setFullyQualifiedName('FullyQualifiedName cheema');
$Customer->setDisplayName('Abdul Hanan Cheema ' . mt_rand(0, 1000));
$Customer->setCompanyName('Seed Corporation');
$Customer->setPrintOnCheckName('PrintOnCheckName See');
$Customer->setActive('1');
$Customer->setDefaultTaxCodeRef('12');
$Customer->setTaxable('0');
$Customer->setJob('jobSee');
$Customer->setBillWithParent('0');
$Customer->setBalance('100');
$Customer->setBalanceWithJobs('0');
$Customer->setCurrencyRef('CAD');
$Customer->setPreferredDeliveryMethod('Email');
// $Customer->setJob('jobSee');
// Terms (e.g. Net 30, etc.)
$Customer->setSalesTermRef(4);
// Phone #
$PrimaryPhone = new QuickBooks_IPP_Object_PrimaryPhone();
$PrimaryPhone->setFreeFormNumber('860-532-0099');
$Customer->setPrimaryPhone($PrimaryPhone);
// Mobile #
$Mobile = new QuickBooks_IPP_Object_Mobile();
$Mobile->setFreeFormNumber('860-532-0099');
$Customer->setMobile($Mobile);
// Fax #
$Fax = new QuickBooks_IPP_Object_Fax();
$Fax->setFreeFormNumber('860-532-0099');
$Customer->setFax($Fax);
// Bill address
$BillAddr = new QuickBooks_IPP_Object_BillAddr();
$BillAddr->setLine1('Office#2 Ali Tower');
$BillAddr->setLine2('GUlburg3');
$BillAddr->setCity('Lahore');
$BillAddr->setCountrySubDivisionCode('PK');
$BillAddr->setPostalCode('44000');
$Customer->setBillAddr($BillAddr);
// Email
$PrimaryEmailAddr = new QuickBooks_IPP_Object_PrimaryEmailAddr();
$PrimaryEmailAddr->setAddress('[email protected]');
$Customer->setPrimaryEmailAddr($PrimaryEmailAddr);
if ($resp = $CustomerService->add($Context, $realm, $Customer))
{
print('Our new customer ID is: [' . $resp . '] (name "' . $Customer->getDisplayName() . '")');
}
else
{
print($CustomerService->lastError($Context));
}
Thanks in Advance
Upvotes: 2
Views: 1128
Reputation: 61
I used ItemRef for referencing Customer instead of AnyIntuitObject reference e.g sales termrefrence, IncomeAccountRef etc.
Upvotes: 0
Reputation: 28032
For this error:
"6000: [A business validation error has occurred while processing your request, Business Validation Error: Something this action required is no longer available. Another user may have deleted it. Please refresh your screen to see the current information.]"
You need to check everything you're referring to (SalesTerm, TaxCode) and make sure those actually exist. One of them doesn't.
For this error:
"6000: [A business validation error has occurred while processing your request, Business Validation Error: You can only add or edit one name at a time. Please try again."
Make sure you're only adding/editing one thing at a time.
Upvotes: 3
Reputation: 5340
In the application layer there is a lock across Employee, Customer and Vendor entities to ensure unique name constraint. The above error comes, when you try to modify/create multiple objects using parallel threads. Please call API sequentially for the above 3 name entities. If you still face any error, you can update your post with corresponding request(and API requestID) and response XML.
Thanks
Upvotes: 0
Reputation: 2367
When you do an update, you need to do a read first to get the latest metadata and synctoken for the entity. Then you should use that to do an update. Full or Sparse. suspect that you are not sending the Id or correct synctoken for update. Please paste your request/response xmls here.
Upvotes: 0