• lane_cwe
  • NEWBIE
  • 10 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 8
    Replies

I created a VF page (23.0 API version) with 2 dependent picklists. If showHeader property is false in apex:page, the dependent picklist value is not set in controller when Search button is clicked. However if showHeader property is true, I do not have this problem. Does anyone come across this problem before? Any suggestion or alternative methods? I prefer not to display the Salesforce header in the page. I have simplified the code as below:-

 

<apex:page controller="testController" sidebar="false" showHeader="false" >
<apex:form >
<apex:actionFunction name="setType" rerender="type"/>
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlockSection columns="1" title="Search Option">
<apex:pageBlockSectionItem >
	    <apex:outputLabel value="Product" />
		<apex:selectList size="1" value="{!productFilter}" onchange="setType();">
			<apex:selectOption itemLabel="-All-" itemValue="" />
            <apex:selectOptions value="{!productList}"/>
        </apex:selectList>
 </apex:pageBlockSectionItem>
 <apex:pageBlockSectionItem >
        <apex:outputLabel value="Type" />
        <apex:selectList size="1" value="{!typeFilter}" id="type">
        	<apex:selectOption itemLabel="-All-" itemValue="" />
            <apex:selectOptions value="{!typeList}"/>
       	</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

<apex:pageBlockButtons location="bottom">
	<apex:commandButton value="Search" action="{!doSearch}" rerender="valueInController"/>     
</apex:pageBlockButtons>	
</apex:pageBlock>

<apex:pageBlock id="valueInController">
<apex:pageBlockSection columns="1">
<apex:outputText value="Product:{!productFilter}"/>
<apex:outputText value="Type:{!typeFilter}"/>
</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

public class testController {
	public String productFilter {get;set;}
  	public String typeFilter {get;set;}
  	
  	private static Map<String,List<String>> dependentMap = new Map<String,List<String>>();
	static {
		dependentMap.put('Alphabet',new List<String>{'A','B','C'});
		dependentMap.put('Number',new List<String>{'1','2','3','4','5'});
		dependentMap.put('Symbol',new List<String>{'%','$','#'});
	}
	
  	public testController() {	
  	} 

    
    public List<SelectOption> getProductList() {
    	List<SelectOption> productList = new List<SelectOption>();
    	productList.add(new SelectOption('Alphabet','Alphabet'));
    	productList.add(new SelectOption('Number','Number'));
    	productList.add(new SelectOption('Symbol','Symbol'));
  		return productList;
  	}
  	
  	public List<SelectOption> getTypeList(){
    	List<SelectOption> typeList = new List<SelectOption>();
    	if (dependentMap.containsKey(productFilter)){
	  		for (String option : dependentMap.get(productFilter)){
	  			typeList.add(new SelectOption(option, option));
	  		}
    	}
    	return typeList;
    }
    
    public PageReference doSearch(){
    	return null;
    }
}

 



We are integrating Salesforce.com CRM with a .NET application. As of now, the integration is working on http protocols on the web-service endpoint. Now, we need to secure the web-service i.e. convert the http into https protocols, using the CA signed certificate approach. We have generated the CSR from SFDC, and have it CA signed and uploaded back to the SFDC certificate management store. However, the .NET team will not be able to host this certificate on their list of trusted identities at the IIS level without the private key. I read on SFDC documentation that even if we export the SFDC certificate, the private key cannot be seen/exported. So now the situation is that in IIS we are not able to host the certificate at all. Request for to help with approaches to resolve the issue.....

I created a VF page (23.0 API version) with 2 dependent picklists. If showHeader property is false in apex:page, the dependent picklist value is not set in controller when Search button is clicked. However if showHeader property is true, I do not have this problem. Does anyone come across this problem before? Any suggestion or alternative methods? I prefer not to display the Salesforce header in the page. I have simplified the code as below:-

 

<apex:page controller="testController" sidebar="false" showHeader="false" >
<apex:form >
<apex:actionFunction name="setType" rerender="type"/>
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlockSection columns="1" title="Search Option">
<apex:pageBlockSectionItem >
	    <apex:outputLabel value="Product" />
		<apex:selectList size="1" value="{!productFilter}" onchange="setType();">
			<apex:selectOption itemLabel="-All-" itemValue="" />
            <apex:selectOptions value="{!productList}"/>
        </apex:selectList>
 </apex:pageBlockSectionItem>
 <apex:pageBlockSectionItem >
        <apex:outputLabel value="Type" />
        <apex:selectList size="1" value="{!typeFilter}" id="type">
        	<apex:selectOption itemLabel="-All-" itemValue="" />
            <apex:selectOptions value="{!typeList}"/>
       	</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

<apex:pageBlockButtons location="bottom">
	<apex:commandButton value="Search" action="{!doSearch}" rerender="valueInController"/>     
</apex:pageBlockButtons>	
</apex:pageBlock>

<apex:pageBlock id="valueInController">
<apex:pageBlockSection columns="1">
<apex:outputText value="Product:{!productFilter}"/>
<apex:outputText value="Type:{!typeFilter}"/>
</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>

 

