• jayjays
  • NEWBIE
  • 280 Points
  • Member since 2013

  • Chatter
    Feed
  • 10
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 29
    Replies

Ok.....just need a bit of help to understand what I am doing wrong.

 

I have all of the attributes I need to display this page in the left subtab sidebar of the service cloud console....I think. I am not sure why it is not showing anything. I have records that should be aggregating and they are not. Can someone tell me why?

 

Controller:

public class NS_ConsoleCaseChartController {
	
	public String strContactID;
	public String strCaseID;
	
	public NS_ConsoleCaseChartController(ApexPages.StandardController stdController){
        strCaseID = ApexPages.currentPage().getParameters().get('Id');
	}
	
	public List<ChartDataItem> getChartData()
	{
		List<ChartDataItem> items = new List<ChartDataItem>();
		
		strContactId = string.valueOf(Case.ContactId);
		
		AggregateResult[] groupedTasks = [SELECT Type, Count(Id) ID FROM Task WHERE WhoId =: strContactID GROUP BY Type];
		
		for (AggregateResult ar : groupedTasks)
		{
			items.add(new ChartDataItem( String.valueOf(ar.get('Type')), Integer.valueOf(ar.get('ID'))));
		}
		
		System.debug(items);
		return items;
	}
	
	public class ChartDataItem
	{
		public String Label {get; set;}
		public Integer Value {get; set;}
		
		public ChartDataItem(String Label, Integer Value)
		{	
			this.Label = Label;
			this.Value = Value;
		}
	}
}

 VF Page:

<apex:page standardController="Case" extensions="NS_ConsoleCaseChartController">
<apex:includeScript value="/soap/ajax/26.0/connection.js"/>
<apex:includeScript value="/support/console/26.0/integration.js"/>
<script type="text/javascript">  
  function openNewSubtab() {
      sforce.console.getFocusedPrimaryTabId(Id);
  	} 
</script>  
	<apex:chart height="195" width="250" data="{!chartData}">
        <apex:pieSeries dataField="Value" labelField="Label"/>
        <apex:legend position="bottom"/>
    </apex:chart>
</apex:page>

 I am really trying to figure out what I am missing here. I am new to developing in the Service Cloud Console.

 

 

Hi,  I have a requirement to do the following.

- In an object I have fields representating the days of the month (therefore up to 31 days).

- In a for loop I have values assigned for some days (possibly not all days of the month)

      The values have field value pairs of (daynumber, myvalue) 

 

       I need to assign the corrrect "myvalue" value to the correct field in my object which relates to the day value.

     .E.g. (10,'12.50')   should be assigned to field "Day_10_Price__c"

 

I know I can do this using a very large if statement (checking for the day and assigning it accordingly)  however this seems a bit too much or silly coding.  Does anyone know of a different way this can be achieved?  I know "Case" and "Switch" do not exist in Apex.

 

Any help or suggestions on this would be appreciated,  otherwise I assume I have to create the huge if statement.

 

Thanks in advance for your help!

 

 

Hi All,

 

I am new to salesforce, currenlty i facing an compiler error : Initial term of field expression must be a concrete SObject at bolded line. 

I'm not able to understand why i getting this error. Since i need to add KEY1__C value to the list.

kindly let me know if my usage of the code is wrong.

 

List<String> pereTechniqueParams = new List<String>();


for (String key1: [SELECT KEY1__c FROM Parameters__c WHERE TYPE__c = 'PERE_TECHNIQUE']){
pereTechniqueParams.add(key1.KEY1__c);  // Compile Error: Initial term of field expression must be a concrete SObject: String at line 30 column 41
}

 

 

Hi i need some help for my callout webservice.

 

I have created a simple webservice which pass in a string and return "Hello 'strng'" from eclipse IDE and below is the generated apex code from WSDL

 

 

//Generated by wsdl2apex

public class AxisWS {
    public class sayhello_element {
        public String Input;
        private String[] Input_type_info = new String[]{'Input','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://webapp.wtp','true','false'};
        private String[] field_order_type_info = new String[]{'Input'};
    }
    public class HelloWord {
        public String endpoint_x = 'http://192.168.0.10:8080/AxisWS/services/HelloWord';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://webapp.wtp', 'AxisWS'};
        public String sayhello(String Input) {
            AxisWS.sayhello_element request_x = new AxisWS.sayhello_element();
            AxisWS.sayhelloResponse_element response_x;
            request_x.Input = Input;
            Map<String, AxisWS.sayhelloResponse_element> response_map_x = new Map<String, AxisWS.sayhelloResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://webapp.wtp',
              'sayhello',
              'http://webapp.wtp',
              'sayhelloResponse',
              'AxisWS.sayhelloResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.sayhelloReturn;
        }
    }
    public class sayhelloResponse_element {
        public String sayhelloReturn;
        private String[] sayhelloReturn_type_info = new String[]{'sayhelloReturn','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://webapp.wtp','true','false'};
        private String[] field_order_type_info = new String[]{'sayhelloReturn'};
    }
}

 

 

 

