function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
IWyattIWyatt 

Using REST to create clickable links to create Opportunities?

{reposted from general forum}

Hi all - hoping there are some really  smart people out there that can help me vet an idea. :smileywink:

 

I'd like to have a clickable URL link in generated Tasks that allow a sales rep to click the link which will create an Opportunity with the Primary Campaign Source field pre-filled with a specified value.

 

I was thinking that the new REST API might be able to do this, but I wanted to see if the community has done this before?

 

The problem we are attempting to solve is taking the burden off Sales reps for attaching certain opportunities to specific campaigns.

For reasons I won't get in to, using the contact's previous campaign (default behavior) isn't sufficient.

 

Thanks all!

 

Best,

IW

dkadordkador

You can't embed enough state in a clickable URL link to do this with the REST API (and the link would send a GET which won't ever cause a state change in salesforce).  You should be able to create a link that would load a VisualForce page that has a custom apex controller.  That controller could handle your custom behavior.