You need to sign in to do that
Don't have an account?
Mike Parks 5
Visualforce Page in Production works differently from the same page in Sandbox
This visualforce page works perfectly in Sandbox but when I copy it into Production, clicking the Save button shows a blank screen, even though the record actually gets created. It's like it won't re-render back to the newly created record for display. Has anybody seen anything like this?
<apex:page standardController="Project__c" extensions="RelatedController1">
<apex:stylesheet value="/resources/htdocs/css/basic.css"/>
<apex:form >
<apex:outputpanel id="accinfo" >
<apex:pageMessages id="msgs"/>
<apex:pageBlock title="Project Create/Edit">
<apex:pageMessages ></apex:pageMessages>
<apex:pageMessages id="showmsg"></apex:pageMessages>
<apex:actionRegion >
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:pageblocksection columns="1">
<apex:inputField value="{!Project__c.Proposal__c}">
<apex:actionSupport event="onchange" action="{!PopulateProject}" rerender="accinfo, msgs"/>
</apex:inputField>
<apex:actionFunction name="CallApexMethod" action="{!PopulateProject}" reRender="accinfo, msgs"/>
<apex:inputField value="{!Project__c.Name}" />
<apex:inputField value="{!Project__c.Account__c}" />
<apex:inputField value="{!Project__c.Project_Contact__c}"/>
<apex:inputfield value="{!Project__c.Scope_of_Work__c}" required="false"/>
<apex:inputfield value="{!Project__c.Service_Type__c}" required="false"/>
<apex:inputfield value="{!Project__c.Project_Stage__c}" required="false"/>
</apex:pageblocksection>
<apex:pageblocksection columns="1">
<apex:inputfield value="{!Project__c.Contract_Date__c}" required="false"/>
<apex:inputfield value="{!Project__c.Start_Date_Project__c}" required="false"/>
<apex:inputfield value="{!Project__c.End_Date_Project__c}" required="false"/>
<apex:inputfield value="{!Project__c.Substance_Code__c}" required="false"/>
<apex:inputfield value="{!Project__c.Project_Manager__c}" required="false"/>
<apex:inputfield value="{!Project__c.Co_Project_Manager__c}" required="false"/>
<apex:inputfield value="{!Project__c.Co_Project_Manager1__c}" required="false"/>
</apex:pageblocksection>
</apex:pageblocksection>
<apex:pageblocksection title="Financials" showheader="true" columns="1">
<apex:inputfield value="{!Project__c.Person_Days__c}"/>
<apex:inputfield value="{!Project__c.Corp_Size__c}"/>
<apex:inputfield value="{!Project__c.Travel_and_Expenses__c}" required="false"/>
</apex:pageblocksection>
<apex:pageblocksection title="PIF Required" showheader="true" columns="2">
<apex:inputfield value="{!Project__c.Delivery_Mode__c}" required="false"/>
<apex:inputfield value="{!Project__c.Project_Mode_Type__c}" required="false"/>
<apex:inputfield value="{!Project__c.EIS_Years__c}" required="false"/>
<apex:pageblocksectionitem />
</apex:pageblocksection>
</apex:actionRegion>
<apex:pageBlockButtons >
<apex:commandButton value="Cancel" action="{!cancel}"/>
<apex:commandButton value="Save" action="{!save}" reRender="showmsg"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:outputpanel>
</apex:form>
<script>
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function')
{
window.onload = func;
}
else
{
window.onload = function()
{
if (oldonload)
{
oldonload();
}
func();
}
}
}
addLoadEvent(function()
{
var controllervariable='{!Project__c.Proposal__c}';
if(controllervariable==null || controllervariable == ''){return false;}
else {
CallApexMethod(); }
});
</script>
</apex:page>
<apex:page standardController="Project__c" extensions="RelatedController1">
<apex:stylesheet value="/resources/htdocs/css/basic.css"/>
<apex:form >
<apex:outputpanel id="accinfo" >
<apex:pageMessages id="msgs"/>
<apex:pageBlock title="Project Create/Edit">
<apex:pageMessages ></apex:pageMessages>
<apex:pageMessages id="showmsg"></apex:pageMessages>
<apex:actionRegion >
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:pageblocksection columns="1">
<apex:inputField value="{!Project__c.Proposal__c}">
<apex:actionSupport event="onchange" action="{!PopulateProject}" rerender="accinfo, msgs"/>
</apex:inputField>
<apex:actionFunction name="CallApexMethod" action="{!PopulateProject}" reRender="accinfo, msgs"/>
<apex:inputField value="{!Project__c.Name}" />
<apex:inputField value="{!Project__c.Account__c}" />
<apex:inputField value="{!Project__c.Project_Contact__c}"/>
<apex:inputfield value="{!Project__c.Scope_of_Work__c}" required="false"/>
<apex:inputfield value="{!Project__c.Service_Type__c}" required="false"/>
<apex:inputfield value="{!Project__c.Project_Stage__c}" required="false"/>
</apex:pageblocksection>
<apex:pageblocksection columns="1">
<apex:inputfield value="{!Project__c.Contract_Date__c}" required="false"/>
<apex:inputfield value="{!Project__c.Start_Date_Project__c}" required="false"/>
<apex:inputfield value="{!Project__c.End_Date_Project__c}" required="false"/>
<apex:inputfield value="{!Project__c.Substance_Code__c}" required="false"/>
<apex:inputfield value="{!Project__c.Project_Manager__c}" required="false"/>
<apex:inputfield value="{!Project__c.Co_Project_Manager__c}" required="false"/>
<apex:inputfield value="{!Project__c.Co_Project_Manager1__c}" required="false"/>
</apex:pageblocksection>
</apex:pageblocksection>
<apex:pageblocksection title="Financials" showheader="true" columns="1">
<apex:inputfield value="{!Project__c.Person_Days__c}"/>
<apex:inputfield value="{!Project__c.Corp_Size__c}"/>
<apex:inputfield value="{!Project__c.Travel_and_Expenses__c}" required="false"/>
</apex:pageblocksection>
<apex:pageblocksection title="PIF Required" showheader="true" columns="2">
<apex:inputfield value="{!Project__c.Delivery_Mode__c}" required="false"/>
<apex:inputfield value="{!Project__c.Project_Mode_Type__c}" required="false"/>
<apex:inputfield value="{!Project__c.EIS_Years__c}" required="false"/>
<apex:pageblocksectionitem />
</apex:pageblocksection>
</apex:actionRegion>
<apex:pageBlockButtons >
<apex:commandButton value="Cancel" action="{!cancel}"/>
<apex:commandButton value="Save" action="{!save}" reRender="showmsg"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:outputpanel>
</apex:form>
<script>
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function')
{
window.onload = func;
}
else
{
window.onload = function()
{
if (oldonload)
{
oldonload();
}
func();
}
}
}
addLoadEvent(function()
{
var controllervariable='{!Project__c.Proposal__c}';
if(controllervariable==null || controllervariable == ''){return false;}
else {
CallApexMethod(); }
});
</script>
</apex:page>
May I suggest you please refer the below link for similar kind of issue.
- https://salesforce.stackexchange.com/questions/20882/different-results-in-sandbox-vs-production
Please mark it as best answer if the information is informative.Thanks
Rahul Kumar