and i have a apex class as below calling my WSDL apex:

 

public class WSContoller{ 
    public WSContoller(ApexPages.StandardController controller) {

    }

    public String getHelloName() {        
    string MyReturn;            
    AxisWS.HelloWord stub = new AxisWS.HelloWord(); 
    MyReturn = stub.sayhello('lhy');
     return MyReturn ;    
    }    
}

 

and lastly i created a Visualforce page to display the message from my webservice

 

 

<apex:page standardController="Account" extensions="WSContoller">
It will be a nice to get output from the controller<p>My webservice is now returning {!HelloName} !!
</p>
</apex:page>

 

i also setup my remote site

 

 

Remote Site Name: AxisWS *Remote Site URL: 192.168.0.10:8080

and when i open my account record i got this error

 

Content cannot be displayed: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'

 

can anyone pinpoint where seems to be the problem? im still learing APEX :)

 

thanks!

 

 

  • August 04, 2013
  • Like
  • 0

I have a visualforce page that includes an iframe. In the parent window i have a list of Icons that relate to accounts (account id) and I need to be able to hover over those icons and certain details on the account show in the iframe. Is this possible? This could also be a popout type thing, too, but preferably the details should show in the iframe.

 

I tried using the standard popout (minipagelayout) but it is not available on sites.com for non-salesforce users and eventually these pages need to be made accessible to everyone in my company.

 

I hope that made sense.

 

Thanks!

 

Here is the code I currently have using the minipage layout.

 

<apex:page StandardController="Account" extensions="ColumnControllerExt" >
<head>
    <script type="text/javascript">
// Popup window code
function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>

<style type="text/css"> 
#rowInfo,#rows{
        padding:5px;
    text-align:center;
    background-color:#FFFFFF;
    border:solid 1px #c3c3c3;
}
#rowInfo { 
    width:50px;
    display:bold; 
}
 </style>

</head>
<body>
 <apex:image value="/servlet/servlet.FileDownload?file=015e00000001X8a"/>
    <right><h1><font size="25">Any Customer, Any Employee, Any Time!</font></h1></right><br/>
    <center><font size="3"><a href="/apex/anyCustomerEmployeeTimeList">List View</a></font></center>
<table width="100%">
<tr valign="top">
<td width="70%">
        <apex:outputPanel style="width:300px" layout="block">
    <apex:variable value="{!0}" var="rowNumber" />
  <table>
 
              <tr align="center">
          <td><a href="JavaScript&colon;newPopup ('http://mc-www.mainman.dcs/dcs/main/index.cfm?event=showFile&ID=1D833C4A02E0D046BE&static=false');" >Key (WIG) RASCI</a></td>
                  
     <td><a href="#">Acitve Project RASCI</a></td>  
         <td><a href="#">Active Opportunity > $50K RASCI</a></td>  
             <td><a href="#">Partner-Managed RASCI</a></td>  
                 <td><a href="#">TAM-Managed RASCI</a></td> 
                     <td><a href="#">TSE-Managed RASCI</a></td>  
                         <td><a href="#">Inactive RASCI</a></td>  
     
     
     
     </tr>
 
      <tr>
          <apex:repeat value="{!list_of_accountmanagement}" var="col_head">
              <th id="rows">{!col_head}</th>
          </apex:repeat></tr>
      <tr>
         
                  <apex:repeat value="{!list_of_accountmanagement}" var="col_head">
              <td id="rowInfo" border="0"> 
                  
                  <apex:repeat value="{!map_values[col_head]}" var="col_val"> 
                      <a href="/{!col_val.id}" id="hover{!rowNumber}" 
                                        position="relative"
                                        onblur="LookupHoverDetail.getHover('hover{!rowNumber}').hide();" 
                                        onfocus="LookupHoverDetail.getHover('hover{!rowNumber}', '/{!col_val.id}/m?retURL=%2F{!col_val.id}&isAjaxRequest=1').show();" 
                                        onmouseout="LookupHoverDetail.getHover('hover{!rowNumber}').hide();" 
                                        onmouseover="LookupHoverDetail.getHover('hover{!rowNumber}', '/{!col_val.id}/m?retURL=%2F{!col_val.id}&isAjaxRequest=1').show();">
                      <apex:outputtext value="{!col_val.overall_status__c}" escape="false"/>
                          
                      </a>
              <!-- Increasing the value of the variable -->
            <apex:variable var="rowNumber" value="{!rowNumber + 1}" />                 
                  
                  </apex:repeat>
              </td>
          </apex:repeat>
      </tr>
  </table>
                    </apex:outputPanel>
