• kondru xavier 4
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi all,
I have a VF page with a save button using only the standard controller. When the save button is clicked, the entire page was being loaded in the VF section. 
So, I tried using the commandlink with the target_parent like -
<apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn">
This worked fine in Chrome and Firefox but didn't work in IE despite checking all settings on IE. It opened a new window in IE with just the VF page.

So, I modified this to a command button like -
<apex:commandButton value="Save" action="{!save}" onclick="window.top.location='/{!<object>.id}'; return true"/>
But this doesn't save the record at all times. The behavior is erratic. At times, it does save the record and at times it doesn't. This behavior is noted on all browsers.

Please assist.

 

Hi all,

 

iam facing problem using visual force page in my lead there a re four record types

one,two,three,four.

if i click new button->then it shows the record type selection page->then i select one ->it redirects to a visual force page name leadTest. because i over ridden new button with visual force page.

 

if i click two it should go to a standard page record type for two and a page layout is also assigned for it.

 

if i click three it should go to a standard page record type for three and a page layout is also assigned for it.

 

same like for four.

 

but here it is not redirecting to the standard page when iam passing the url in my controller .

 

can any help me. my code is:-

 

visualforce page  

<apex:page StandardController="Lead" tabStyle="Lead" extensions="LeadController" action="{!redirectToPage}" >

 

Controller Method

 public PageReference redirectToPage() {
     
        String selectedRecordType = ApexPages.currentPage().getParameters().get('RecordType');
        if (selectedRecordType == 'One')// id will be there
            return Page.LeadTest.setRedirect(True);        
        else if(selectedRecordType == 'Two')
            return  new PageReference('/00Q/e?retURL=%2F00Q%2Fo&RecordType=012O00000000Acd&ent=Lead');
          else if(selectedRecordType == 'Three')
            return  new PageReference('/00Q/e?retURL=%2F00Q%2Fo&RecordType=012O00000000Acn&ent=Lead');

         else if(selectedRecordType == 'four')
            return  new PageReference('/00Q/e?retURL=%2F00Q%2Fo&RecordType=012O000000003ds&ent=Lead');   
        else
            return null;
    }