SuiteCRM Quote Line are not displayed when created with SOAP API

I’m integrating an backend web application with SuiteCRM and I’m using the SOAP API extensivly.

From the backend application I’m creating an Quote (AOS_Quotes) and I’m adding some line items (aos_products_quotes) to the quote. Once the objects are created with the api I’m setting an relationship between them. The relationship is successfully created, however when I navigate to the SuiteCRM web interface and open the quote the line items are not displayed. From the API I can confirm that the relationship by retrieving the line items for that quote.

Does anybody know what could be the problem?

Thank you

So you can confirm that the parent_id of the AOS_Product_Quotes rows for your line items are set to the id of the AOS_Quote and that deleted is 0 in the AOS_Product_Quotes rows?

Also check parent_type is set correctly and that the product_qty is not 0

This is what I do to set the relationship:

_SoapApi.set_relationship(SessionId, “AOS_Quotes”, quoteId, “aos_products_quotes”, listed, nv.ToArray(), 0)

Yes product quantity is > 0. I can’t find parent_type in the fields list. I have parent_name. I set that to the quote name.

Look at the AOS_Products_Quotes database table the parent_id and parent_type need to be set. Its not a standard sugar relationship so I would not use the _SoapApi.set_relationship if possible and just create the aos_pordicts_quotes directly and set the parent_id and parent_type.

1 Like

Thank you Andy for your effort.

Unfortunately I’m unable to check the database since I don’t have access to the cloud server just yet.

Is there are way to check form the api? Can I try to set the parent_type thru the api?

Andy Thank you very much. You point me to right direction and I solved the problem.

When I was creating the line item I just include the parent_type=“AOS_Quotes”. Then I execute SetRelationship and the line items were displayed. :slight_smile:

Thank you very much.

No probs, wasn’t sure if set_relationship would work properly on that, never really used the soap api.