You need to sign in to do that
Don't have an account?
Dhanamjaya Paidipat
To Stop loading the standard page
Hi Everyone,
I have created a Visual page on Lead and added on Lead page but if i try to update the fields from visual page after save the page it's loading to Lead page.
Kindly help us to avoid this issue assp.
Thanks in Advance.
Code:
<apex:page sidebar="false" showheader="false" standardController="Lead" action="{!routePage}">
<apex:form >
<apex:outputLabel ><b> #Call: </b></apex:outputLabel>
<apex:outputField value="{!Lead.Call_Number__c}"/>
<apex:outputLabel ><b> #Attempt: </b></apex:outputLabel>
<apex:outputField value="{!Lead.Attempt_Number__c}"/>
<apex:pageBlock >
<apex:pageBlockSection columns="1" title="Patient details" rendered="{!Lead.Country__c== 'India'}">
<apex:outputField value="{!Lead.name}"/>
<apex:outputField value="{!Lead.Phone}"/>
<apex:inlineEditSupport />
</apex:pageBlockSection>
<apex:pageBlockSection title="Patient Consent" rendered="{!Lead.Country__c== 'India'}">
<apex:outputField value="{!Lead.Gendre__c}"/>
<apex:inlineEditSupport />
</apex:pageBlockSection>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Error:
I have created a Visual page on Lead and added on Lead page but if i try to update the fields from visual page after save the page it's loading to Lead page.
Kindly help us to avoid this issue assp.
Thanks in Advance.
Code:
<apex:page sidebar="false" showheader="false" standardController="Lead" action="{!routePage}">
<apex:form >
<apex:outputLabel ><b> #Call: </b></apex:outputLabel>
<apex:outputField value="{!Lead.Call_Number__c}"/>
<apex:outputLabel ><b> #Attempt: </b></apex:outputLabel>
<apex:outputField value="{!Lead.Attempt_Number__c}"/>
<apex:pageBlock >
<apex:pageBlockSection columns="1" title="Patient details" rendered="{!Lead.Country__c== 'India'}">
<apex:outputField value="{!Lead.name}"/>
<apex:outputField value="{!Lead.Phone}"/>
<apex:inlineEditSupport />
</apex:pageBlockSection>
<apex:pageBlockSection title="Patient Consent" rendered="{!Lead.Country__c== 'India'}">
<apex:outputField value="{!Lead.Gendre__c}"/>
<apex:inlineEditSupport />
</apex:pageBlockSection>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlock>
</apex:form>
</apex:page>
Error:
All Answers
Greetings to you!
You are using the standard controller Save, which redirects you to the record view page for the object This means that you get a standard salesforce page embedded in an iframe within your standard visualforce page.
You need to create an extension controller that leaves the user on your Visualforce page after they click Save.
Controller:
Add on a page attribute:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
Thanks for your support.
I tried this way but if i created a Iam not able to add visual page in my Lead pagelayout.
Can you please help me on this ?
Regards,
Khan Anas
Let me try this and get back to you .
It's my pleasure. I’m glad I was able to help!
Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue. *(If you mark the answer as best answer which helps you to solve the problem, the question is marked as “resolved”)*
Regards,
Khan Anas