public class testController {
	public String productFilter {get;set;}
  	public String typeFilter {get;set;}
  	
  	private static Map<String,List<String>> dependentMap = new Map<String,List<String>>();
	static {
		dependentMap.put('Alphabet',new List<String>{'A','B','C'});
		dependentMap.put('Number',new List<String>{'1','2','3','4','5'});
		dependentMap.put('Symbol',new List<String>{'%','$','#'});
	}
	
  	public testController() {	
  	} 

    
    public List<SelectOption> getProductList() {
    	List<SelectOption> productList = new List<SelectOption>();
    	productList.add(new SelectOption('Alphabet','Alphabet'));
    	productList.add(new SelectOption('Number','Number'));
    	productList.add(new SelectOption('Symbol','Symbol'));
  		return productList;
  	}
  	
  	public List<SelectOption> getTypeList(){
    	List<SelectOption> typeList = new List<SelectOption>();
    	if (dependentMap.containsKey(productFilter)){
	  		for (String option : dependentMap.get(productFilter)){
	  			typeList.add(new SelectOption(option, option));
	  		}
    	}
    	return typeList;
    }
    
    public PageReference doSearch(){
    	return null;
    }
}

 



Hello,

 

I'm trying to add a batch to an existing job using the Bulk API from C#.  I've created the job and can get info on it, but am running into a problem when attempting to add a batch of data to it.

 

Here's the code.  The problem is that at run time the call to this line never returns:

Stream datastream = request.GetRequestStream();

 

This only happens when the url on the request includes the "batch" at the end (see first line of code).  The JobID parameter is valid, is an open job, and works in a separate call to get info.

 

Does anyone know what the problem might be?

 

            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("https://na12-api.salesforce.com/services/async/23.0/job/" + JobID + "/batch");
            request.Method = WebRequestMethods.Http.Post;
            request.ContentType = "application/xml; charset=UTF-8";
            request.Headers.Add("X-SFDC-Session", _SessionID);
            request.KeepAlive = false;
            request.Host = "na12.salesforce.com";
            request.UserAgent = ".NET Framework Test Client";
            request.Accept = "application/xml";

            string body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ";
            body += "<sObjects xmlns=\"http://www.force.com/2009/06/asyncapi/dataload\">";
            body += "  <sObject>";
            body += "    <description>Created from Bulk API on Wed Jan 4 2012</description>";
            body += "    <name>[Bulk API] Account 0 (batch 0)</name>";
            body += "  </sObject>";
            body += "  <sObject>";
            body += "    <description>Created from Bulk API on Wed Jan 4 2012</description>";
            body += "    <name>[Bulk API] Account 1 (batch 0)</name>";
            body += "  </sObject>";
            body += "</sObjects>";

            //Convert the body of request into a byte array
            byte[] byteArray = Encoding.UTF8.GetBytes(body);

            //Set the length
            request.ContentLength = byteArray.Length;

            //Write the body to the request by using a datastream
            //This line never returns....
            Stream datastream = request.GetRequestStream();
            datastream.Write(byteArray, 0, byteArray.Length);
            datastream.Close();

            //Call the service and get the response as a data stream
            WebResponse response = request.GetResponse();
            datastream = response.GetResponseStream();
            StreamReader reader = new StreamReader(datastream);
            string responseFromServer = reader.ReadToEnd();

            response.Close();

 

 

 

Does anyone know how to use Bulk API in C#?

the Web Service API can only update max 200 records at once.

Bulk API can update 10,000 records at once.

I only find sample code using Java.

Thanks.

 

  • October 27, 2010
  • Like
  • 0

Hello All,

I want to setup "indicator" fields on the Case object that indicate NEW Case Comments or Emails exist on a Case. The idea is that when a support rep clicks on the Cases tab to view a list of cases they own, there will be 'New Comment' and 'New Email' columns that have a visual indicator next to each case that indicate there are new Comments or Emails on the Case. The indicator could be a checkbox, or a colored dot, or something similar.

Salesforce appears to have this functionality built-in to some degree:

- For Case Comments, when a new comment is added to a Case through the Self-Service portal or Customer Portal,  there will be an icon at the top of the Case (next to the Case Number heading) that indicates there is a new comment on the case. See below image  - new-comment-email.gif - for example. When a Case Owner views the case, this icon goes away - I have to assume that the act of viewing the case changed the "status" of the comment to make the icon go away.

- For Emails, with email-to-case enabled, when a new email is received and associated with a Case, the email in the Emails related list has a Status of "New". See below image - new-comment-email.gif - for example. When the Case Owner views the email, the Status changes from "New" to "Read". The act of viewing the email has changed the Status value of the email.

I would like to leverage this functionality are create custom Case field "indicators" that I can put on list views. For Case Comments, I would like for the indicator to show new Case Comments made by ANY person, not just Self-Service/Customer Portal users.

Does anyone know how I would acheive this? How can I build a field that indicates the existence of New Case Comments or Emails on Cases?

Any details or advice that you can provide would be greatly appreciated.

Thanks,

-- Rob 

new-comment-email.gif