</td>
    <td width="30%"><apex:iframe src="https://na13.salesforce.com/01Za00000016efu?isdtp=vw"/>
</td>
</tr>
</table>
</body>
</apex:page>

 

Hi,


I'm having difficulty understanding where I went wrong when creating the apex class.  I'm getting an error on line 12 - unexpected token: 'ApexPages.currentPage'.  

 

Can someone shed some light on this for me?


Thanks,

Greg

public class aseAuditPDFController
{
	public Credit__c__c getCredit()
    {
        //Retrieve Credit Application based on Id parameter of this page
        return [Select Id,
                Credit__c.Financial_Data__c,
                Credit__c.Forecast_Sales_per_Month__c,
                Credit__c.Customer_Type__c
                from Credit__c j
                where Id= 
ApexPages.currentPage().getParameters().get('id')];

    }
}

 

I have a multselect picklist in my visualforce page as the following:

 

<apex:selectList size="5" id="selectRev" value="{!selRevRange}" onchange="//doSearch();">
    <apex:selectOptions value="{!RevRange}"/>
</apex:selectList>

 

and the following code in apex to populate them:

 

public String selRevRange {get;set;}
public List<SelectOption> getRevRange() {
List<SelectOption> options = new List<SelectOption>();

options.add(new SelectOption('(AnnualRevenue >= 0 and AnnualRevenue <= 20000000)','$0-20M'));
options.add(new SelectOption('(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000)','$20-50M'));
options.add(new SelectOption('(AnnualRevenue > 50000000 and AnnualRevenue <= 100000000)','$50-100M'));
options.add(new SelectOption('(AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)','$100-500M'));
options.add(new SelectOption('(AnnualRevenue > 500000000 and AnnualRevenue <= 1000000000.00)','$500M-1B'));
options.add(new SelectOption('(AnnualRevenue > 1000000000.00 and AnnualRevenue <= 5000000000.00)','$1-5B'));
options.add(new SelectOption('(AnnualRevenue > 5000000000.00 )','$5B+'));
return options;
}

 

this works fine.   This multiselect picklist is part of a parameter search screen where I want to save the search values and then pull them up at a later time for the user.  The problem is that for the multiselect it only seems to select the optionwhen there is one value selected and saved.  If I save multiple values it won't highlight them in the box when the search record is pulled back up.

 

Here is what gets saved in the database for the picklist when 2 values are stored:

 

[(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000), (AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)]

 

another note: it works with one value if I take out the outer brackets [ ].  For multiple values I have tried replacing the comma with a semicolon ; and a few other things but I can't seem to find a delimiter that works.

 

Any thoughts?

 

Todd

 

Check box to Select All on VF Page. I am trying this but no go

 

<apex:page standardController="Listing__c"   extensions="TFNController" id="myPage" showHeader="false">
  
 
       <apex:pageMessages id="messages"/> 
 <apex:form id="myform" >

<apex:PageBlock title="TFN Provisioning for Listing :" />
<apex:PageBlock id="pageload">
  <apex:PageBlockSection columns="1" id="theSection" > 
<apex:outputPanel style="vertical-align:top" >
  <table border="1" class="list" width="100%" cellpadding="0" cellspacing="0" id="aheadertable" >
                 <tr >  
                
                  <td width="2%"  style="font-weight:bold;text-align:center;vertical-align:bottom" rowspan='2'><b>
                    <apex:inputCheckbox id="SelectAll"   onclick="selectAll()" /></b></td>
</tr>
  </table>  
            </apex:outputPanel> 
           <apex:outputPanel style="vertical-align:top" id="test">
      <apex:repeat var="TFNAffiliate" value="{!TFNVFResults}" id="TFNAffiliateId"> 
                     <table border="0" width="100%" class="list" cellpadding="0" cellspacing="0" id="atable" >
                        <tr class="row" style="persist: location;">
                            <td width="2%" style="text-align:center" >
                             <apex:inputCheckbox id="select" value="{!TFNAffiliate.selected}" styleclass="select" /> 
                           </td>
 </table> 
                   </apex:repeat>   
                   </apex:outputPanel>    
                  </apex:PageBlockSection> 
                      </apex:PageBlock>
                           </apex:form>
<script>
function selectAll()
 {
   // var listSize = {!TFNVFResults.size};
   // alert(!TFNVFResults.size);
   // var i;
     var select;
  var selectall =  document.getElementById('{!$Component.myPage.myform.pageload.theSection.selectAll}');


  //if (selectall.checked){
  alert(selectall.value);
   
 // }
for (i = 0; i < listSize; i++) {
          
      select = document.getElementById('myPage:myform:pageload:theSection:TFNAffiliateId:'+i+':select}');
      }
 alert('test'+select.value);
 }
 </script>
   
</apex:page>

 

Hi,

 

