Custom Guided Wizard
Button URL Structure

Line Item Level Fields

6min

Populating Line Items from Child Records

As you may know, when Breadwinner creates a new Invoice from Opportunities with Opportunity Products and Order with Order Products, Breadwinner auto-populates the Invoice Line Items from the Opportunity Products / Order Products. This works with no configuration. 

It is equally possible for Breadwinner to populate all of the Line Items of the Invoice from custom objects, provided a ButtonURL Structure is used.

This requires two things: specifying the child object and specifying the fields on that child object to use. 

You can iterate over only one Child Object, i.e. you must pick one and only one Related List to iterate over, not two or more related lists.

Specifying the Child Object

Please note, we do not use the API name of the object, we use the Child Relationship Name. This is because sometimes you will have multiple lookup fields from the child to the parent record, and we don’t know which one to use. Thus, you must specify the child object by using the Child Relationship Name.

The Child Relationship Name can be tricky to find. In setup, go to the child object, and click on the name of the lookup field (or master-detail field) to the parent object. If you have two or more lookup fields to the same parent object, make sure you select the right one. After clicking the name of the lookup field to the parent object, you will be on the setup page of that field. 

You will see the Child Relationship Name field. We recommend you append "__r" to that field, as this is the best practice, but this is optional because we will append that transparently if it is missing.

Button URL


Specifying the Child Object Fields

As well as specifying the Child Object, you must specify fields on that Child Object. Most fields are optional, but Xero requires a Description in every line item. Also, please note that the field types must match. You must use a Date (or Date/Time which will be converted into a Date transparently) for the Service Date field. Quantity and Unit Price are number fields (we accept up to 4 decimal places) For Picklist fields (Account Revenue, Tax Rate, and Tracking Codes in Xero) you must use fields that match, exactly, case-sensitive to existing fields in your Accounting System. If we cannot find an exact match in your accounting system we ignore those fields.

If the Xero Inventory item (as specified by the child_object_inventory_code) does not exist in Xero, we will transparently create it in the background. This functionality is the same with the Custom Guided Wizard, or when creating Invoices with the Guided Wizard. Also, be aware that for Xero, your Tracking Code(s) must be setup in Xero before Breadwinner can use them. We cannot add new values to any of these; we are limited to populating these fields with values already in the accounting system.

The line items can also be organized in a particular order as specified by custom_object_sort_by

Button URL


All Fields available for a New Invoice with Child Records

The list and structure of a Button URL with all possible fields, including those for Line Items that are drawn from Child Records, utilized is below. Please note that many of these fields will not work unless the corresponding field is setup in the accounting system.

Button URL