Custom Guided Wizard
...
Button URL Structure
Line Item Level Fields
Populating Line Items from Originating Record Fields
6min
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, with the structure taken from 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= \&line# field= your field c button url \&line1 inventory code=inventory c \&line1 description=desc field c \&line1 quantity=quantity field c \&line1 unit price=unit price field c \&line1 discount=discount field c \&line1 revenue account=rev field c \&line1 tax rate=tax rate field c \&line1 tracking code 1=code1field c \&line1 tracking code 2=code2field c internet explorer, depending on the version, may have a limit of 2000 characters in the url firefox and chrome have potentially much longer url limits, of 30,000 characters and up salesforce may have it’s own limits we cannot be responsible for either your browser’s url character limitation or salesforce’s url character limitation as such, we recommend this approach for just a few lines, however, it may work for dozens of lines or more specifying more than one line should you want more than one line, you simply need to start with "\&line2…" and so forth button url \&line1 description=desc field c \&line1 quantity=quantity field c \&line1 unit price=unit price field c \&line2 description=desc field c \&line2 quantity=quantity field c \&line2 unit price=unit price field c \&line3 description=desc field c \&line3 quantity=quantity field c \&line3 unit price=unit price field c line item position when you use both child object records (curl) and originating object fields (li url) as line items of an invoice, then you can optionally provide the position of the li url line item, which is displayed as the first line item by default you can directly give “first” or “last” text values to this parameter like below \&lineitem position=first or \&lineitem position=last based on this text, the order of li url records will be displayed on the create invoice page, and if you don’t provide the param, it will display the li url items first and then curl records button url \&lineitem position=first populating data directly from the formula there are times you might want to specify data directly in the formula please be aware this is particularly tricky and a missing quotes“ 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 button url \&line1 description=desc 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 button url /apex/bread winner newinvoicepage ?originating record={!salesforce record id} \&parent account=api field name c \&child relationship name=child name r \&child object description=desc field c \&child object quantity=quantity field c \&child object unit price=unit price field c \&child object revenue account="200 sales" \&child object tracking code 1="east coast" \&child object tracking code 2="red branch"