I am trying to create a custom button on the Case object which when clicked sends out an email. I need the email to be sent out to email address populated in a custom field. I will be using 2 Email templates and would like to have an If condition in my code so that it sends out an Email to one of the two custom Email fields (Test Email 1 or Test Email 2) based on the condition.

 

For example: Condition 1: When Type = Employee, and button is clicked Email has to be sent out to the Email address populated in Test Email 1 field with Email Template 1.

                         Condition 2: When Type = Contractor, and button is clicked Email has to be sent out to the Email address populated in Test Email 2 field with Email Template 2.

 

Type is a drop down field.

 

I would really appreciate if someone can give me any suggestions or share some code!

 

Thanks!

Hi everyone,

Given the following example:

I'm on record A.  I go to a related list on Record A and click NEW which takes me to a junction object.  After I save the system takes me to the View screen of the junction object.  I would like the user to be taken back to the view screen of Record A.

After doing some research on the sfdc Answers community, it seems like I need to override the Save button with a custom VF page.  Anyone have any sample code I might use?  VF is completely new to me.  Thanks!

Below is my code which sets Id of Attachment as the Key but how do I set ParentId as a Key in that Map, how do I get that?

Map<Id, Attachment> mapAtt = new Map<Id, Attachment>([Select ParentId, Id From Attachment]);

I have a table that shows icons of account statuses - when I set the VFpage to showheader=false it changes how that table is displayed (this also happens when viewing on the force.com sites even with showheader=true) - see stackexchange question since I cannot post pics here - can someone help me understand why?

 

<apex:page StandardController="Account" extensions="ColumnControllerExt" tabstyle="account">
<head>
    <script type="text/javascript">
