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
Javeed ShaikJaveed Shaik 

I am not able to create new global action using custom visualforce page

Hi

I created a visualforce page but I am unable to create new global action using this visualforce page.
I am not able to find what went wrong!! Please help me in this.

Thanks in advance!!

I am not able to create new global action using custom visualforce page
Rohit B ☁Rohit B ☁
Hi Javeed,
May be there is some issue with your VF page. Hope you created your VF Page compatible for Global Action.
Here is the sample code :-
<apex:page docType="html-5.0" title="Create Account">
    
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Account" fields="Id,Name"/>
    </apex:remoteObjects>
    
    <div class="mypage">
        Account Name:
        <input type="text" id="accountName"/>
        <button onclick="createAccount()">Create Account</button>
    </div>
    
    <script>
        function createAccount() {
            var accountName = document.getElementById("accountName").value;
            var account = new SObjectModel.Account();
            account.create({Name: accountName}, function(error, records) {
                if (error) {
                    alert(error.message);
                } else {
                   sforce.one.navigateToSObject(records[0]);
                }
            });
        }
    </script>
    
</apex:page>

Please take the reference of this VF page and let me know. Whether it is enough to solve your issue or not.
Javeed ShaikJaveed Shaik
Hi Rohit,

Glad to see you reply! 
Can you please tell me what are the mandatory steps (line of code that must have) to create VF Page compatible for Global Action.

Thanks in advance!! 
Rohit B ☁Rohit B ☁
Hi Javeed,
I'm also not much familiar with this approach.
You can reference from the below link :-

https://trailhead.salesforce.com/modules/visualforce_mobile_salesforce1/units/visualforce_mobile_salesforce1_actions_global

https://help.salesforce.com/articleView?id=custom_actions_vf_pages_for_global_actions.htm&type=0&language=en_US&release=206.10

Hope it helps..
Javeed ShaikJaveed Shaik
Any one please..