• Napster
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 7
    Replies
Hi Friends, 

I need a little help. I have a VF page which shows a list of records in edit mode in a table. One of the columns in the table is called comments and has a <apex:inputtext> field which accepts text. 

The requirement is that, when the user clicks on the input text box, a modal box with a bigger input text box pops up. User inputs text in the modal box and presses ok. At that point, the text should automatically get pasted into the original text box. 

Could you please help me with this. Thanks. 
Hi Friends, 

I need to be able to put a string variable inside a dyanmic query string so that my batch class can further process it. Could you please help me out? Currently i am hardcoding it. 

      string PreparationLeadRTid = Schema.SObjectType.Lead.getRecordTypeInfosByName().get('Preparation').getRecordTypeId();
        this.query
string PreparationLeadRTid = Schema.SObjectType.Lead.getRecordTypeInfosByName().get('Preparation').getRecordTypeId();
this.query = 'SELECT Id,individual_id__c,recordtypeid FROM lead WHERE recordtypeid = \'0128A000000CginQAC\' and createdDate = today';
I need to be able to insert the PreparationLeadRTid in the where condition of the query where i am currently hard coding it. I have tried using the 'xxx'+ variable + 'xxx' method but it does not work. 
Hi Friends, 

I have a pressing issue i need to solve and need your help in doing so. The problem is : 

I have a visual force page which iterates over tab's and has different questions on each tab. The questions are answered via the radio buttons. Now i have radio buttons inside <apex:repeat>, and i need to get the values that they contain in my javascript so that i may make other radio buttons hidden or show up according to the value the said radio button has. 

The problem is that i cannot give a dynamic Id to the selectRadio inside <repeat> as it will only accept literals. So how can i access them? I tried getting the component via the styleclass attribute, but it returns me a html table element, which again i cant use to decide which option has been checked in the radio button list. I am posting the VF page snippet below, any help is greatly appreciated: 
 