// Popup window code
function newPopup(url) {
    popupWindow = window.open(
        url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>

<style type="text/css">
#rowInfo,#rows{
        padding:5px;
    text-align:center;
    background-color:#f8f8f8;
    border:solid 2px #236fbd;
}
#rowInfo { 
    width:50px;
    display:bold; 
}
table
{
border-collapse:collapse;
table-layout: fixed;
}	
 </style>
    <style type="text/css">
    <!--
    body {
      color:#000000;
      background-color:#FFFFFF;
	    }
    a  { color:#0000FF; }
    a:visited { color:#800080; }
    a:hover { color:#008000; }
    a:active { color:#FF0000; }
    -->
	div#wrapperHeader div#header {
 width:1000px;
 height:200px;
 margin:0 auto;
}

div#wrapperHeader div#header img {
 width:; /* the width of the logo image */
 height:; /* the height of the logo image */
 margin:0 auto;
}
    </style>
	<div id="wrapperHeader">
 <div id="header">
  <img src="https://c.na13.content.force.com/servlet/servlet.ImageServer?id=015a0000002WenZ&oid=00D3000000003Hx&lastMod=1375828250000" alt="logo" />
 
    <center><font size="3"><a href="/apex/anyCustomerEmployeeTimeList">List View</a></font></center>
        </div> 
</div>
</head>
<body>

<table width="100%">
<tr>
<td width="80%" valign="top">
        <apex:outputPanel >
            <apex:form >
                <apex:actionFunction action="{!setHoveredAccount}" name="setDetailId" reRender="accountDetail" status="detailStatus">
                    <apex:param name="detailId" value="" assignTo="{!hoveredAccount}"/>
                </apex:actionFunction>
                <table>
                     <tr align="center">
                         <td><a href="JavaScript&colon;newPopup ('http://mc-www.mainman.dcs/dcs/main/index.cfm?event=showFile&ID=1D833C4A02E0D046BE&static=false');" ><img src="/img/icon/documents24.png" title="Key (WIG) RASCI"/></a></td>
                              
                 <td><a href="#"><img src="/img/icon/documents24.png" title="Acitve Project RASCI"/></a></td>  
                     <td><a href="#"><img src="/img/icon/documents24.png" title="Active Opportunity > $50K RASCI"/></a></td>  
                         <td><a href="#"><img src="/img/icon/documents24.png" title="Partner-Managed RASCI"/></a></td>  
                             <td><a href="#"><img src="/img/icon/documents24.png" title="TAM-Managed RASCI"/></a></td> 
                                 <td><a href="#"><img src="/img/icon/documents24.png" title="TSE-Managed RASCI"/></a></td>  
                                     <td><a href="#"><img src="/img/icon/documents24.png" title="Inactive RASCI"/></a></td>  
                 
                 
                 
                 </tr>
             
                  <tr>
                      <apex:repeat value="{!list_of_accountmanagement}" var="col_head">
                          <th id="rows">{!col_head}</th>
                      </apex:repeat></tr>
                  <tr>
                     
                              <apex:repeat value="{!list_of_accountmanagement}" var="col_head">
                          <td id="rowInfo" border="0"> 
                              
                              <apex:repeat value="{!map_values[col_head]}" var="col_val">
                                  <apex:outputLink value="/apex/anycustomeremployeetimedetail?id={!col_val.id}"
                                  onfocus="setDetailId('{!col_val.id}');" 
                                  onmouseover="setDetailId('{!col_val.id}');"
                                  onblur="setDetailId('');" 
                                  onmouseout="setDetailId('');">
                                      <apex:outputText value="{!col_val.overall_status__c}" escape="false"/>
                                  </apex:outputLink>             
                              
                              </apex:repeat>
                          </td>
                      </apex:repeat>
                      </tr>
                  </table>
            </apex:form>
        </apex:outputPanel>
</td>
<td width="20%">
    <apex:actionStatus id="detailStatus">
        <apex:facet name="start">
            <div style="text-align:center;">
                <img src="/img/loading.gif" alt="Loading graphic" />&nbsp;<strong>Loading...</strong>
            </div>
        </apex:facet>
        <apex:facet name="stop">
            <apex:outputPanel id="accountDetail">
                <br/>
                <br/>
       <apex:form >
   
           
<apex:pageblock rendered="{!hoverAccount!=null}" > 
    <apex:pageblocksection columns="1" id="name">
        <apex:outputfield value="{!hoverAccount.name}"/> 
        <apex:outputfield value="{!hoverAccount.type}"/> 
        </apex:pageblocksection>
    <apex:pageblocksection columns="1" id="ka"> 
    <apex:repeat value="{!$ObjectType.Account.FieldSets.Overview}" var="ov"> 
    <apex:outputfield value="{!hoverAccount[ov]}"/> 
    </apex:repeat> </apex:pageblocksection> </apex:pageblock> 
              </apex:form> 
            </apex:outputPanel>
        </apex:facet>
    </apex:actionStatus>
    
</td>
</tr>
</table>
</body>
</apex:page>

 

Ok.....just need a bit of help to understand what I am doing wrong.

 

I have all of the attributes I need to display this page in the left subtab sidebar of the service cloud console....I think. I am not sure why it is not showing anything. I have records that should be aggregating and they are not. Can someone tell me why?

 

Controller:

public class NS_ConsoleCaseChartController {
	
	public String strContactID;
	public String strCaseID;
	
	public NS_ConsoleCaseChartController(ApexPages.StandardController stdController){
        strCaseID = ApexPages.currentPage().getParameters().get('Id');
	}
	
	public List<ChartDataItem> getChartData()
	{
		List<ChartDataItem> items = new List<ChartDataItem>();
		
		strContactId = string.valueOf(Case.ContactId);
		
		AggregateResult[] groupedTasks = [SELECT Type, Count(Id) ID FROM Task WHERE WhoId =: strContactID GROUP BY Type];
		
		for (AggregateResult ar : groupedTasks)
		{
			items.add(new ChartDataItem( String.valueOf(ar.get('Type')), Integer.valueOf(ar.get('ID'))));
		}
		
		System.debug(items);
		return items;
	}
	
	public class ChartDataItem
	{
		public String Label {get; set;}
		public Integer Value {get; set;}
		
		public ChartDataItem(String Label, Integer Value)
		{	
			this.Label = Label;
			this.Value = Value;
		}
	}
}

 VF Page:

<apex:page standardController="Case" extensions="NS_ConsoleCaseChartController">
<apex:includeScript value="/soap/ajax/26.0/connection.js"/>
<apex:includeScript value="/support/console/26.0/integration.js"/>
<script type="text/javascript">  
  function openNewSubtab() {
      sforce.console.getFocusedPrimaryTabId(Id);
  	} 
</script>  
	<apex:chart height="195" width="250" data="{!chartData}">
        <apex:pieSeries dataField="Value" labelField="Label"/>
        <apex:legend position="bottom"/>
    </apex:chart>
</apex:page>

 I am really trying to figure out what I am missing here. I am new to developing in the Service Cloud Console.

 

 

Hi,  I have a requirement to do the following.

- In an object I have fields representating the days of the month (therefore up to 31 days).

- In a for loop I have values assigned for some days (possibly not all days of the month)

      The values have field value pairs of (daynumber, myvalue) 

 

       I need to assign the corrrect "myvalue" value to the correct field in my object which relates to the day value.

     .E.g. (10,'12.50')   should be assigned to field "Day_10_Price__c"

 

I know I can do this using a very large if statement (checking for the day and assigning it accordingly)  however this seems a bit too much or silly coding.  Does anyone know of a different way this can be achieved?  I know "Case" and "Switch" do not exist in Apex.

 

Any help or suggestions on this would be appreciated,  otherwise I assume I have to create the huge if statement.

 

Thanks in advance for your help!

 

 

Hi All,

 

I am new to salesforce, currenlty i facing an compiler error : Initial term of field expression must be a concrete SObject at bolded line. 

I'm not able to understand why i getting this error. Since i need to add KEY1__C value to the list.

kindly let me know if my usage of the code is wrong.

 

List<String> pereTechniqueParams = new List<String>();


for (String key1: [SELECT KEY1__c FROM Parameters__c WHERE TYPE__c = 'PERE_TECHNIQUE']){
pereTechniqueParams.add(key1.KEY1__c);  // Compile Error: Initial term of field expression must be a concrete SObject: String at line 30 column 41
}

 

 

Hi i need some help for my callout webservice.

 

I have created a simple webservice which pass in a string and return "Hello 'strng'" from eclipse IDE and below is the generated apex code from WSDL

 

 

//Generated by wsdl2apex

public class AxisWS {
    public class sayhello_element {
        public String Input;
        private String[] Input_type_info = new String[]{'Input','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://webapp.wtp','true','false'};
        private String[] field_order_type_info = new String[]{'Input'};
    }
    public class HelloWord {
        public String endpoint_x = 'http://192.168.0.10:8080/AxisWS/services/HelloWord';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://webapp.wtp', 'AxisWS'};
        public String sayhello(String Input) {
            AxisWS.sayhello_element request_x = new AxisWS.sayhello_element();
            AxisWS.sayhelloResponse_element response_x;
            request_x.Input = Input;
            Map<String, AxisWS.sayhelloResponse_element> response_map_x = new Map<String, AxisWS.sayhelloResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://webapp.wtp',
              'sayhello',
              'http://webapp.wtp',
              'sayhelloResponse',
              'AxisWS.sayhelloResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.sayhelloReturn;
        }
    }
    public class sayhelloResponse_element {
        public String sayhelloReturn;
        private String[] sayhelloReturn_type_info = new String[]{'sayhelloReturn','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://webapp.wtp','true','false'};
        private String[] field_order_type_info = new String[]{'sayhelloReturn'};
    }
}

 

 

 

and i have a apex class as below calling my WSDL apex:

 

public class WSContoller{ 
    public WSContoller(ApexPages.StandardController controller) {

    }

    public String getHelloName() {        
    string MyReturn;            
    AxisWS.HelloWord stub = new AxisWS.HelloWord(); 
    MyReturn = stub.sayhello('lhy');
     return MyReturn ;    
    }    
}

 

and lastly i created a Visualforce page to display the message from my webservice

 

 

<apex:page standardController="Account" extensions="WSContoller">
It will be a nice to get output from the controller<p>My webservice is now returning {!HelloName} !!
</p>
</apex:page>

 

i also setup my remote site

 

 

Remote Site Name: AxisWS *Remote Site URL: 192.168.0.10:8080

and when i open my account record i got this error

 

Content cannot be displayed: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':HTML'

 

can anyone pinpoint where seems to be the problem? im still learing APEX :)

 

thanks!

 

 

  • August 04, 2013
  • Like
  • 0

How to get the Related To field value of activity in soql(this field have lot of objects including custom objects)?

 

Data Type Lookup(Contract,Campaign,Account,Opportunity,Product,Asset,Case,Solution,Asset Summary,Investor List, etc)

Investor List  is custom object.

In above data type I need to get Investor List value in soql? how to get this value in soql?

Here is my code .....i didnot pass id value from pageblocktable column (param tag) to apex class ... it gives null....value...so please help me...

 

 

<apex:page controller="approvalclass" sidebar="false">
<apex:form >
<apex:pageBlock >
<apex:pageblockTable value="{!data}" var="d">
<apex:column >
<apex:outputPanel >
<apex:commandButton action="{!approvalagent}" value="Approv">
<apex:param value="{!d.id}" name="{!passid}" assignTo="{!passid}"/>
</apex:commandButton>
<apex:commandButton action="{!rejectagent}" value="Regect">
<apex:param value="{!d.id}" assignTo="{!passid}" name="passid"/>
</apex:commandButton>
</apex:outputPanel>
</apex:column>
<apex:column value="{!d.Account__c}"/>
<apex:column value="{!d.State_Territory__c}"/>
<apex:column value="{!d.Policy_Types__c}"/>
<apex:column value="{!d.Policie_status__c}"/>
<apex:column value="{!d.State_Territory__c}"/>
<apex:column value="{!d.Commission_Rate__c}"/>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

-------------------------

class

 

 

public with sharing class approvalclass {
public string passid { get; set; }
public list<policie__c> p=new list<policie__c>();
list<policie__c> pc=new list<policie__c>();
public approvalclass(){
passid= System.currentPageReference().getParameters().get('id');
system.debug('*********************************************'+passid);  }
    public PageReference rejectagent() {
    system.debug('*********************************************'+passid);
       pc=[select id,name,Maturity_Amount__c,Commission_Rate__c,Account__c,Policie_status__c,Policy_Types__c,Premium_Amount__c,State_Territory__c from policie__c];
   for(policie__c pt:pc )
   {
     if(pt.Commission_Rate__c!=null && pt.id==passid)
     pt.Approval_status__c='Reject';
     
          upsert pt;  
    }  
      return null;
    }


    public PageReference approvalagent() {
       system.debug('*********************************************'+passid);
   pc=[select id,name,Maturity_Amount__c,Commission_Rate__c,Account__c,Policie_status__c,Policy_Types__c,Premium_Amount__c,State_Territory__c from policie__c];
   for(policie__c pts:pc)
   {
      if(pts.Commission_Rate__c!=null && pts.id==passid)
       pts.Approval_status__c='approval';
    
      upsert pts;   
    }
    
        pagereference ref = new pagereference('https://ap1.salesforce.com'+passid);
        ref.setredirect(true);
        return ref;

 
 }

    public list<policie__c>getData() {
    p=[select id,name,Maturity_Amount__c,Account__c,Policie_status__c,Policy_Types__c,Premium_Amount__c,Commission_Rate__c,State_Territory__c from policie__c where ownerid=:userinfo.getuserid()];
    
        return p;
    }



}

I have a visualforce page that includes an iframe. In the parent window i have a list of Icons that relate to accounts (account id) and I need to be able to hover over those icons and certain details on the account show in the iframe. Is this possible? This could also be a popout type thing, too, but preferably the details should show in the iframe.

 

I tried using the standard popout (minipagelayout) but it is not available on sites.com for non-salesforce users and eventually these pages need to be made accessible to everyone in my company.

 

I hope that made sense.

 

Thanks!

 

Here is the code I currently have using the minipage layout.

 

<apex:page StandardController="Account" extensions="ColumnControllerExt" >
<head>
    <script type="text/javascript">
// Popup window code
function newPopup(url) {
	popupWindow = window.open(
		url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>

<style type="text/css"> 
#rowInfo,#rows{
        padding:5px;
    text-align:center;
    background-color:#FFFFFF;
    border:solid 1px #c3c3c3;
}
#rowInfo { 
    width:50px;
    display:bold; 
}
 </style>

</head>
<body>
 <apex:image value="/servlet/servlet.FileDownload?file=015e00000001X8a"/>
    <right><h1><font size="25">Any Customer, Any Employee, Any Time!</font></h1></right><br/>
    <center><font size="3"><a href="/apex/anyCustomerEmployeeTimeList">List View</a></font></center>
<table width="100%">
<tr valign="top">
<td width="70%">
        <apex:outputPanel style="width:300px" layout="block">
    <apex:variable value="{!0}" var="rowNumber" />
  <table>
 
              <tr align="center">
          <td><a href="JavaScript&colon;newPopup ('http://mc-www.mainman.dcs/dcs/main/index.cfm?event=showFile&ID=1D833C4A02E0D046BE&static=false');" >Key (WIG) RASCI</a></td>
                  
     <td><a href="#">Acitve Project RASCI</a></td>  
         <td><a href="#">Active Opportunity > $50K RASCI</a></td>  
             <td><a href="#">Partner-Managed RASCI</a></td>  
                 <td><a href="#">TAM-Managed RASCI</a></td> 
                     <td><a href="#">TSE-Managed RASCI</a></td>  
                         <td><a href="#">Inactive RASCI</a></td>  
     
     
     
     </tr>
 
      <tr>
          <apex:repeat value="{!list_of_accountmanagement}" var="col_head">
              <th id="rows">{!col_head}</th>
          </apex:repeat></tr>
      <tr>
         
                  <apex:repeat value="{!list_of_accountmanagement}" var="col_head">
              <td id="rowInfo" border="0"> 
                  
                  <apex:repeat value="{!map_values[col_head]}" var="col_val"> 
                      <a href="/{!col_val.id}" id="hover{!rowNumber}" 
                                        position="relative"
                                        onblur="LookupHoverDetail.getHover('hover{!rowNumber}').hide();" 
                                        onfocus="LookupHoverDetail.getHover('hover{!rowNumber}', '/{!col_val.id}/m?retURL=%2F{!col_val.id}&isAjaxRequest=1').show();" 
                                        onmouseout="LookupHoverDetail.getHover('hover{!rowNumber}').hide();" 
                                        onmouseover="LookupHoverDetail.getHover('hover{!rowNumber}', '/{!col_val.id}/m?retURL=%2F{!col_val.id}&isAjaxRequest=1').show();">
                      <apex:outputtext value="{!col_val.overall_status__c}" escape="false"/>
                          
                      </a>
              <!-- Increasing the value of the variable -->
            <apex:variable var="rowNumber" value="{!rowNumber + 1}" />                 
                  
                  </apex:repeat>
              </td>
          </apex:repeat>
      </tr>
  </table>
                    </apex:outputPanel>
</td>
    <td width="30%"><apex:iframe src="https://na13.salesforce.com/01Za00000016efu?isdtp=vw"/>
</td>
</tr>
</table>
</body>
</apex:page>

 

We have a workflow that adds 7 months to our opportunity close date. The formula has been in place for a little over 2 years now. But it seems that once the resulting date is > 02/28/2014, we now get errors during conversion stating we're inserting a invalid date (I've had to turn off this workflow).

 

