Line Items from Originating Object
Populating Line Items from Originating Record Fields
You may have a number of fields on the Originating Record that you wish to populate various line items on the Invoices. This is possible, as long as you specify each and every individual line. This is different from populating child records, where we iterate over each child record. Here, you specify the number of lines in each URL.
The Invoice URL will start the same as always, using the basic Custom URL structure for Invoice fields, where you can specify dates, etc.
However, the URL will then specify line items, using the structure &line#_field=your_field__c
&line1_inventory_name=name_field__c
&line1_description=description__c
&line1_service_date=service_date__c
&line1_quantity=quantity_field
&line1_unit_price=unit_price_field__c
&line1_class=class_field__c
&line1_taxable=is_taxable_field__cBecause your browsers or Salesforce may have limits on the number of characters, Breadwinner recommends this approach for just a few lines; it may work for dozens of lines or more, but try this at your own risk.
Specifying more than one line
Should you want more than one line, you simply need to start with &line2… and so forth.
&line1_inventory_name=name_field__c
&line1_quantity_name=name_field__c
&line1_unit_price=unit_price_field__c
&line2_inventory_name=name_field__c
&line2_quantity=quantity_field
&line2_unit_price=unit_price_field__c
&line3_inventory_name=name_field__c
&line3_quantity=quantity_field
&line3_unit_price=unit_price_field__cPopulating Data directly from the Formula
Please be aware that this is particularly tricky and a missing “ can cause issues. We recommend building these formulas up one line at a time.
This is possible with certain fields. The Quantity field accepts numbers when pulling data from specific fields on the originating record.
&line1_inventory_name=name_field__c
&line1_quantity=1
&line1_unit_price=unit_price_field__cOr, perhaps you wish to set the Account Revenue Code or another similar field with text from the Formula.
/apex/breadwinner_qbo__NewInvoicePage
?originating_record={!salesforce_record_ID}
&parent_account=api_field_name__c
&invoice_custom_field_1=“Text info A”
&invoice_custom_field_2=“Text info B”
&invoice_custom_field_3=“Text info C”
&child_relationship_name=child_name__r
&child_object_inventory_name=name_field__c
&child_object_description=“Text info X”
&child_object_quantity=quantity_field
&child_object_unit_price=unit_price_field__cYou may have a number of fields on the Originating Record that you wish to populate various line items on the Bill/Purchase Order. This is possible, as long as you specify each and every individual line. This is different from populating child records, where we iterate over each child record. Here, you specify the number of lines in each URL.
The URL will start with /apex/breadwinner_qbo__NewBillPO, using the structure taken from the basic Custom URL structure for Bill fields, which lets you specify dates, etc.
However, the URL will then specify line items, using the structure &line#_field=your_field__c
&line1_inventory_name=name_field__c
&line1_description=description__c
&line1_quantity=quantity_field
&line1_unit_price=unit_price_field__c
&line1_taxable=is_taxable_field__cNotes:
- &line1_inventory_name=name_field__c will not require If you are planning to map Line Items with Account based line Items
- &line1_taxable=is_taxable_field__c will not require for Purchase Order.
Should you want more than one line, you simply need to start with &line2… and so forth.