Best answer

Create custom object line item records in Salesforce

  • 30 April 2020
  • 5 replies
  • 1560 views

Userlevel 1

I wish to create a a custom record and child line item records in 

salesforce when a new Bill is created in Xero. I need advice on how to create a record and related line items if the Action does not support line items. (The trigger does support line items.) I believe I need to convert each of the Xero Bill line items to a delimited text string? Then when creating the parent record in salesforce, the line item text string should be mapped to a Text field and then use Salesforce workflow to create the line item records from this text string? If this is correct I cannot figure out how to use formatter to create a single text string for all the line items. Any help or other solutions would be much appreciated: 

icon

Best answer by xeno 1 May 2020, 16:00

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +8

Hi @xeno ,

Thanks for reaching out! Currently there is not a way to get line item data from a Salesforce object and save it over to an accounting app like Xero but fortunately, there is a current 
feature request open for this option!


I've gone ahead and added you as an interested user for this feature which does the following:

  • Re-raises this issue with the app’s team

  • Adds weight to this feature request in the queue

  • Reminds us to update you once this is resolved


I don't have an ETA on when or if this feature will go into production, but if it does you will be notified via email.

I know that’s not the news you were hoping for but please let us know if you have any additional questions- happy to help!

Userlevel 1

Thanks for your reply Liz, but you have misunderstood the problem. 

I wish to take line item data FROM xero bill or invoice and add that TO salesforce. Not the other way around as you have surmised. 

 

 Furthermore to ensure you are not inadvertently misleading other community members, I am happy to  advise that it IS possible to to extract line item data from salesforce and write this data to Xero!. We have already done this with our own Salesforce org and our new Xero instance.  I have posted our solution to another community member who was enquiring about the feasibility of this application. 

Regards Mark Riley, Xenogenix Ltd

Userlevel 1

We have now developed a solution to add line items to a salesforce.com custom object record. I you would like to know more. Please reach out to me at xxx@xxxx.co.uk
 

This post has been edited by a moderator to remove personal information. Please remember that this is a public forum and to remove any sensitive information prior to posting. 

Userlevel 2
Badge +2

Hey @xeno!

Wanted to update you /other users who come along with similar goal in Salesforce. We have a tool in beta that can help accomplish this goal now.

For folks needing to do the following in a Zap:

 

Use Case:

  1. Create records in Salesforce (like your custom Bill record)
  2. Then create line-item records that should get assigned to the record above (e.g., your Bill record)
  3. Zap should handle the creation of line-items regardless of how many items may be in a given bill (e.g., if your Bill has n number of line items, n line item records should get created under this bill

Issue:

Since our Salesforce > Create Record action step is unable to support line-items, #3 in the list above is tricky to accomplish. The solution to this typically required a 2 Zap solution to accomplish, unless you wanted to use a custom Code step.

 

Solution:

We have a new tool in beta that should allow you to accomplish this goal in one Zap without code, called Looping by Zapier.

 

 

In short, Looping by Zapier is a built-in app with a set of actions that can take multiple values (like bill’s various line items), and allow you to loop steps later in your Zap that are using those values.

 

The Create Loop From Line-Items feature will be useful to you here!

 

The explanation can be hard to understand on paper, but basically:

  • If you set up a Looping > Create Loop From Line-Items step in your Zap, this step can take your line-itemized values in and then will output them to use in other action steps to make those action steps loop (or iterate through each of the values).
  • So if you pass in a line-itemized field to this step (like a field named bill item), your Zap will then output a bill item field to use during setup.
  • If you pass this bill item field into your next action step, when your Zap runs live, if the bill item contains number of line-items in it, Your Zap will run the action step that follow your Looping step n number of times.

 

If that was a bit hard to parse, this is a bit more straightforward in practice! This Zap should accomplish your goal:

 

Step 1. Trigger step (E.g. Xero > New Bill  trigger in your use case)

Step 2. Salesforce > Create Record

  • set this up to create a Bill record

Step 3. Looping by Zapier > Create Loop From Line-Items

  • pass all the Bill Line Items data through this step (like the line item name, line item quantity, line item price, etc)

Step 4. Salesforce > Create Record

  • Pass in the outputs that Looping step provides you (line item name, line item quantity, line item price, etc) where appropriate. Then, pass in the bill record’s ID coming from step 2, to properly assign these one items to the right bill in Salesforce.
  • Doing so for creates the Order Items in SF and assigns items to SF Order in step 2. This is the step that will loop when the Zap runs , so if your bill contains 3 line items, Step 4 will run 3 times, to create each line item properly!

This is a very new feature in beta, but it should suit your goal here! We don't have public help guides yet, so if you get stuck here, let me know and I'll do my best to troubleshoot.

 

Hope this is helpful! Let me know if folks have additional questions – I'm here to help!

Userlevel 7
Badge +11

Thanks for chiming in with that thorough response @ZappinAndy!