I've also created a stand alone formula field to test the formula and I'm getting the #Error! Message in the field.

 

Anyone else having issues with formulas that calculate past 02/28/2014 (Leap year....).

 

Formulas I've tried:

 

1.

IF(MONTH(TODAY())< 7,DATE(MONTH(TODAY())+7,DAY(TODAY()),YEAR(TODAY())),DATE(MONTH(TODAY())+7,DAY(TODAY()),YEAR(TODAY())+1))

2.

DATE(YEAR( Date_Created__c) , MONTH(Date_Created__c) + 7 , DAY(Date_Created__c) )

 

3.

IF(Month(TODAY())<7,(DATE(YEAR(TODAY()), 
MONTH(TODAY())+7,DAY(TODAY()))), 
(DATE(YEAR(TODAY()) + 1, MONTH(TODAY()) - 5,DAY(TODAY()))))

 

4.

DATE( YEAR(TODAY()) , (MONTH(TODAY()) + 7), DAY(TODAY()))

 

What does work is CreatedDate + 212 (or any number greater than 7 months) which gets us close, but doesn't meet the business requirement.

 

Thanks.

 

 

 

 

Hi,


I'm having difficulty understanding where I went wrong when creating the apex class.  I'm getting an error on line 12 - unexpected token: 'ApexPages.currentPage'.  

 

