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
Namita Upadhyaya1Namita Upadhyaya1 

Custom VF Button for salesforce1

I need to create a custom button for Account related list Event, as "Create New Event". so when this button clicks it opens a new event page with
prepopulated values of 2 custom fields of Account.
So for Salesforce Classic, I have a created a custom button and passing Account custom field values in URL parameters. And Voila it worked !
But now I need same functionality for Salesforce1. So I am trying to create a VF page and assigning it as publisher action.
But I dont know what I am doing wrong.


My VF page for publisher action is :

<apex:page action="{!URLFOR($Action.Event.Edit,null,['Event.what_id'='Account.ID',
                                                '00N23000000M5yK'='Account.Declining_Account__c',
                                                '00N23000000M5yU'='Account.Targeted_for_Recovery__c'],false
                                          )}">
</apex:page>

It gives me an error:

Visualforce Error
Invalid parameter for function URLFOR
Error is in expression '{!URLFOR($Action.Event.Edit,null,['Event.what_id'='Account', '00N23000000M5yK'='Account.Declining_Account__c', '00N23000000M5yU'='Account.Targeted_for_Recovery__c'],false )}' in component <apex:page> in page eventcreatenewaccountfields



Please guide me through.

Thanks in Advance !
Namita

 
karthikeyan perumalkarthikeyan perumal
Hello

Insted of creating page  try below option.

Create custom List button  as  "Create New Event"  and choose URL from below dropdown and pass the value. Override the new button in related list with this "Create New Event" new custom button. 

this link will expline you to how to prepopulate value using URL. 

http://www.salesforceben.com/salesforce-url-hacking-tutorial/
http://raydehler.com/cloud/clod/salesforce-url-hacking-to-prepopulate-fields-on-a-standard-page-layout.html

Note: with previous relese in salesfroce prepopulate value using URLFOR and URL hacking is not supported in lightining. but now its has been fixed with salesforce lastest release. 

Hope this  will help you.  

Thanks
karthik
Namita Upadhyaya1Namita Upadhyaya1
Thanks Karthk for the prompt response ! BUT I could able to create such button for salesforce classic/// but not for salesforce1 app....
Namita Upadhyaya1Namita Upadhyaya1
Hi ,

I am still looking for the soluion.. please help or guide !
Right the now I need to prepopulate the picklist field on Event with a reference picklist from Account on salesforce1.
This functionality works well with salesforce classics. But with salesforce 1 , If I define Quick Action with predefine value then for a picklist value it only gives to select a specific value , cannot give a reference picklist field value.

Please help !!

Thanks !
RT2311RT2311
Hi Namitha did you get the solution for this?