<apex:form style="font-size: 11px;" >   
	<apex:pageBlock id="CrossSellBlock" title="Cross Sell for {!Opportunity.Opportunity__c}">
            <apex:pageMessages />
            <apex:pageBlockButtons style="font-size: 10px;" >
                <apex:commandButton value="Save" action="{!CSSave}"/>
                <apex:commandButton value="Complete" onclick="return confirm('Would you like to submit the Survey?');" action="{!CSSubmit}"/>
                <apex:commandButton value="Reset" onclick="return confirm('Are you sure you want to reset this Survey?');" action="{!CSReset}"/>      
                <apex:commandButton value="Opt Out All" />                        
                <apex:commandButton value="Return to Opportunity" onclick="return confirm('Any unsaved work will be discarded. Do you want to proceed?');" action="{!cancel}"/>            
            </apex:pageBlockButtons>
        <apex:repeat var="Op" value="{!ProductTypes}">
                <div id="tabs-{!Op.ProductType.Product_Type__r.Id}">
                        
                        <apex:outputText value="{!Op.ProductType.Rating__r.Rating_Type__c}" rendered="false"/>
                        
                        <span id = "Ratings-{!Op.ProductType.Id}">
                        <span style='font-weight: bold;color: #0B0B61;'>What is your cross sell rating?</span><p/>
                        <apex:selectRadio id="Rdo" value="{!Op.ProductType.Rating__c}" Layout="pageDirection" onclick="dynamic(this, '{!Op.ProductType.Id}', '{!Op.ProductType.Product_Type__r.Name}', '{!Op.Reasons}');" onchange="RadioItemvalue(this);" styleClass="Class-{!Op.ProductType.Id}">
                            <apex:selectOptions value="{!Op.Ratings}" / >                           
                        </apex:selectRadio></span><p/>  
                        
                        <span id="NoOpty-{!Op.ProductType.Id}" style="display: none;"><span style='font-weight: bold;color: #0B0B61;'>Please provide a "No Opportunity" reason.</span><p/>
                            <apex:selectRadio id="sr" value="{!Op.ProductType.Reason__c}" Layout="pageDirection" onchange="RadioItemvalue(this);">
                                <apex:selectOptions value="{!Op.Reasons}"/ >                            
                            </apex:selectRadio><p/></span>
                        <span id="OptOut-{!Op.ProductType.Id}" style="display: none;"><span style='font-weight: bold;color: #0B0B61;'>Please provide an "Opt Out" reason.</span><p/>
                            <apex:selectRadio value="{!Op.ProductType.Opt_Out_Reason__c}" Layout="pageDirection">
                                <apex:selectOptions value="{!Op.OptOuts}"/ >                            
                            </apex:selectRadio><p/></span>
                        <span Id="Q-{!Op.ProductType.Id}" style="display: none;">                                
                            <span style="font-weight: bold;color: #0B0B61;">Who is our primary competitor for this product?</span><p/>
                                <apex:inputField value="{!Op.ProductType.Competitor__c}" style="margin-left: 1.5em;"/><p/>                
                                    
                            <apex:repeat var="QA" value="{!Op.CrossSells}">                                                       
                                <span style="font-weight: bold;color: #0B0B61;">{!QA.CrossSell.Cross_Sell_Question__r.Name}</span><p/>
                                    <apex:selectRadio value="{!QA.CrossSell.Cross_Sell_Answer__c}" Layout="pageDirection">
                                        <apex:selectOptions value="{!QA.Options}"/ >                            
                                    </apex:selectRadio>
                            </apex:repeat>
                        </span><p/>
                       	
                       	<span id="nxtbid-{!Op.ProductType.Id}" style="display: inline;">
                       		<span style="font-weight: bold;color: #0B0B61;">Next Out to Bid Date:  </span>
                       		<apex:inputField id="StartDate" value="{!Op.ProductType.Next_out_to_bid__c}"/> <p/>
                       	</span>
                     
                     <script>if ('{!Op.ProductType.Rating__r.Name}' == 'No Opportunity'){document.getElementById("NoOpty-{!Op.ProductType.Id}").style.display = 'inline';}</script>
                    <script>if ('{!Op.ProductType.Rating__r.Name}' == 'Opt Out'){document.getElementById("OptOut-{!Op.ProductType.Id}").style.display = 'inline';}</script>                                
                    <script>if ('{!Op.ProductType.Rating__r.Name}' == "Opt Out"){document.getElementById("Q-{!Op.ProductType.Id}").style.display = 'none';}else{document.getElementById("Q-{!Op.ProductType.Id}").style.display = 'inline';}</script>
                    <script type="text/javascript">if ('{!Op.ProductType.Product_Type__r.req_nxt_tobid__c}' == "true"){document.getElementById("nxtbid-{!Op.ProductType.Id}").style.display = 'inline';}else{document.getElementById("nxtbid-{!Op.ProductType.Id}").style.display = 'none'; }</script>
                    <script>
                    	window.onload = setFocus1();
                    	function setFocus1(){
	                    	var Ratings = document.getElementsByName('{!$Component.Rdo}');
	                    	for(x = 0 ; x < Ratings.length ; x++){
	                    		if(Ratings[x].checked == true && x == 3){
	                    			document.getElementById("Q-{!Op.ProductType.Id}").style.display = 'none';
	                    			document.getElementById("OptOut-{!Op.ProductType.Id}").style.display = 'inline';
	                    		}
	                    	}
	                    }
                    </script>
                    <input id="hiddenElementId" type="hidden" />
					<script type="text/javascript">
						window.onload = setFocus
						function setFocus()
						{
						         document.getElementById("hiddenElementId").focus();
						}
					</script>
                    
                    	<script>
    function RadioItemvalue(thisp){
    var children = document.getElementById("Ratings-{!Op.ProductType.Id}").childNodes;
    for(var l = 0 ; l < children.length ; l++){ }
    var myradios1 = document.getElementsByName('{!$Component.Rdo}');
    var component = document.getElementsByClassName("Class-{!Op.ProductType.Id}");
    for(var k = 0 ; k < component.length; k++){ var rad = component[k]; alert('Length of component value :'+rad); }
    for (var i = 0, row; row = rad.rows[i]; i++) {
	   alert('Row is :'+row + ' ' + row.value);
   	for (var j = 0, col; col = row.cells[j]; j++) {
     alert('Column is :'+col + ' ' + col.value);
   		}  
	}
    alert('length of radio :'+rad.length);
    for(var i = 0; i < myradios1.length; i++){ 
    	 var someRadio = myradios1[i];
    	alert('My radios value :' +someRadio.value);
        if(someRadio.checked) {
        	alert('The checked value is :' +someRadio.checked);
        }
       }
    } 
   function dynamic(value, noOppId, ProductType, optres){
        var noOppId1 = "NoOpty-";
        var oppout1 = "OptOut-";
        var Q1 = "Q-";
        var nxtbid = "nxtbid-";
        var ProductType = ProductType;
        noOppId1 += noOppId;
        oppout1 += noOppId;
        Q1 += noOppId;
        nxtbid += noOppId;
        var searchId = value.value;
        var noOpptyResult = '{!NoOpty}'.substring(1, '{!NoOpty}'.length-1);
        var opptOutResult = '{!OptOut}'.substring(1, '{!OptOut}'.length-1);
        var QResult = '{!Q}'.substring(1, '{!Q}'.length-1);
        var lstofnoopty = noOpptyResult.split(', ');
        var lstofopptOut = opptOutResult.split(', ');
  		var lstQ = QResult.split(', ');
  		var nooptyvalues = optres;
  		for(x = 0 ; x < lstofnoopty.length ; x++){
            if(lstofnoopty[x]== searchId && (nooptyvalues == "[]")){
                document.getElementById(noOppId1).style.display = 'none'; 
                document.getElementById(oppout1).style.display = 'none';
                document.getElementById(Q1).style.display = 'inline';
            }
             else if(lstofnoopty[x]== searchId){
                document.getElementById(noOppId1).style.display = 'inline'; 
                document.getElementById(oppout1).style.display = 'none';
                document.getElementById(Q1).style.display = 'inline';
            }
        }
        for(x = 0 ; x < lstofopptOut.length ; x++){
            if(lstofopptOut[x]== searchId){
                document.getElementById(oppout1).style.display = 'inline';  
                document.getElementById(noOppId1).style.display = 'none';
                document.getElementById(Q1).style.display = 'none';
                
            }
        }
        for(x = 0 ; x < lstQ.length ; x++){
            if(lstQ[x]== searchId){
                document.getElementById(oppout1).style.display = 'none';  
                document.getElementById(noOppId1).style.display = 'none';
                document.getElementById(Q1).style.display = 'inline';
            }
        }
</script>    
                </div>
            </apex:repeat>
        </apex:pageBlock>
</apex:form>

 
Hi friends, 

I am facing an error which i get when i click on my custom JS button. The browser returns a Unexpected Token : Illegal when trying to execute. I am not able to figure out why. Your help is greatly appreciated. 

Here is the button code :
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js")} 
{!REQUIRESCRIPT("/resource/jquery_1_9_1_min")} 
{!REQUIRESCRIPT("/resource/JQueryBlockUI")} 
{!REQUIRESCRIPT("/apex/LaunchApplications")} 

var filter = "{!CASE(Opportunity.Type , "Presale - X", "Presale - X", "Renewal - ZR", "Renewal - ZR", "Off Renewal - Y", "Off Renewal - Y", "RFI", "RFI", "Target Prospect", "Target Prospect", "NonCPP")}"; 

launchForms({!Opportunity.Id}, {!Opportunity.AccountId},{!$Api.Session_ID},filter )

This is the Page where the logic takes place : 

<apex:page contentType="text/javascript" showHeader="false" standardStylesheets="false">
  
 function launchForms(OptyId, acctId, sessionId, filter)
    {
		
		var url = "/apex/loop__looplus?eid="+OptyId+"&amp;accountId="+acctId+"&amp;sessionId=" +sessionId+ "&amp;sidebar=false&amp;filtertype=contains&amp;filter="+filter;
		var query = "SELECT ContactId__r.Name, ContactId__r.Email, Role__c FROM OpportunityContactRoleExt__c WHERE OpportunityId__c="+OptyId+" ORDER BY Contact_Name__c";
		
		var contactRoles = sforce.connection.query(query);
		
		var foundOne = false;
		
		if (contactRoles &amp;&amp; contactRoles.size &gt; 0) {
		for (var i = 0; i &lt; contactRoles.size; i++) {
		var c = (contactRoles.records[i] ? contactRoles.records[i] : contactRoles.records);
		
		if (c.Role__c == "PPACA Contact") { 
		foundOne = true;
		url += ' PPACA,';
		url += "&amp;noa="+encodeURIComponent(c.ContactId__r.Name)+","+encodeURIComponent(c.ContactId__r.Email);
		break;
		}
		}
		
		}
		if (!foundOne) url += ',';
		
		window.open(url,OptyId,'height=600,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes');
                
    }

</apex:page>

Thanks folks in advance.. :)

  • September 18, 2014
  • Like
  • 0