Can someone shed some light on this for me?


Thanks,

Greg

public class aseAuditPDFController
{
	public Credit__c__c getCredit()
    {
        //Retrieve Credit Application based on Id parameter of this page
        return [Select Id,
                Credit__c.Financial_Data__c,
                Credit__c.Forecast_Sales_per_Month__c,
                Credit__c.Customer_Type__c
                from Credit__c j
                where Id= 
ApexPages.currentPage().getParameters().get('id')];

    }
}

 

I have a multselect picklist in my visualforce page as the following:

 

<apex:selectList size="5" id="selectRev" value="{!selRevRange}" onchange="//doSearch();">
    <apex:selectOptions value="{!RevRange}"/>
</apex:selectList>

 

and the following code in apex to populate them:

 

public String selRevRange {get;set;}
public List<SelectOption> getRevRange() {
List<SelectOption> options = new List<SelectOption>();

options.add(new SelectOption('(AnnualRevenue >= 0 and AnnualRevenue <= 20000000)','$0-20M'));
options.add(new SelectOption('(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000)','$20-50M'));
options.add(new SelectOption('(AnnualRevenue > 50000000 and AnnualRevenue <= 100000000)','$50-100M'));
options.add(new SelectOption('(AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)','$100-500M'));
options.add(new SelectOption('(AnnualRevenue > 500000000 and AnnualRevenue <= 1000000000.00)','$500M-1B'));
options.add(new SelectOption('(AnnualRevenue > 1000000000.00 and AnnualRevenue <= 5000000000.00)','$1-5B'));
options.add(new SelectOption('(AnnualRevenue > 5000000000.00 )','$5B+'));
return options;
}

 

