5

I have a URL button 'New Opportunity' which creates the new opportunity and takes the user to the edit page passing through some values through the button which is on Opp Related List in a custom object.

The problem is, now I need to adapt the majority of my custom buttons to Salesforce1 and this app doesn't accept custom buttons so I need to create a Publisher Action in order to replicate the same action.

I've created a Publisher Action redirecting to a Visualforce. Inside this visualforce I've tried passing the values through the sforce.one.navigateToURL(); function using the standard controller values to redirect, but this doesn't seem to work. Do you know of a workaround for this?

URL Button Code: /006/e?&retURL=%2Fa0BS0000002pJhs&opp4={!Estudio_economico__c.Empresa__c}&opp3=No informar&RecordType=01220000000Iw8t&CF00N20000002GXnJ_lkid={!Estudio_economico__c.Id}&CF00N20000002GXnJ={!Estudio_economico__c.Name}

  • Have you tried creating a publisher action as described below? I'm pretty sure you will be able to achieve the same functionality as you used to have with the button. – Caspar Harmer Apr 23 '15 at 18:09
4

You should be able to use the "Create Record" publisher action to define all the fields you want. You won't need to to use sforce.one.navigateToURL() to do this (and it wouldn't work as it doesn't allow you to specify a full url).

Note, you also shouldn't need to use a custom Visualforce page as you can define all the fields you need on the publisher action layout.

Once you have created this action, you can add "predefined field values" ( in the picture below, this action shows creating an Opportunity from an Account ). enter image description here At the bottom of the image, there is a button to add predefined field values - these can be calculations and they cover most editable fields.

EDIT It turns out you can specify the desired record type. Once I added record types to my object, I was able to set the record type in the Action definition itself.

  • I have the same problem... wants to create a new event publisher action and pass 2 prepopulated Account custom fields. but not able to do so... Please guide me through .. Thanks, Namita – namita sharma Oct 3 '16 at 15:15
  • I think this is all you need "At the bottom of the image, there is a button to add predefined field values - these can be calculations and they cover most editable fields." - make two predefined field values, and you are done. – Caspar Harmer Oct 3 '16 at 20:46

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.