UI - Pre-Fill your new invoice

TwixRiva allows you to pre-fill your new Invoice using any of your Custom/Standard Salesforce objects. This essentially allows you to create Invoices from any Standard or Custom objects in Salesforce and to prefill the Invoice UI with the data mapping defined under he Xero Lookup Custom Metadata that we provide. This involves you to identify the source object and then creating a lookup relationship to that object from Xero Invoice object, adding the related list for Xero Invoices to the source object page layout and creating a button on the Xero Invoice object and adding that to the related list.

This feature offers you the flexibility to be able to Create Invoices from any Salesforce object of your preference and prefill the Invoice UI with the data from the same source object

Steps to perform to set it up:

Step 1 - Identify your source object. Does this object have lines?

Step 2 - On TwixRiva Xero Invoice object, create a lookup field to your source object.

Step 3 - Create a new record in the Xero Lookup Custom Metadata Types. (Setup> Custom Metadata Types> Xero Lookup> Manage Records>New

 

It has three sections as depicted above:

General Information: this is where you can specify the Label, Name for the Xero Lookup Custom Metadata.

Xero Header: This is where you can define the mapping for Source Object fields to prefill the Xero Invoice Object

Xero Lines: This is where you can define the mapping for the Invoice Lines. Here you can define the mapping to be from the Line Item object on the source object, so say if your source object is Opportunity, the Invoice Lines can come from the related Product object.

So if you have created and Opportunity and added Products to it, when you define this mapping it will pull the Opportunity information to the Invoice record and all the listed products information to the Invoice Lines as per the mapping

Step 4 - On the Xero Invoice object, create a custom Button. Button to be:

  • Display Type: List Button

  • Behavior : Display in existing window without sidebar

  • Content Source: URL

  • Button Content: /lightning/cmp/CGCB__NewXeroInvoice?c__parentId={!Opportunity.Id}&c__type=ACCREC

    • Where :

      • c__parentId need to be assigned with the Step 1 source object Id. I.e. {!Opportunity.Id} in example above

      • c__typw needs to be assigned with the Xero Invoice type : ACCREC for Client Invoice, ACCPAY for Supplier Invoice

Step 5 - On your source object, display the new button in the related list.(Shown Below)

 

As a result, your invoice will be refilled with the object(s) data.

As depicted in the screenshot below the Invoice is pre filled with the data defined in the mapping above