+ Start a Discussion
SrinivasanSrinivasan 

VF Page retURL, S-Control

Hi Can anybopdy help me out in this issue, where I need to get VF Page "actid" in s-control to return back with value.

I tried using {!$Request.actid} in s-control but it was retuning null value.

 

<apex:page Controller="Quote" tabStyle="Quote__c">
<apex:form >
        <apex:pageBlock title="Quote Picklist navigate test">
       
            <apex:pageBlockSection title="Quote Header">
                        
               <apex:inputField id="Picklist" value="{!Quote.Add_Associate_Edit__c}">
                   <apex:actionSupport event="onchange" action="{!EventChangeAction}" />
               </apex:inputField>
            
               <apex:outputField id="Link" value="{!Quote.Account__c}"/>
               <apex:inputField value="{!Quote.Bill_To__c}"/>
        </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

and my controller

 

public class Quote
{
    Quote__c Quote;
    Account account;
    ID AccountId = Apexpages.currentPage().getParameters().get('actid');
    String BillTo = Apexpages.currentPage().getParameters().get('billTo');
  

    public PageReference EventChangeAction()
    {
    if(Quote == null)
    Quote = new Quote__c();
        {
            if(Quote.Add_Associate_Edit__c == 'Add')
            {
               PageReference pageRef = new PageReference('/001/e?saveURL=/servlet/servlet.Integration?lid=01N80000000H3IF(S-ControlID)&retURL=/apex/Test_picklist?actid='+AccountId+'&billTo=');
              
               return pageRef;

            }
            else if(Quote.Add_Associate_Edit__c == 'Associate')
            {
                PageReference pageRef2 = new PageReference('http://www.google.co.in');
                return pageRef2;
            }
        }
    return null;
    }

    public Quote__c getQuote()
    {
        if(Quote == null)
        Quote = new Quote__c();
        account = new Account();
       
                account = [select Id,name from Account where Id =:AccountId  limit 1];
                Quote.Account__c = account.Id;
                If(BillTo != null)
                {
                Quote.Bill_To__c = BillTo;
                }
       
        return Quote;
    }
}

 

s-control

 

          sforce.connection.sessionId = "{!$Api.Session_ID}"

       

          var x = '{!$Request.newid}';

          alert(x);

 

          window.parent.location.href =;  

 

} 

catch (err)   {    alert(err);   }