---
title: Line Items from Originating Object
slug: quickbooks/line-items-from-originating-object
description: Learn how to populate line items on invoices and bills/purchase orders using data from the originating record. Discover the URL structure and examples for fields such as inventory name, description, quantity, unit price, and taxable status. Understand lim
docTags: 
createdAt: 2021-11-05T07:35:22.000Z
---

### 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*

:::CodeblockTabs
Button URL

```css
&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__c
```
:::

Because 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.

:::CodeblockTabs
Button URL

```css
&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__c
```
:::

### Populating 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.

:::CodeblockTabs
Button URL

```css
&line1_inventory_name=name_field__c
&line1_quantity=1
&line1_unit_price=unit_price_field__c
```
:::

Or, perhaps you wish to set the Account Revenue Code or another similar field with text from the Formula.

:::CodeblockTabs
Button URL

```css
/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__c
```
:::

You 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*

:::CodeblockTabs
Button URL

```css
&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__c
```
:::

Notes:

1. **\&line1\_inventory\_name=*****name\_field\_\_c*** will not require If you are planning to map Line Items with Account based line Items 
2. **\&line1\_taxable=*****is\_taxable\_field\_\_c&#x20;***&#x77;ill not require for Purchase Order.

Should you want more than one line, you simply need to start with \&line2… and so forth.

