Forum Discussion

EladInbar's avatar
EladInbar
Qrew Member
4 years ago

Quickbook Discount Line Items

Hello!

I've been creating a pipeline to connect Salesforce and Quickbooks.
I've gotten stuck on adding the Discount to the Quickbooks discount.

Does anyone have any experience they can offer? 
Right now I'm trying to map it over as a Discount Line Item but I keep getting this error: Line.DiscountLineDetail is missing in the request.

Not sure where I'm going wrong.

Thanks for any help!


------------------------------
Elad Inbar
------------------------------

5 Replies

    • EladInbar's avatar
      EladInbar
      Qrew Member
      @Justin Torrence

      It varies. At least one line item, but if the customer orders multiple products, then multiple line items.
      And there isn't always a discount. I have an IF branch in my pipeline to check if there's a Discount on the originating Salesforce Order. If there is, I need it to add a discount to the Quickbooks invoice.



      ------------------------------
      Elad Inbar
      ------------------------------
      • JustinTorrence's avatar
        JustinTorrence
        Qrew Cadet

        @Elad Inbar

        After reading this community post, I think that with the Create an Invoice action you have to create the "Lines" from a list object, and if that is the case, a discount will need to be one of those in the list object.

        You might have to leverage Jinja2 to dynamically chose the "Detail Type"

        {% if b.name = "Discount" %}
        {{ "DiscountLineDetail" }}
        {% else %}
        {{ "SalesItemLineDetail" }}
        {% endif %}

        This statement will check to see if the current iteration of b.name contains the value "Discount" (this could be replaced with any other conditional statement). When the condition is true, it will return Discount value, otherwise the item detail.

        That or you could potentially add an if action to add the discount line item after the initial invoice is created using the Update an Invoice action.



        ------------------------------
        Justin Torrence
        Quickbase Expert, Jaybird Technologies
        jtorrence@jaybirdtechnologies.com
        https://www.jaybirdtechnologies.com/
        ------------------------------