The Section between my comments is showing what I want to see if I render it as it's own , but I can't seem to figure out how to get it to open on the same page as a modal. Apex Classes: 1. popup public class popup { public String showPopup { get; set; } public boolean displayPopup {get; set;} public void closePopup() { displayPopup = false; } public void showPopup() { displayPopup = true; } } Goals I need to figure out how to call 2 actions/functions (whatever the correct definition is). The Primary Function is supposed to Update several fields to hardcoded values when the user clicks the \"Print Button\" from the visualforce page. The Secondary Function should bring up the Print Preview Screen allowing the user to print the visualforce page (from the working code section above). Finally after the user clicks print, they should land right back on the newly updated Inventory Manager Page. I'm an acting Salesforce CRM Admin with Zero Salesforce Experience. That said I do have a master's in data science and a working knowledge of most object oriented programming languages, and I think I'm pretty close to the finish line, but need a pro's help to get there. Thanks in advance!", "answerCount": 1, "upvoteCount": 0, "datePublished": "2022-12-02T01:06:50.000Z", "author": { "@type": "Person", "name": "Michael Keen", "url": "https://trailblazers.salesforce.com/profileView?u=0054S000001o1XgQAI", "affiliation": { "@type": "Organization", "name": "Goldin Auctions" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "Sorry all; I put the wrong object in the title...It should say Inventory Manager Custom Object...", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4IxpSAF", "datePublished": "2022-12-02T01:10:53.000Z", "author": { "@type": "Person", "name": "Michael Keen", "url": "https://trailblazers.salesforce.com/profileView?u=0054S000001o1XgQAI", "affiliation": { "@type": "Organization", "name": "Goldin Auctions" } } } ] } } Skip to main content

Hi all,

I'm trying to render a visualforce page inside of Curtain Modal from the Custom Object Page called "Inventory Manager".

I've created a Details Page Button the user would click from the Inventory Manager Record Details Page. I'm trying to make it so the user remains on the Inventory Manager Record Detail Page, and shows visualforce page. 

Essentially, I'm creating an Receiving Bay Intake Process utilizing QR Codes.The Package Receipt

Process would follow this SOP:

  1. The user opens a physical box, and removes the packing slip.
  2. The packing slip contains a QR Code that when scanned takes you directly to the Opportunity Page for that shipment.
  3. The user then takes 1 item out of the box, finds it's record page from the Inventory Manager Related List, and goes to the Inventory Manager Record Details Page.
  4. The Inventory Manager Record Details Page has a Details Page Button that I created to call a visualforce page. When the user clicks the button, (and here's where my issue lay) I want a Curtain Modal to pop up, and show the visualforce page I designed which looks ok and shows what I need.
  5. The Curtain Modal would also contain a CommandButton. When clicked, this button should:

    1. First Update identified fields to a set value (marking the items as "In" on a custom field, and some others)
    2. Bring up the Print Preview Modal for the Visualforce Page Modal currently in focus.
  6. When the user is done on the Print Preview Modal, the function should refresh the Inventory Manager Records Details Page, and have the user return to Records Details Page showing the recently updated fields marking the item as "In". 

Barriers/Issues:

  1. Cant figure out how to render the Visualforce Page as a Curtain Modal.
  2. Cant figure out how to Update the fields needed.
  3. Added Bonus Issues for Extra Credit:

    1. How to programmatically set the page size of the Print Preview to fit a  Dymo LabelWriter 550 Label Maker using Dymo 30252 Labels  

<apex:page controller="popup">

    <script type="text/javascript">

        function UPDTR()

        {

            console.log("Function call worked");

            var opp= new Inventory_Manager__c; 

            /*var opp = new sforce.SObject("Inventory_Manager__c");*/

            opp.id = "{!Inventory_Manager__c.ConsignmentID__c}"

            opp.In_or_Out__c= 'In';

            sforce.connection.update([opp]); 

            window.location.reload();          

        }    

    </script>

    <apex:form >        

    

        <apex:includeScript value="/soap/ajax/37.0/connection.js"/>

        

            <apex:outputPanel id="popup" >

            

                <apex:outputPanel styleClass="customPopup" layout="block" action="{!showPopup}" rendered="{!displayPopUp}">                

                

                        <apex:pageBlock title="Identifying Item Details">

                            <apex:pageBlockSection columns="3">

                            

                                <apex:pageblocksection columns="1">

                                    <apex:outputText value="{!Inventory_Manager__c.Inventory_Manager_Record_Hyperlink__c}" escape="false"/>                

                                </apex:pageblocksection>

                                    

                                    

                                <apex:pageblocksection columns="1">                       

                                    <apex:outputField value="{!Inventory_Manager__c.Opportunity__c}" />

                                    <apex:outputField value="{!Inventory_Manager__c.Opportunity_Owner__c}" />

                                    <apex:outputField value="{!Inventory_Manager__c.Name}" />          

                                    <apex:outputField value="{!Inventory_Manager__c.Target_Auction__c}" /> 

                                    <apex:outputField value="{!Inventory_Manager__c.In_or_Out__c}" />

                                </apex:pageblocksection>    

                                

                                <apex:pageblocksection columns="1">                       

                                    <apex:outputField value="{!Inventory_Manager__c.Opportunity__c}" />

                                    <apex:outputField value="{!Inventory_Manager__c.Opportunity_Owner__c}" />

                                    <apex:outputField value="{!Inventory_Manager__c.Name}" />          

                                    <apex:outputField value="{!Inventory_Manager__c.Target_Auction__c}" />  

                                    <apex:outputField value="{!Inventory_Manager__c.In_or_Out__c}" />

                                </apex:pageblocksection>    

                                

                            </apex:pageblocksection>  

                            

                            <apex:pageBlockButtons location="bottom">

                                <apex:CommandButton value="Print" onclick="window.print();"/>                

                                <apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="popup"/>

                                <apex:commandButton value="Run Update" onclick="UPDTR();return false;" action="{!save}"/>

                            </apex:pageBlockButtons>               

                    

                        </apex:pageBlock> 

                           

                </apex:outputPanel>

                

            </apex:outputPanel>

    </apex:form>

    <style type="text/css">

       .customPopup{

            background-color: white;

            border-style: solid;

            border-width: 2px;

            font-size:12px;

            left: 50%;

            padding:10px;

            position: absolute;

            z-index: 9999;            

            height: 350px;

            width: 800px;

            margin-left: -250px;

            top:100px;

        }

    </style>

</apex:page>

The Section between my comments is showing what I want to see if I render it as it's own <apex:page >, but I can't seem to figure out how to get it to open on the same page as a modal.

Apex Classes:

1. popup

public class popup {

public String showPopup { get; set; }

public boolean displayPopup {get; set;}

public void closePopup() {

displayPopup = false;

}

public void showPopup() {

displayPopup = true;

}

}

Goals

  1. I need to figure out how to call 2 actions/functions (whatever the correct definition is).

    1. The Primary Function is supposed to Update several fields to hardcoded values when the user clicks the "Print Button" from the visualforce page.
    2. The Secondary Function should bring up the Print Preview Screen allowing the user to print the visualforce page (from the working code section above).
    3. Finally after the user clicks print, they should land right back on the newly updated Inventory Manager Page.

I'm an acting Salesforce CRM Admin with Zero Salesforce Experience. That said I do have a master's in data science and a working knowledge of most object oriented programming languages, and I think I'm pretty close to the finish line, but need a pro's help to get there.

Thanks in advance!
1 respuesta
  1. 2 dic 2022, 01:10
    Sorry all; I put the wrong object in the title...It should say Inventory Manager Custom Object...
0/9000