• Hemant Thakkar
  • NEWBIE
  • 0 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
Here is my code, What i am doing..i want to pass selected lookup REcord id to outout link. I got id in the javascript and allocated it to the controller variable. But i am unale to use that variable with the updated value in the output link.
Plz help me

Bold Part is my Output link. Output link name is test link . you can find out


<apex:page standardController="Sales_Exception__c" id="SalesExceptionPage" extensions="DineshTestController" showheader="true" action="{!pageredirect}">  
    <!-- <script>
        function checkID(param){
         alert('Entering');
         alert(param);
         QuoteIDValue = param;
         var reasonEle=document.getElementById('{!$Component.SalesExceptionPage:theScriptException:pb:blockB:pbs:pgblock:0:testid:0:rpt:0:theLink1}'); // blockB:pbs:pgblock:testid:rpt:theLink1
         alert(reasonEle);
        }
    </script>-->
    <apex:form id="theScriptException">
        <apex:pageMessages >
        </apex:pageMessages>
       
        <script> 
            
       
        
       
            function openpopupWindowDeal(){           
<!--           win1=window.open('/apex/DealEdit?retURL=/apex/PERScriptQ','Search','scrollbars=1,width=900,height=500');  -->
                win1=window.open('/apex/DealEdit?','Search','scrollbars=1,width=900,height=500');
                  win1.focus();
                win1=true;           
                //return false;
            }  
       
        function openpopupWindowMA(){           
                 win1=window.open('/apex/detailPage?','Search','scrollbars=1,width=900,height=900');
            // win1.focus();
                 win1=true;           
                //return false;
            }  
        </script>
      
        <b>Note: </b><br/>
            <b>- Prototype - Work in Progress.</b><br/>
            <b>- Questions and Answers will become visible only when a Customer Transaction is created/linked</b>
        <br/><br/> 
         <apex:pageblock rendered="{!legacyRecord}">
            <font color="red" size="3px">
                <apex:outputText >
                    Sorry, you cannot create a product pricing exception(legacy) record type.
                </apex:outputText>
            </font>
            <apex:pageBlockButtons location="Bottom" > 
               
                <apex:commandButton action="{!cancel}"  value="Back" id="thecancelbtn" />
            </apex:pageblockButtons>   
         </apex:pageblock>

        <apex:actionFunction name="preSend" reRender="thePanelWrapper,blockA,blockB,blockc,blockd" oncomplete="checkID('{!Sales_Exception__c.Quote_Proposal__c}')" /> <!-- {!Sales_Exception__c.Quote_Proposal__c} -->

<apex:inputfield value="{!Sales_Exception__c.Quote_Proposal__c}" id="d1" onchange="preSend()" >
                                        <apex:outputLink id="theLink1"  onclick="window.open('/apex/ManualAllocation?id={!QuoteIDValue}','_blank','width=810,height=310,toolbar=0,status=1,scrollbars=1,resizable=yes',!1);return false;" >Test Link
                                        <script>
                                        function checkID(param){
                                         alert('Entering');
                                         alert(param);
                                         QuoteIDValue = param;
                                         var reasonEle=document.getElementById('{!$Component.theLink1}').value; // blockB:pbs:pgblock:testid:rpt:theLink1
                                         alert(reasonEle);
                                        }
                                    </script>
                                        </apex:outputLink>

                                        <!-- onclick="javascript:openpopupWindowDeal();"target="_blank"  window.open('/apex/ManualAllocation','_blank','width=810,height=310,toolbar=0,status=1,scrollbars=1,resizable=yes',!1); rendered="{!if(cmap.Question_Type__c == 'Link',true,false)}"-->
                                    </apex:repeat>
                                    </apex:column>
                                   </apex:datatable>
                                  
                                
Hi ,

I have a requirement and i am not able to find how to handle it. Please if anybody can help me.

I have a field which contains field type values like Radio Button, Text Box , Picklist etc. and I have a field named as value which can contain any text.

What i want that on selection of the Fieldtype value the data is in Field Value will Populate in that manner on Visualforce page.

