You need to sign in to do that
Don't have an account?
Ben4817
Redirecting to a URL on Save without a controller
I have written a Visualforce page for support reps to verify basic account info before creating a case. It is essentially the account edit page with only a few fields visible. When the rep clicks Save, I want to create a new case with a few values being passed in the URL. I can do it just fine with a controller, but I have discovered that with Enterprise edition, since we have purchased it and are not using a trial, we can only write controllers in a Sandbox, not our production environment. Does anyone know how I could make the Save button perform a standard save action and then redirect to a new URL strictly in the Visualforce page? Please see my code below:
<apex:page standardcontroller="Account" tabStyle="Case">
<apex:form >
<apex:pageBlock title="Hello {!$User.FirstName}!" mode="edit">
Please verify the following information with {!Account.Name}. <br/> <br/>
<apex:pageMessages />
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockSection title="Contact details for {!Account.name}" columns="2">
<apex:inputField value="{!Account.name}" required="false"/>
<apex:inputField value="{!Account.phone}" required="true"/>
</apex:pageBlockSection>
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.BillingStreet}"/>
<apex:inputField value="{!Account.BillingCity}"/>
<apex:inputField value="{!Account.BillingState}"/>
<apex:inputField value="{!Account.BillingPostalCode}"/>
<apex:inputField value="{!Account.BillingCountry}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Verified" action="{!save}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page standardcontroller="Account" tabStyle="Case">
<apex:form >
<apex:pageBlock title="Hello {!$User.FirstName}!" mode="edit">
Please verify the following information with {!Account.Name}. <br/> <br/>
<apex:pageMessages />
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockSection title="Contact details for {!Account.name}" columns="2">
<apex:inputField value="{!Account.name}" required="false"/>
<apex:inputField value="{!Account.phone}" required="true"/>
</apex:pageBlockSection>
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Account.BillingStreet}"/>
<apex:inputField value="{!Account.BillingCity}"/>
<apex:inputField value="{!Account.BillingState}"/>
<apex:inputField value="{!Account.BillingPostalCode}"/>
<apex:inputField value="{!Account.BillingCountry}"/>
</apex:pageBlockSection>
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Verified" action="{!save}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
window.parent.location.href = 'http://.......' ;
:smileyhappy:
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Verified" action="{!save}"
oncomplete="window.parent.location.href='https://na3.salesforce.com/500/e?retURL=%2F{!Account.Id}&def_account_id={!Account.Id}&RecordType=0125000000018E8&cancelURL=%2F{!Account.Id}&ent=Case'"/>
</apex:pageBlockButtons>