Hi all,

 

An application calling a webservice to salesforce recieved this xml in response :

 

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server</faultcode><faultstring>Must be a valid Exception</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>

 

Could you guys please tell me what it means?

Hello friends,

 

I am kind of new to salesforce and have been working on some projects for a litte time. I was going through a code where in a webservice, an XML is sent out to the application calling the webservice in salesforce. Here, in the XML, 3 stirings are sent out in a single tag which is supposed to be separated by a special seires of character set like &#167; 

 

Instead of these characters, sum kindof symbols are being used. I searched for this, but could not come up with anything. Could you guys please tell me what these symbols mean in the code ?

 

if(UserNotes=='')
{
                    UserNotes = EncodingUtil.urlEncode(hist.New_Value__c,'UTF-8') +'§'+ (hist.CreatedDate).format('yyyy-MM-dd HH:mm:ss', 'Europe/London'); // Timezone changes by Jayansh
                        }
                        else
                        {                        
                          UserNotes = UserNotes + '‡' + EncodingUtil.urlEncode(hist.New_Value__c,'UTF-8')+ '§'+(hist.CreatedDate).format('yyyy-MM-dd HH:mm:ss', 'Europe/London'); // Timezone changes by Jayansh
                        } 

 

Thanks

Dear Friends,

 

I have a small query and was hoping you guys could help me out. It might be a very stupid question and i request you all to kindly bear with me.

 

My salesforce app, basically a case management app where all the cases are raised by the organization is connected to another application called the bridge. Whenever a case is raised at the bridge, the details are sent to salesforce through webservice calls and an XML is sent out and the same case is created at the Salesforce end.

 

This is working fine till now. But now the bridge people have a requirment, where they want to be able to input some special characters in long text field called the "Case notes". This field will again be transferred to the SF app.

 

if(BridgeCase.ListOfNotes.UserNotes != null && BridgeCase.ListOfNotes.UserNotes != '') {
            c.User_Notes__c = BridgeCase.ListOfNotes.UserNotes;//+'§'+System.now();
        }