Like FieldType - Radio Button   
Value - Car , Bus

It will display Car and Bus in 2 Radio Button.

Good Links will also appreciated.

Thanx


{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")};
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")};

try{
alert('Entering');
var qr = sforce.connection.query("SELECT Id, Quote_Proposal__c, Quote_Proposal__r, Name FROM Sales_Exception__c WHERE Quote_Proposal__r.Id = '" + "{!Apttus_Proposal__Proposal__c.Id}""' ");

var seid = records.getArray('qr');

if (seid[0].Quote_Proposal__r != null)
{
    window.location.href = "/apex/PERScriptQ" + seid[0].id;
} else {

    window.location.href= "/apex/PERScriptQ";
}
}
catch(e){
    alert('An Error has Occurred. Error:' + e);
}


showing a problem with onclick javascript for this button or link was encountered
unexpexted string

Please give me any solution
Hi,
I am trying to pass Account id through param to the controller , but controller is not recieving that value from my visualforce page.
Please Help me out and give me the reason .
I tried with all javascript , jsquery and param too, so if you find anything extra please ignore as i am trying to do by any method that might work.
Here is the code

Visualforce Page :-

<apex:page controller="AccountListController" docType="html-5.0" id="pg">
    <style>
        .requiredLoaderBG{
        background-color: rgb(71,71,71);
        opacity:0.7;
        filter:alpha(opacity=70);
        background-image:url('{!$Resource.ajaxLoadGif}');
        background-position: center center;
        background-repeat: no-repeat;
        height: 100%;
        left: 0;
        position: fixed;
        text-align: center;
        top: 0;
        width: 100%;
        z-index: 1;
    }
    </style>
    <script>
    function setaccvalue(accountid){
        alert(accountid);
        alert(document.getElementByid("pg\:frm\:PagBlck\:AccIdcheck").value);
        document.getElementByClassName('AccClass')[0].value = accountid;
        alert(document.getElementByClassName('AccClass')[0].value);
    }
   
    </script>
   
          <apex:form id="frm">
          <apex:pageBlock id="PagBlck">
          <apex:commandButton value="Create Account" action="{!save}" reRender="frm" status="actStatus"/>
          <apex:actionFunction action="{!save}"  status="actStatus" name="actfunct" reRender="frm,fields"/>
          <apex:actionFunction name="accparam" reRender="AccIdcheck">
              <apex:param name="p1" value="" assignTo="{!Acid}" />
          </apex:actionFunction>
          <apex:actionStatus startStyleClass="requiredLoaderBG" id="actStatus"></apex:actionStatus>
          <Div align="right">
              <apex:inputText value="{!Acid}" styleClass="AccClass" id="AccIdcheck"/>
              <apex:inputHidden value="{!Acid}" id="myHiddenField"/>
              <apex:inputText value="{!num}" style="width:45px"/>
              <apex:commandButton value="Add rows" action="{!add_rows}" reRender="tblop" status="actStatus"/>
          </Div>
          <apex:outputPanel rendered="{!val}" id="tblop">
              <apex:pageBlockTable value="{!AccoList}" var="Alst"  id="tbl">
                  <apex:column value="{!Alst.name}" rendered="{!if(Alst.name != null , true ,false)}"/>
                  <apex:column >
                      <apex:inputField value="{!Alst.name}" rendered="{!if(Alst.name != null ,false,true)}"/>
                  </apex:column>
                 
                  <apex:column >
                      <!--<input type="button"  value="Create" onclick="actfun"> <!-- onclick="actfunct();" - ->
                              <apex:param value="{!Alst.id}" name="Acntid" assignTo="{!Acid}"/>
                      </input> -->
                      <apex:commandLink value="Create"   action="{!Save}"> <!-- action="{!Save}" -->
                          <apex:param value="{!Alst.id}" assignTo="{!Accid}"/>
                      </apex:commandLink>
                  </apex:column>
              </apex:pageBlockTable>
          </apex:outputPanel>
         
          <apex:pageBlockSection id="fields" rendered="{!Not(val)}">
              <input type = "button" value = "Save" onclick = "CrtCont();" />
              <apex:actionFunction action="{!SaveContact}" status="actStatus" name="CrtCont" />
                      <apex:inputField value="{!Con.firstname}"/>
                      <apex:inputField value="{!Con.lastname}"/>
          </apex:pageBlockSection>
         <!-- apex:pageBlockSection rendered="{!Not(val)}">
              <apex:inputField value="{!Acc.name}"/>
              <apex:inputField value="{!Acc.Phone}"/>
              <apex:inputField value="{!Acc.type}"/>
              <!--<apex:selectRadio value="{!Acc.Rating}">
                    <apex:selectoptions value="{!types}"></apex:selectoptions>
              </apex:selectRadio> - ->
              <c:PicklistValue />
          </apex:pageBlockSection> -->
         </apex:pageBlock>
      </apex:form>
    
</apex:page>

Apex :-

Public Class AccountListController{
    Public List<Account> AccoList {get; set;}
    Public Contact Con {get; set;}
    Public Account Acc {get; set;}
    Public Boolean val {get; set;}
    Public String Acid {get; set;}
    public integer num {get; set;}
    Public String Accid{get; set;}
   
    Public AccountListController(){
        Con = new Contact();
        Acc = new Account();
        val = true;
        AccoList = [Select id, name from Account limit 1000];
    }
    /**Public List<Account> getAcco(){
        AccoList = [Select id, name from Account limit 1000];
        return AccoList;
    }**/
    Public PageReference Save(){
        val = false;
       // Acid = apexpages.currentpage().getparameters().get('Acntid');
        System.debug('++++++Acid+++++'+Acid);
        //Con.Accountid = Acid ;
        upsert AccoList;
        return null;
    }
    Public PageReference SaveContact(){
        //Accid = Apexpages.currentpage().getparameters().get('p1');
        System.debug('++++++Acid+++++'+ Accid);
        Con.Accountid = Accid ;
        insert Con;
        if(Acc.name != null)
        insert Acc;
        return null;
    }
     Public PageReference add_rows() {
        for(integer i=0;i<num ;i++)
            {
            System.debug('======Entering===='+i);
              AccoList.add(new Account());   
            }
            return null;
     }
    Public PageReference SaveAccount(){
        return null;
    }
    Public List<SelectOption> getTypes(){
        Schema.sObjectType sobject_type = Account.getSObjectType();
        Schema.DescribeSObjectResult sobject_describe = sobject_type.getDescribe();
        Map<String, Schema.SObjectField> field_map = sobject_describe.fields.getMap();
        List<Schema.PicklistEntry> pick_list_values = field_map.get('Rating').getDescribe().getPickListValues();
        List<selectOption> options = new List<selectOption>();
        for (Schema.PicklistEntry a : pick_list_values) {
             options.add(new selectOption(a.getLabel(), a.getValue()));
          }
        return options;
    }
}

I'm trying to implement the <support:clickToDial> component on a visualforce page, and it won't connect to the CTI adapter (Shoretel). It just has a greyed out phone icon and when you hover over it it says "Click to Dial Disabled". We know that the CTI adapter is set up correctly because we can click on normal phone fields within salesforce. 

Hello Experts,

 

I am beginner in SFDC and trying my hand to develop my first Visual Page with Apex Class. Please help me in understanding the code. Scenario: Create a VF page which has a Account lookup and once you select the account by clicking lookup and click submit , it should display the contact list of that particular account. Once the list appears of associated contacts users should have two options with the associated contact i.e.. Edit and Del

 

so far I am able to create below VF code which is showing me the Account with lookup but I am struggling with the rest of the part.Account :

 

 

<apex:page standardController="contact" >
<apex:sectionHeader title="My Page" />
<apex:pageBlock >
<apex:form >
Account : <apex:inputField id="accountLookup" value="{!Contact.AccountId}"/>
<p> <apex:commandButton action="{! save}" value="Submit!"/> </p>
</apex:form>
</apex:pageBlock>
<apex:relatedList list="Contacts" />
</apex:page>

 

any help is appreciated. Regards