Discussions

Expand all | Collapse all

Quickbook Discount Line Items

  • 1.  Quickbook Discount Line Items

    Posted 04-07-2021 13:44
    Edited by Elad Inbar 04-07-2021 13:44
    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
    ------------------------------


  • 2.  RE: Quickbook Discount Line Items

    Posted 04-07-2021 15:10

    @Elad Inbar

    How many lines are you writing to the Invoice?



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



  • 3.  RE: Quickbook Discount Line Items

    Posted 04-07-2021 19:04
    @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
    ------------------------------



  • 4.  RE: Quickbook Discount Line Items

    Posted 04-07-2021 19:33
    Edited by Justin Torrence 04-07-2021 19:34

    @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/
    ------------------------------



  • 5.  RE: Quickbook Discount Line Items

    Posted 04-07-2021 21:33
    @Justin Torrence

    I don't have any issues with adding multiple lines items. I have a search element that brings in all my different products and adds them to the invoice without issue. I do have an if branch for IF discount is populated (it's a field, not a line item in Salesforce), then add a discount line item. That branch is where is fails saying discount line item detail is missing from request.​​

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



  • 6.  RE: Quickbook Discount Line Items

    Posted 04-08-2021 14:56

    @Elad Inbar

    What Action Type are you using to add the discount line item in the IF branch?​



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