Now the thing is that they want to encode the special characters into UTF-8 URL encoding (i don't know what it is). They were asking if salesforce will accept the special charaters in the notes field iif sent via this encoding technique?

 

If not, are there any security issues involving the same.

 

Could any of you kindly guide me about this issue?

 

Thanks a ton.

 

Napster.

Dear Friends,

 

I have a problem to which i am not able to figure out a solution since long. I am hoping you guys would be able to shed some light on this. So here goes.

 

I have a apex page which has a look-up field to a custom object called DunsID. Here's a look:

 

[IMG]http://i40.tinypic.com/2en4xsm.jpg[/IMG]

 

Now, the DUNS ID is a number which can be searched. If i just click on the magnifing glass, all the results are returned Like follows :

 

[IMG]http://i44.tinypic.com/29pbsxh.jpg[/IMG]

 

 

When i search with a string or a part of a string for DUNS ID, i get the following results as such :

 

[IMG]http://i43.tinypic.com/otewk5.jpg[/IMG]

 

But i want to be able to search by typing in the CP Name instead of the DUNS ID, like if i type in Talk* or TalkTalk, the above resuts should be returned. But when i try doing the same, no results are shown, like follows:

 

[IMG]http://i44.tinypic.com/2it0gas.jpg[/IMG]

 

Could you guys please give me a way to do so??

 

Thanks and regards,

Surya Teja

  • September 30, 2013
  • Like
  • 0

Hi friends,

 

I am facing a problem and am having a hard time to fix it. I am hoping you guys can help me sort it out.

 

I am potting some values as stacked bar charts in a visual force page. The x- axis values are all dates. (Eg. 12/05/2012, 13/05/2012) etc.

 

I want 7 check boxes, each for one day in a week and when the user checks on the particular checkbox, only those dates should be poltted on the x-axis and all other dates will be ignored.

 

Thanks in advance,

Surya

Hi friends,

 

I need help with writing CSS for drop downs as i am a total noob at CSS.

 

I need my select lists in VF pages to look exactly like the one we get in the salesforce select list at the top. (Your name)

 

Thanks in advance.

Hi friends,

 

I have a requirment where i have 4 select lists, one for time period, company, product 1 and product 2.

 

The requirment states that i have to show a measure for 2 metrics. Example : on a single line graph, 2 lines should be there where one line represents number of missed appointments for given time period for a given company for product 1. And the other line should represent missed appointments for the same given time for the same given company but for product 2.

 

I am not able to figure out what is causing the problem in the code. The problem identified is as below:

"Querying without an ascending order (by dates) plots data points on the graphs but not in an ASC order. When we query by ASCENDING order, the dates plot in an ascending order, but there is some data loss (I.e. some dates are not plotted on the graph). Also, the dates are repeated on the x axis."

Below the logic of how we are combining 2 different query's to show in a single graph:

"Take both query results and add them to a list simultaneously in a wrapper class. If results from the first query are greater than the second query. Add the remaining results of Query 1 to the list and pass 0 values for the query 2 and visa-versa."

 

This is the visual force code :

 

<apex:pageBlockSection title="Product Comparison" columns="1">
                <apex:pageBlockSectionItem >
                   <apex:outputPanel >
                        <b>Time :</b>&nbsp;
                        <apex:selectList title="Time Select" value="{!productCompareTimeSel}" multiselect="false" size="1">
                            <apex:selectOptions value="{!timeOptions}"/>
                        </apex:selectList>
                        
                        &nbsp;&nbsp;<b> CP Name : </b>&nbsp;
                        <apex:selectList title="CP Name" value="{!productCompareCPSel}" multiselect="false" size="1">
                            <apex:selectOptions value="{!cPOptions}"/>
                        </apex:selectList>
                        
                        &nbsp;&nbsp;<b> Product 1 : </b>&nbsp; 
                        
                        <apex:selectList title="Product" value="{!productCompareSel1}" multiselect="false" size="1">
                            <apex:selectOptions value="{!productOptions}"/>
                        </apex:selectList>
                        
                        &nbsp;&nbsp;<b> Product 2 : </b>&nbsp; 
                        
                        <apex:selectList title="Product" value="{!productCompareSel2}" multiselect="false" size="1">
                            <apex:selectOptions value="{!productOptions}"/>
                        </apex:selectList>
                        
                        &nbsp;&nbsp;
                        
                        <apex:commandButton value="Submit" action="{!productCompareSubmit}" reRender="thirdPageBlockSection" status="fetch-data3">
                        </apex:commandButton>
                        <apex:actionStatus startStyleClass="tab1" startText="Fetching Results..." id="fetch-data3"/>
                    </apex:outputPanel>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            
             <apex:pageBlockSection title="Product Comparision" id="thirdPageBlockSection" columns="1" >
                <apex:pageBlockSectionItem >
                    <apex:outputLabel ><b>Chart 5</b></apex:outputLabel><br/>
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem >
                    <apex:chart data="{!ProductCompareSummaries}" width="100%" height="400" rendered="{!NOT(ISNULL(ProductCompareSummaries))}" >
                        <apex:legend position="right"/>
                        <apex:axis type="Numeric" position="left" fields="OverAllMiss2,CustMiss2,openreachMiss2,OverAllMiss1,CustMiss1,openreachMiss1"
                             title="Percentage Missed(%)" grid="true" minimum="0" />
                        <apex:axis type="Category" position="bottom" fields="measureDate1,measureDate2" title="Measure Date" grid="true">
                            <apex:chartLabel rotate="-415"/>
                        </apex:axis>
                                               
                        <apex:lineSeries title="Missed App For {!productCompareSel1} - Openreach" axis="left" xField="measureDate1" yField="openreachMiss1"
                            fill="false" markerType="circle" markerSize="4" markerFill="Red" fillColor="#4F0101"/>
                        
                        <apex:lineSeries title="Missed App For {!productCompareSel1} - Customer" axis="left" xField="measureDate1" yField="CustMiss1"
                            fill="false" markerType="circle" markerSize="4" markerFill="Yellow" fillColor="#8F0101"/>
                        
                        <apex:lineSeries title="Missed App For {!productCompareSel1} - Overall" axis="left" xField="measureDate1" yField="OverAllMiss1"
                            fill="false" markerType="circle" markerSize="4" markerFill="Black" fillColor="#BF0101"/>
                        
                        
                        
                        <apex:lineSeries title="Missed App For {!productCompareSel2} - Openreach" axis="left" xField="measureDate2" yField="openreachMiss2"
                            fill="false" markerType="cross" markerSize="4" markerFill="Green" fillColor="#4F0101"/>
                        
                        <apex:lineSeries title="Missed App For {!productCompareSel2}  - Customer" axis="left" xField="measureDate2" yField="CustMiss2"
                            fill="false" markerType="cross" markerSize="4" markerFill="Blue" fillColor="#8F0101"/>
                        
                        <apex:lineSeries title="Missed App For {!productCompareSel2} - Overall" axis="left" xField="measureDate2" yField="OverAllMiss2"
                            fill="false" markerType="cross" markerSize="4" markerFill="Orange" fillColor="#BF0101"/>
                    </apex:chart>
                </apex:pageBlockSectionItem>
            </apex:pageBlockSection>

 

The following is my controller :

 

public Class Charts2Controller{

    public Date startDate,endDate;
    public String productCompareTimeSel {get; set;}
    public String productCompareSel1 {get; set;}
    public String productCompareSel2 {get; set;}
    public String productCompareCPSel { get; set; }
    public List<AggregateResult> PCAggrQueryResult {get;set;}
    public List<AggregateResult> PCAggrQueryResultP2 {get;set;}
    public List<ProductCompareSummary> ProductCompareSummaries{get;set;}


 public List<SelectOption> gettimeOptions () {
        List<SelectOption> timeOptions = new List<SelectOption>();
        timeOptions.add(new SelectOption('CM','Calendar Month')); 
        timeOptions.add(new SelectOption('RM','Rolling Month'));
        timeOptions.add(new SelectOption('CW','Calendar Week'));
        timeOptions.add(new SelectOption('RW','Rolling Week'));
        
        return timeOptions;
    }
    
    public List<SelectOption> getproductOptions () {
        List<SelectOption> productOptions = new List<SelectOption>();
        //productOptions.add(new SelectOption('ALL','--All--')); 
        productOptions.add(new SelectOption('LLU','LLU'));
        productOptions.add(new SelectOption('WLR3','WLR3'));
        productOptions.add(new SelectOption('FTTC','FTTC'));
        
        return productOptions;
    }

public List<SelectOption> getCPOptions(){
        List<SelectOption> CPOptions = new List<SelectOption>();
        CPOptions.add(new SelectOption('CP - 1','CP - 1'));
        CPOptions.add(new SelectOption('CP - 2','CP - 2'));
        CPOptions.add(new SelectOption('CP - 3','CP - 3'));
        CPOptions.add(new SelectOption('National','National'));
        
        return CPOptions;
    }

public List<AggregateResult> ProductCompareSelectQuery()
    {
        String query = 'Select Measure_Date__c, AVG(Missed_Appointment_Customer__c) CustMissed, AVG(Missed_Appointment_Openreach__c) openreachMissed, AVG(Missed_Appointment_Overall__c) overallMissed '+
                            'from Visual_Force_Reporting_Object__c '+
                                'Where CP_Name__c =: productCompareCPSel AND (Measure_Date__c >=: startDate AND Measure_Date__c <=: endDate) AND Product__c =: productCompareSel1 '+
                                    'Group By Measure_Date__c ';//Order By Measure_Date__c ASC ';
        
        System.Debug('ProductCompareSelectQuery queryabc : '+query);
        
        return Database.query(query);
    }
    
    public List<AggregateResult> ProductCompareSelectQueryP2()
    {
        String query = 'Select Measure_Date__c, AVG(Missed_Appointment_Customer__c) CustMissed, AVG(Missed_Appointment_Openreach__c) openreachMissed, AVG(Missed_Appointment_Overall__c) overallMissed '+
                            'from Visual_Force_Reporting_Object__c '+
                                'Where CP_Name__c =: productCompareCPSel AND (Measure_Date__c >=: startDate AND Measure_Date__c <=: endDate) AND Product__c =: productCompareSel2 '+
                                    'Group By Measure_Date__c ';//Order By Measure_Date__c ASC ';
        
        System.Debug('ProductCompareSelectQueryP2 : '+query); 
        
        return Database.query(query);
    }
*--------------------------Constructor START----------------------*/ 
public Charts2Controller(){
/	**********************INITIALIZATION FOR PRODUCT COMPARE----(LEVEL 3)********************/
        
        PCAggrQueryResult = new List<AggregateResult>();
        PCAggrQueryResultP2 = new List<AggregateResult>();
        
        ProductCompareSummaries = new LIST<ProductCompareSummary>();
        
        productCompareSel1 = 'LLU';
        productCompareSel2 = 'LLU';
        productCompareCPSel = 'CP - 1';
        
        PCAggrQueryResult = ProductCompareSelectQuery();
        PCAggrQueryResultP2 = ProductCompareSelectQueryP2();
                
        while(size1 < PCAggrQueryResult.size() && size2 < PCAggrQueryResultP2.size())
        {
            ProductCompareSummaries.add(new ProductCompareSummary(PCAggrQueryResult[size1],PCAggrQueryResultP2[size2]));
            
            size1++;
            size2++;
        }
        
        while(size1 < PCAggrQueryResult.size()) //Here we check if more results are pending to be added to the list. If so, we add results of the first query and 0 for the other query).
        {
            ProductCompareSummaries.add(new ProductCompareSummary(PCAggrQueryResult[size1],null));
            size1++;
        }
        while(size2 < PCAggrQueryResultP2.size()) //Here we check if more results are pending to be added to the list. If so, we add results of the first query and 0 for the other query).
        {
            ProductCompareSummaries.add(new ProductCompareSummary(null,PCAggrQueryResultP2[size2]));
            size2++;
        }
        
        System.Debug('PCAggrQueryResult : '+PCAggrQueryResult.size());
        System.Debug('PCAggrQueryResultP2 : '+PCAggrQueryResultP2.size());
        System.Debug('ProductCompareSummaries : '+ProductCompareSummaries.size());
        
        size1 = size2 = 0;
}

public PageReference productCompareSubmit()
    {
        integer size1=0,size2=0;
        
        if(productCompareTimeSel == 'CM'){
            startDate = Date.newInstance(Date.Today().year(),Date.Today().month(),1);
            endDate = startDate.addDays(Date.daysInMonth(Date.Today().year(),Date.Today().month()) - 1);
        }
        else if(productCompareTimeSel == 'RM'){
            startDate = Date.Today().addDays(-Date.daysInMonth(Date.Today().year(),Date.Today().month()));
            endDate = Date.Today();
        }
        else if(productCompareTimeSel == 'CW'){
            startDate = Date.Today().toStartofWeek();
            endDate = startDate.addDays(6);
        }
        else if(productCompareTimeSel == 'RW'){
            startDate = Date.Today().addDays(-6);
            endDate = Date.Today();
        }
        
        if(ProductCompareSummaries != null)
            ProductCompareSummaries.clear();
        
        PCAggrQueryResult = ProductCompareSelectQuery();
        PCAggrQueryResultP2 = ProductCompareSelectQueryP2();
        
        while(size1 < PCAggrQueryResult.size() && size2 < PCAggrQueryResultP2.size())
        {
            ProductCompareSummaries.add(new ProductCompareSummary(PCAggrQueryResult[size1],PCAggrQueryResultP2[size2]));
            
            size1++;
            size2++;
        }
        
        while(size1 < PCAggrQueryResult.size())  //Here we check if more results are pending to be added to the list. If so, we add results of the first query and 0 for the other query).
        {
            ProductCompareSummaries.add(new ProductCompareSummary(PCAggrQueryResult[size1],null));
            size1++;
        }
        while(size2 < PCAggrQueryResultP2.size())  //Here we check if more results are pending to be added to the list. If so, we add results of the first query and 0 for the other query).
        {
            ProductCompareSummaries.add(new ProductCompareSummary(null,PCAggrQueryResultP2[size2]));
            size2++;
        }
        
        System.Debug('PCAggrQueryResult : '+PCAggrQueryResult.size());
        System.Debug('PCAggrQueryResultP2 : '+PCAggrQueryResultP2.size());
        System.Debug('ProductCompareSummaries : '+ProductCompareSummaries.size());
        
        return null;
    }



 

 

Can some one please guide me as of where i am going wrong?
Your help is much appreciated.

 

Warm Regards,

Surya

Hi friends,

 

Im having a small issue and hope you guys can help me out with it.

 

While creating a new Case, it asks to choose the record type first and then goes to the creation page.

 

I need to know how to skip the first page so that clicking on new directy goes to the creaation page.

 

Thanks :)

Dear all,

 

I am not able to get my head around this problem and is really getting worse. Could some one tell me how in salesforce can i get more than one line in a STACKED BAR (vertical) chart created for a report? 

 

i use the 'plot additional  values option' , but it only allows me to plot a single value as a line.

 

Can some one please help me out? 

 

Thanks in advance. 

Dear friends,

 

I need your urgent help on the following problem that i am currently facing. You help is greatly appreciated. 

 

At present i am not able to plot more than 2 values (lines) for a LINE GRAPH while generating a report. I need to know how to do so. Maybe i do not know how to do it or maybe salesforce does not provide the funtionality.

 

In any case, can you please tell me how to achieve that? If not is there a work around? (It has to be a line graph)

 

Many Thanks in advance.

Hi friends,

 

I need some urgent help from you guys. In the product opprotunities section i need the following to work:

 

Any change to the ‘Date’ Field in the Opportunity Product Detail, once Saved, needs to change the ‘Start Date’ in the Product Schedule automatically. And Vice versa.

 

Thanks a ton in advance guys.

 

Hi guys,

 

I am very new to SF and need some help. I din't even know where to post this query. Anyway, this is my problem.

 

Suppose i make a new tab using VF page called schools, and i have also created a custom object which has fields like (name, location, school strength etc).

 

Now i want to know how to add values into those fields using my new VF page. ie how to get the "new" button and add records and so on...

 

I know its a very basic question, but any help is deeply appreciated.

 

Regards,

Napster.  

Looking for a freelancer that can do a small visualforce and mobile job.

Must be able to submit an invoice for payment to a company in the US, and be set up as a vendor.
Hi Friends, 

I have a pressing issue i need to solve and need your help in doing so. The problem is : 

I have a visual force page which iterates over tab's and has different questions on each tab. The questions are answered via the radio buttons. Now i have radio buttons inside <apex:repeat>, and i need to get the values that they contain in my javascript so that i may make other radio buttons hidden or show up according to the value the said radio button has. 

The problem is that i cannot give a dynamic Id to the selectRadio inside <repeat> as it will only accept literals. So how can i access them? I tried getting the component via the styleclass attribute, but it returns me a html table element, which again i cant use to decide which option has been checked in the radio button list. I am posting the VF page snippet below, any help is greatly appreciated: 
 
<apex:form style="font-size: 11px;" >   
	<apex:pageBlock id="CrossSellBlock" title="Cross Sell for {!Opportunity.Opportunity__c}">
            <apex:pageMessages />
            <apex:pageBlockButtons style="font-size: 10px;" >
                <apex:commandButton value="Save" action="{!CSSave}"/>
                <apex:commandButton value="Complete" onclick="return confirm('Would you like to submit the Survey?');" action="{!CSSubmit}"/>
                <apex:commandButton value="Reset" onclick="return confirm('Are you sure you want to reset this Survey?');" action="{!CSReset}"/>      
                <apex:commandButton value="Opt Out All" />                        
                <apex:commandButton value="Return to Opportunity" onclick="return confirm('Any unsaved work will be discarded. Do you want to proceed?');" action="{!cancel}"/>            
            </apex:pageBlockButtons>
        <apex:repeat var="Op" value="{!ProductTypes}">
                <div id="tabs-{!Op.ProductType.Product_Type__r.Id}">
                        
                        <apex:outputText value="{!Op.ProductType.Rating__r.Rating_Type__c}" rendered="false"/>
                        
                        <span id = "Ratings-{!Op.ProductType.Id}">
                        <span style='font-weight: bold;color: #0B0B61;'>What is your cross sell rating?</span><p/>
                        <apex:selectRadio id="Rdo" value="{!Op.ProductType.Rating__c}" Layout="pageDirection" onclick="dynamic(this, '{!Op.ProductType.Id}', '{!Op.ProductType.Product_Type__r.Name}', '{!Op.Reasons}');" onchange="RadioItemvalue(this);" styleClass="Class-{!Op.ProductType.Id}">
                            <apex:selectOptions value="{!Op.Ratings}" / >                           
                        </apex:selectRadio></span><p/>  
                        
                        <span id="NoOpty-{!Op.ProductType.Id}" style="display: none;"><span style='font-weight: bold;color: #0B0B61;'>Please provide a "No Opportunity" reason.</span><p/>
                            <apex:selectRadio id="sr" value="{!Op.ProductType.Reason__c}" Layout="pageDirection" onchange="RadioItemvalue(this);">
                                <apex:selectOptions value="{!Op.Reasons}"/ >                            
                            </apex:selectRadio><p/></span>
                        <span id="OptOut-{!Op.ProductType.Id}" style="display: none;"><span style='font-weight: bold;color: #0B0B61;'>Please provide an "Opt Out" reason.</span><p/>
                            <apex:selectRadio value="{!Op.ProductType.Opt_Out_Reason__c}" Layout="pageDirection">
                                <apex:selectOptions value="{!Op.OptOuts}"/ >                            
                            </apex:selectRadio><p/></span>
                        <span Id="Q-{!Op.ProductType.Id}" style="display: none;">                                
                            <span style="font-weight: bold;color: #0B0B61;">Who is our primary competitor for this product?</span><p/>
                                <apex:inputField value="{!Op.ProductType.Competitor__c}" style="margin-left: 1.5em;"/><p/>                
                                    
                            <apex:repeat var="QA" value="{!Op.CrossSells}">                                                       
                                <span style="font-weight: bold;color: #0B0B61;">{!QA.CrossSell.Cross_Sell_Question__r.Name}</span><p/>
                                    <apex:selectRadio value="{!QA.CrossSell.Cross_Sell_Answer__c}" Layout="pageDirection">
                                        <apex:selectOptions value="{!QA.Options}"/ >                            
                                    </apex:selectRadio>
                            </apex:repeat>
                        </span><p/>
                       	
                       	<span id="nxtbid-{!Op.ProductType.Id}" style="display: inline;">
                       		<span style="font-weight: bold;color: #0B0B61;">Next Out to Bid Date:  </span>
                       		<apex:inputField id="StartDate" value="{!Op.ProductType.Next_out_to_bid__c}"/> <p/>
                       	</span>
                     
                     <script>if ('{!Op.ProductType.Rating__r.Name}' == 'No Opportunity'){document.getElementById("NoOpty-{!Op.ProductType.Id}").style.display = 'inline';}</script>
                    <script>if ('{!Op.ProductType.Rating__r.Name}' == 'Opt Out'){document.getElementById("OptOut-{!Op.ProductType.Id}").style.display = 'inline';}</script>                                
                    <script>if ('{!Op.ProductType.Rating__r.Name}' == "Opt Out"){document.getElementById("Q-{!Op.ProductType.Id}").style.display = 'none';}else{document.getElementById("Q-{!Op.ProductType.Id}").style.display = 'inline';}</script>
                    <script type="text/javascript">if ('{!Op.ProductType.Product_Type__r.req_nxt_tobid__c}' == "true"){document.getElementById("nxtbid-{!Op.ProductType.Id}").style.display = 'inline';}else{document.getElementById("nxtbid-{!Op.ProductType.Id}").style.display = 'none'; }</script>
                    <script>
                    	window.onload = setFocus1();
                    	function setFocus1(){
	                    	var Ratings = document.getElementsByName('{!$Component.Rdo}');
	                    	for(x = 0 ; x < Ratings.length ; x++){
	                    		if(Ratings[x].checked == true && x == 3){
	                    			document.getElementById("Q-{!Op.ProductType.Id}").style.display = 'none';
	                    			document.getElementById("OptOut-{!Op.ProductType.Id}").style.display = 'inline';
	                    		}
	                    	}
	                    }
                    </script>
                    <input id="hiddenElementId" type="hidden" />
					<script type="text/javascript">
						window.onload = setFocus
						function setFocus()
						{
						         document.getElementById("hiddenElementId").focus();
						}
					</script>
                    
                    	<script>
    function RadioItemvalue(thisp){
    var children = document.getElementById("Ratings-{!Op.ProductType.Id}").childNodes;
    for(var l = 0 ; l < children.length ; l++){ }
    var myradios1 = document.getElementsByName('{!$Component.Rdo}');
    var component = document.getElementsByClassName("Class-{!Op.ProductType.Id}");
    for(var k = 0 ; k < component.length; k++){ var rad = component[k]; alert('Length of component value :'+rad); }
    for (var i = 0, row; row = rad.rows[i]; i++) {
	   alert('Row is :'+row + ' ' + row.value);
   	for (var j = 0, col; col = row.cells[j]; j++) {
     alert('Column is :'+col + ' ' + col.value);
   		}  
	}
    alert('length of radio :'+rad.length);
    for(var i = 0; i < myradios1.length; i++){ 
    	 var someRadio = myradios1[i];
    	alert('My radios value :' +someRadio.value);
        if(someRadio.checked) {
        	alert('The checked value is :' +someRadio.checked);
        }
       }
    } 
   function dynamic(value, noOppId, ProductType, optres){
        var noOppId1 = "NoOpty-";
        var oppout1 = "OptOut-";
        var Q1 = "Q-";
        var nxtbid = "nxtbid-";
        var ProductType = ProductType;
        noOppId1 += noOppId;
        oppout1 += noOppId;
        Q1 += noOppId;
        nxtbid += noOppId;
        var searchId = value.value;
        var noOpptyResult = '{!NoOpty}'.substring(1, '{!NoOpty}'.length-1);
        var opptOutResult = '{!OptOut}'.substring(1, '{!OptOut}'.length-1);
        var QResult = '{!Q}'.substring(1, '{!Q}'.length-1);
        var lstofnoopty = noOpptyResult.split(', ');
        var lstofopptOut = opptOutResult.split(', ');
  		var lstQ = QResult.split(', ');
  		var nooptyvalues = optres;
  		for(x = 0 ; x < lstofnoopty.length ; x++){
            if(lstofnoopty[x]== searchId && (nooptyvalues == "[]")){
                document.getElementById(noOppId1).style.display = 'none'; 
                document.getElementById(oppout1).style.display = 'none';
                document.getElementById(Q1).style.display = 'inline';
            }
             else if(lstofnoopty[x]== searchId){
                document.getElementById(noOppId1).style.display = 'inline'; 
                document.getElementById(oppout1).style.display = 'none';
                document.getElementById(Q1).style.display = 'inline';
            }
        }
        for(x = 0 ; x < lstofopptOut.length ; x++){
            if(lstofopptOut[x]== searchId){
                document.getElementById(oppout1).style.display = 'inline';  
                document.getElementById(noOppId1).style.display = 'none';
                document.getElementById(Q1).style.display = 'none';
                
            }
        }
        for(x = 0 ; x < lstQ.length ; x++){
            if(lstQ[x]== searchId){
                document.getElementById(oppout1).style.display = 'none';  
                document.getElementById(noOppId1).style.display = 'none';
                document.getElementById(Q1).style.display = 'inline';
            }
        }
</script>    
                </div>
            </apex:repeat>
        </apex:pageBlock>
</apex:form>

 

Dear Friends,

 

I have a small query and was hoping you guys could help me out. It might be a very stupid question and i request you all to kindly bear with me.

 

My salesforce app, basically a case management app where all the cases are raised by the organization is connected to another application called the bridge. Whenever a case is raised at the bridge, the details are sent to salesforce through webservice calls and an XML is sent out and the same case is created at the Salesforce end.

 

This is working fine till now. But now the bridge people have a requirment, where they want to be able to input some special characters in long text field called the "Case notes". This field will again be transferred to the SF app.

 

if(BridgeCase.ListOfNotes.UserNotes != null && BridgeCase.ListOfNotes.UserNotes != '') {
            c.User_Notes__c = BridgeCase.ListOfNotes.UserNotes;//+'§'+System.now();
        }

Now the thing is that they want to encode the special characters into UTF-8 URL encoding (i don't know what it is). They were asking if salesforce will accept the special charaters in the notes field iif sent via this encoding technique?

 

If not, are there any security issues involving the same.

 

Could any of you kindly guide me about this issue?

 

Thanks a ton.

 

Napster.

Dear Friends,

 

I have a problem to which i am not able to figure out a solution since long. I am hoping you guys would be able to shed some light on this. So here goes.

 

I have a apex page which has a look-up field to a custom object called DunsID. Here's a look:

 

[IMG]http://i40.tinypic.com/2en4xsm.jpg[/IMG]

 

Now, the DUNS ID is a number which can be searched. If i just click on the magnifing glass, all the results are returned Like follows :

 

[IMG]http://i44.tinypic.com/29pbsxh.jpg[/IMG]

 

 

When i search with a string or a part of a string for DUNS ID, i get the following results as such :

 

[IMG]http://i43.tinypic.com/otewk5.jpg[/IMG]

 

But i want to be able to search by typing in the CP Name instead of the DUNS ID, like if i type in Talk* or TalkTalk, the above resuts should be returned. But when i try doing the same, no results are shown, like follows:

 

[IMG]http://i44.tinypic.com/2it0gas.jpg[/IMG]

 

Could you guys please give me a way to do so??

 

Thanks and regards,

Surya Teja

  • September 30, 2013
  • Like
  • 0

Hi friends,

 

I need help with writing CSS for drop downs as i am a total noob at CSS.

 

I need my select lists in VF pages to look exactly like the one we get in the salesforce select list at the top. (Your name)

 

Thanks in advance.

Hi friends,

 

I need some urgent help from you guys. In the product opprotunities section i need the following to work:

 

Any change to the ‘Date’ Field in the Opportunity Product Detail, once Saved, needs to change the ‘Start Date’ in the Product Schedule automatically. And Vice versa.

 

Thanks a ton in advance guys.