0

I have a new custom object, "Car," with lookup fields to the Order, Opportunity, and several other objects.

When an Order is created, I would like a Car record to be created with the Order lookup autopopulated.

Ideally, I would like all the lookup fields to be populated from the order creation. Is this possible? (I'm very new to salesforce)

2 Answers 2

0

You can do this via declarative tool, for example: process builder.

If you want to automatically create a Car record whenever an Order record is generated, that means your process builder must be based on Order object, then you can either choose only to run it when record creation only OR also when edited. Normally I would choose on both record creation and edit, because most likely there should be more actions to add on when record is modified.

In the Decision Node, use ISNEW() formula to indicate that your process builder only run on record creation event only.

In the Action Node, you can either use actions "Create a Record" or "Quick Actions" (Lightning only). I assume your Order would have the lookup field to Opportunity and other object as well. If you choose "Create a Record", you can assign the lookup field referenced from the Order. I would choose Quick Action because it is more flexible: supports predefined field values, can be used as button, or called via apex class.

0

There are multiple ways to achieve this like a process builder, trigger, flow. However, I am suggesting the process builder based on its simplicity and point and click build ability.

All you have to do is to create a Process Builder on Order Object and use 'Create a Record' operation to create a Car record and populate the OrderId value with the Newly created Order record id.
Below images may be of your help

enter image description here

enter image description here

enter image description here

2
  • Thank you! For some reason, at the step where I specify the action, I can do "Car Name -> field reference -> Order ID", but I cannot do "Order -> field reference -> Order ID. Why are some fields missing in the 2nd option? Is there a way to pull the Existing Order ID into the new record's Order ID field?
    – Dnghiem
    May 21, 2020 at 17:15
  • All the look-up field in the Car object will be available and you can use the field reference to get the record details of the newly created Order and populate in against you desired fields.
    – ssoundiran
    May 22, 2020 at 6:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .