0
votes

I ran this xml request.

<Class sparse="true" xmlns="http://schema.intuit.com/finance/v3">
    <Id>3000000000000249140</Id>
    <SyncToken>0</SyncToken>
    <Name>holy cow this is inactive</Name>
    <Active>false</Active>
    <FullyQualifiedName>holy cow this is inactive</FullyQualifiedName>
</Class>

I received Response Code 200

<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" 
time="2014-03 21T14:31:36.948-07:00">
  <Class domain="QBO" sparse="false">
    <Id>3000000000000249140</Id>
    <SyncToken>0</SyncToken>
    <MetaData>
      <CreateTime>2014-03-21T13:44:17-07:00</CreateTime>
      <LastUpdatedTime>2014-03-21T13:44:17-07:00</LastUpdatedTime>
    </MetaData>
    <Name>holy cow this is inactive</Name>
    <SubClass>false</SubClass>
    <FullyQualifiedName>holy cow this is inactive</FullyQualifiedName>
    <Active>true</Active>
  </Class>
</IntuitResponse>

I was expecting the response to return Active=false.

When I tried to update a record from QBO that is Active=false to Active=true I got this business error message.

I received Response Code 400

<Error code="6000" element="">
  <Message>A business validation error has occurred while processing your request</Message>
  <Detail>Business Validation Error: You cannot modify a list element that has been     deleted.</Detail>
</Error>

To further clarify, the focus point is not during creation of an entity record. This was an example of what I think is a bug issue with QBO V3 API.

Based off the documentation, I should be able to push a soft delete on any List Name entity record like the example with a Class Entity record. This is achieved by setting the Active node value to false. Whether the record exists on QBO V3 or not the response that the API returns is Response Code 200 but the record is still set to Active = true and not the expected value of false. This is telling me that there is a bug with QBO V3 and it does not set the List Name entity record Active node to false.

On the other hand, when I try to set a record Active=true to an existing record on QBO V3 that is set to Active=false I get the Response Code 400 that throws a business rule.

In conclusion, I am not sure if the intention is to allow soft deletes or not? I would now have to come up with a work around to deal with soft deletes on my application.

1
@user3307364, that suggested edit was too much for an edit to someone else's post. If you are the same person as user3366627, please log in using the same account you used to post the question. Then you can edit without having your edits reviewed.Adi Inbar

1 Answers

0
votes

'Active' attribute is mainly used for a soft deleted of Class entity.

As per IPP's doc, it is - "*Delete is achieved by setting the attribute to false in an entity update request; thus, making it inactive. In this type of delete, the record is not permanently deleted, but is hidden for display purposes. References to inactive objects are left intact."

Ref - https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/030_entity_services_reference/class

Can you explain why are you trying to set this flag to false while creating this object. I agree that service should return a meaningful error msg if false value of this attribute is not permitted in time of object creation. Just trying to understand this use-case.

2nd issue - update a record from QBO that is Active=false to Active=true

Yes. It is definitely an issue in service.

Read by Id
---------------
    <IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-03-22T08:38:41.182-07:00">
      <Class domain="QBO" sparse="false">
        <Id>100000000000359798</Id>
        <SyncToken>1</SyncToken>
        <MetaData>
          <CreateTime>2013-12-02T00:39:48-08:00</CreateTime>
          <LastUpdatedTime>2014-03-22T08:38:23-07:00</LastUpdatedTime>
        </MetaData>
        <Name>product_class1 (deleted)</Name>
        <SubClass>false</SubClass>
        <FullyQualifiedName>product_class1 (deleted)</FullyQualifiedName>
        <Active>false</Active>
      </Class>
    </IntuitResponse>

Update operation on a deleted/inactive class
--------------------------------------------

    <Class domain="QBO" sparse="false" xmlns="http://schema.intuit.com/finance/v3">
        <Id>100000000000359798</Id>
        <SyncToken>0</SyncToken>
        <Name>product_class1 (deleted)</Name>
        <SubClass>false</SubClass>
        <FullyQualifiedName>product_class1 (deleted)</FullyQualifiedName>
        <Active>true</Active>
    </Class>

Response of the update operation 
--------------------------------
    <IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-03-22T08:40:06.725-07:00">
      <Fault type="ValidationFault">
        <Error code="6000" element="">
          <Message>A business validation error has occurred while processing your request</Message>
          <Detail>Business Validation Error: You cannot modify a list element that has been deleted.</Detail>
        </Error>
      </Fault>
    </IntuitResponse>

We'll raise a bug for this and will update the post accordingly(with fix/release info).

Thanks