2

Does anyone know if it is possible to call a Process from a Visualforce page button? My situation is that I have a custom object with a Master-Detail relationship to the Opportunity object. When the user creates a record of the custom object, I want to have a button that would create an associated Case when clicked. In the past, I have done this via a URL hack, but I would like to use something more scalable like a Process but I'm not sure how to get the button to do this. Any help is appreciated!

  • 1
    and why not have the VF page button do DML in the controller such that the process' triggering condition executes? – cropredy Jan 12 '16 at 20:59
  • My page is using a standard controller so I do not have a custom controller to be used. – J. Neilan Jan 12 '16 at 21:04
  • 1
    ok, then change the custom button to use SFDC Javascript/Ajax and update the object that way – cropredy Jan 12 '16 at 21:15
  • Thanks @crop1645, but I don't know JavaScript very well. – J. Neilan Jan 12 '16 at 22:07
  • see salesforce.stackexchange.com/q/70837/2602 for an example – cropredy Jan 12 '16 at 22:11
3

If you're wanting to do it that way, you really should just go and do it in Visual Flow. You can have your Visual Flow do that, and you don't even need a Process Builder!

Check out this on writing your VFP to house the Flow: http://salesforcesidekick.com/2015/05/25/how-to-put-your-flow-in-a-visualforce-page/

And this is a great example of this in action, except that its using a URL button instead of VFP, but combine them together and you'll have what you asked for: http://salesforcesidekick.com/2015/06/25/assign-to-me-button/

| improve this answer | |
  • Thanks @David. I'll take a look and see if I can make it work for me. – J. Neilan Jan 12 '16 at 22:07

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.