this works fine.   This multiselect picklist is part of a parameter search screen where I want to save the search values and then pull them up at a later time for the user.  The problem is that for the multiselect it only seems to select the optionwhen there is one value selected and saved.  If I save multiple values it won't highlight them in the box when the search record is pulled back up.

 

Here is what gets saved in the database for the picklist when 2 values are stored:

 

[(AnnualRevenue > 20000000 and AnnualRevenue <= 50000000), (AnnualRevenue > 100000000 and AnnualRevenue <= 500000000)]

 

another note: it works with one value if I take out the outer brackets [ ].  For multiple values I have tried replacing the comma with a semicolon ; and a few other things but I can't seem to find a delimiter that works.

 

Any thoughts?

 

Todd

 

Hi,

 

I am trying to create a custom button on the Case object which when clicked sends out an email. I need the email to be sent out to email address populated in a custom field. I will be using 2 Email templates and would like to have an If condition in my code so that it sends out an Email to one of the two custom Email fields (Test Email 1 or Test Email 2) based on the condition.

 

For example: Condition 1: When Type = Employee, and button is clicked Email has to be sent out to the Email address populated in Test Email 1 field with Email Template 1.

                         Condition 2: When Type = Contractor, and button is clicked Email has to be sent out to the Email address populated in Test Email 2 field with Email Template 2.

 

Type is a drop down field.

 

I would really appreciate if someone can give me any suggestions or share some code!

 

Thanks!