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
Erik John PErik John P 

Unable to place VF page button in page layout

Hello all,
While at Dreamforce a very helpful developer showed me how to create a VF page, then a button that will display in Lightning.  I took copious notes, and tried to replicate another button I need to display in Lightning.  When I go to page layout and attempt to place the button, it is "not allowed".  I don't appear to have any issues with my APEX.  it is essentially a hyperlink that goes to a different system.  Any assistance is appreciated.

here's the code if that helps:

<apex:page standardController="Opportunity">
    <script>

http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id}

    </script>
</apex:page>
Best Answer chosen by Erik John P
SwarnaSankhaSinghSwarnaSankhaSingh
Hi Erik,

I am guessing that you want this button to show up on the Opportunity Detail page within the Lightning Experience (aka LEX) in which case you do not need a VF page for opening up a URL with the Oppty ID populated using a merge field.

Can you give it a try to modify the button similar to the screenshot I shared earleir with you and let me know what you see?

Kind Regards,
Swarna.

All Answers

SwarnaSankhaSinghSwarnaSankhaSingh

Hi Eric,

When you are on the Edit view of the Pagelayout, are you selecting Buttons (2nd option on the list) on the left hand pane of the palette on the top and then trying to drag the button you have created onto the "Salesforce1 and Lightning Experience Actions" Pane at the top of the pagelayout?

If you are then you will need to select the option which reads "Salesforce1 and Lightning Actions" (5th option on the list) on the left hand pane of the palette on the top and then trying dragging the button you have created onto the "Salesforce1 and Lightning Experience Actions" Pane.

Please do let me know the outcome.

Kind Regards,
Swarna.

Erik John PErik John P
Hello Swarna, Thank you for the assistance. I was able to place the button now after your direction. However, clicking the button simply takes me to an almost blank screen, only has the SFDC header and menu options. [cid:image001.png@01D22302.3B653180] Erik Peterson | Application Support Analyst Tuff Shed, Inc. | IT Department Phone: 303-474-5684 Email: epeterson2@tuffshed.com
SwarnaSankhaSinghSwarnaSankhaSingh
Hi Erik,

Progress is always nice (^_^). So what you are getting now is basically a popup window with a blank screen or you are on the same screen with everything below the tabs blanking out?

Can you tell me what you want to do - open up a URL with the SFDC OpptyID prepopulated in a new window/tab outside of the SFDC? Can you also open the button/action you have created in the edit mode and sent me a screenshot?

Kind Regards,
Swarna.
Erik John PErik John P
Hello! Indeed, progress is good! ☺ After clicking the link, it appears to be the same page with everything below tabs blanked out. I want to open a new window that is linking to our ERP system. We have some integration built in to link that creates a record in our other system that will correlate to that opportunity record. I’m not sure I understand what you mean by open the button in edit mode, but here’s the screenshot [cid:image001.png@01D2245F.A1CC0080] Erik Peterson | Application Support Analyst Tuff Shed, Inc. | IT Department Phone: 303-474-5684 Email: epeterson2@tuffshed.com
Erik John PErik John P
User-added image

Hello Swarna, not sure if my last post included the screenshot, so adding it here.  any further assistance is appreciated!
SwarnaSankhaSinghSwarnaSankhaSingh
Hi Eric,

I am sorry for the delayed response; been buried in work for the last few days. And yes the comment prior to your most recent did not have the screenshot but your last one does and it provides the needed clarity.

I am not sure why you are selecting the content as a VF Page if all that you want is to open a URL with one of the parameter values to the the SFDC Opportunity ID. You will need to make the changes to the Custom Button as shown in the screenshot below:

User-added image

Please do let me know how it works out for you.

Kind Regards,
Swarna.
Erik John PErik John P
Hello Swarna,  thank you for the response!  Correct me if I'm wrong, but I want this button to display in Lightning, so it was my understanding that I needed a VF page to do this?
SwarnaSankhaSinghSwarnaSankhaSingh
Hi Erik,

I am guessing that you want this button to show up on the Opportunity Detail page within the Lightning Experience (aka LEX) in which case you do not need a VF page for opening up a URL with the Oppty ID populated using a merge field.

Can you give it a try to modify the button similar to the screenshot I shared earleir with you and let me know what you see?

Kind Regards,
Swarna.
This was selected as the best answer
Erik John PErik John P
well I am surprised.  that works!  thank you Swarna!
Erik John PErik John P
not sure if you have time for this, I can start a new discussion if so.  I have a similar situation with another button in Lightning.  it does a similar action (takes user to ERP system), and a separate window does open, but the opportunity page "blanks out" aside from the menu at the top.  This other button is a VF page but isn't a simple URL to my knowledge.  I'll include a shot of that.  Again, if you have time.  You've been extremely helpful regardless
.User-added image  
SwarnaSankhaSinghSwarnaSankhaSingh
Hi Eric,

You are very welcome.

As far as the second screenshot goes, I did take a look at the code authored by you and I feel there seems to be a disconnect between what you have coded vs. what you might be expecitng the system to do.

Here are my questions and observations:
  1. When you click on the button, named CreateSO_Opportunity, you are asking the system to do the following:
    1. Check if the field named JDE Order Number is Empty and if it is then it should open a URL with the Opportunity ID pre-populated using a Merge field.
    2. If the field is not Empty, it should show a message that the "JDE Order already exists".
  2. What will bringing up this link do?
    1. Will it create a Sales Order in your ERP system (I am guessing)?
    2. If it does create a Sales Order using this URL, then how are you expecting the ERP system to come back and update the JDE Order Number because it seems like it would or atleast you expect it to based on how you have defined your logic on the page?
  3. As far as the primary issue you want to fix is defnitely as to why "a separate window does open, but the opportunity page "blanks out" aside from the menu at the top" - Correct?
Kind Regards,
Swarna.
Erik John PErik John P
Hello again,
1.  All the action within the VF page is working as planned, the issue of the blank page persists.  I am concerned that end users will not like this action, although easily fixed with the back button on the browser.
     a.  yes, this is the intended action.
     b.  correct.
2.  
     a.  yes, it will create a sales order with a unique Sales Order number
     b.  we have some automation that will write the new Sales Order number to a field in SFDC.
3.
     a.  yes, all of the above appears to be working as planned, my only issue is the blank page left behind as users are re-directed to the ERP        system.  it's an easy enough fix to hit the back button on the browser, but it doesn't seem like a planned experience for the sales user.
SwarnaSankhaSinghSwarnaSankhaSingh
Hi Erik,

It all makes sense but I do have one more question based on what yo usaid in your thid point which is "my only issue is the blank page left behind as users are re-directed to the ERP system" - the window in which the ERP URL opens is working fine but the Opportunity page from where you click the button just simply blanks out; is this correct?

Can you please add the screenshot of the button configuration that you are referring to in this scenario?

Kind Regards,
Swarna.
Erik John PErik John P
certainly!  the Create SO (new) button.    top right of page.
User-added image
and here's the result of clicking that button.  it will open to the ERP system (second tab), but SFDC result is the below "blank" screen with just the menu bar.
User-added image