When a user in SFDC goes to a contact and creates a new opportunity we want to carry over some of the data from the Contact into that opp.

We typically do this with a custom button to pass URL parameters however we're migrating to lightning and that's obviously not an option.

How are other folks going about passing data from contact to opp?

  • 2
    Lightning quick actions? There is plenty of documentation and trailhead modules on the subject. – glls Jul 25 '18 at 21:30
  • Quick Actions can only create a record for whom the Object select is Parent, found worth mentioning. You would have to create a custom lightning component, that fetches value from Contact and create Opp. But can be done. – Pranay Jaiswal Jul 25 '18 at 21:31
  • It depends. If you need a UI interaction, you will need to build a custom component and you can use force:createRecord for that purpose to populate default values. If you don't need a UI interaction, you can use trigger. – Jayant Das Jul 25 '18 at 22:06

You might want to check Lightning Alternatives to JavaScript Buttons.

Lightning component actions are custom actions that invoke a Lightning component. They support Apex and JavaScript and provide a secure way to build client-side custom functionality.

This would be the best approach for passing data from an existing/newly created record to another one. As to how and what exactly you want your action to do is really up to you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.