• Superfell
  • ALL STAR
  • 34114 Points
  • Member since 2004


  • Chatter
    Feed
  • 675
    Best Answers
  • 22
    Likes Received
  • 0
    Likes Given
  • 36
    Questions
  • 8048
    Replies
I'm having issue creating a task via REST API and need some help as to point out what I may be doing wrong. My code is the following:

public class SalesForceEvent
{
    public SalesForceAccount Account { get; set; }
    public string Id { get; set; }
    public string AccountId { get; set; }
    public string OwnerId { get; set; }
    public string Subject { get; set; }
    public string Type { get; set; }
    public string Description { get; set; }
    public string Status { get; set; }
    public string ActivityDate { get; set; }
    public bool IsClosed { get; set; }
    public bool IsDeleted { get; set; }
    public string Priority { get; set; }
    public string WhoId { get; set; }
    public string WhatId { get; set; }

}

var uri = serviceUrl + "/services/data/v20.0/sobjects/Account/task/";

var task = new SalesForceEvent();
task.OwnerId = "XXXXXXXXX";
task.Account = acct;
task.ActivityDate = DateTime.Now.ToString();
task.Subject = "Call";
task.Type = "Call";
task.Status = "Completed";
task.Description = " A Call for this new task";
task.IsClosed = true;
task.Priority = "Normal";
task.WhoId = "";
task.WhatId = "XXXXXXXXX";


var ser = new JavaScriptSerializer();
var body = ser.Serialize(task);

var req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri);
req.Headers.Add("Authorization: OAuth " + SFHelper.SalesForceToken.access_token);
req.ContentType = "application/json";
req.Method = "POST";

byte[] data = System.Text.Encoding.ASCII.GetBytes(body);
req.ContentLength = body.Length;
var os = req.GetRequestStream();
os.Write(data, 0, data.Length);
os.Close();

WebResponse resp;

try
{
    resp = req.GetResponse();
}
catch (WebException ex)
{
    resp = ex.Response;
}

if (resp != null)
{
    HtmlGenericControl hgc = new HtmlGenericControl();
    StringBuilder sb = new StringBuilder();

    System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
    sb.Append(sr.ReadToEnd().Trim());

    hgc.InnerHtml = sb.ToString();
    plcResults.Controls.Add(hgc);

}

When making the call I get the following error message:

[{"errorCode":"NOT_FOUND","message":"Provided external ID field does not exist or is not accessible: task"}]

Any assistance is greatly appreciated.
I have the following code:

User userupdate = new User();
userupdate.Id = "005G0000003VyQuIAK"; // this is a legit ID, I checked
userupdate.IsActive = false;
binding.update(new sObject[] {userupdate}); // binding is my active connection to SFDC, and allows me to perform other actions no problem

But the user Active field is not updating. Am I missing something?

Regards,
James
I'm after a recent working example (code) that I can prototype in VBScript and then pass onto my client, who needs to make a targeted change to a legacy VB6 app to make a real-time query against a Contact record in Salesforce.  The query is currently against a SQL DB that is not part of the legacy app, but will be migrated to salesforce.com.

The code I'm using (below), fails on when trying to parse the response (e.parse t)
--> Error during parsing, no element found at line 1
--> Code: 80044240, PocketSOAP.Envelope.11:

This article (https://developer.salesforce.com/forums/ForumsMain?id=906F00000008rMBIAY) from 2004 with replies from the PocketSOAP creator @Superfell is useful, but doesn't quite have a full example.

' PocketSOAP calling SOAP API / Partner WSDL

dim e
set e = CreateObject("PocketSOAP.Envelope.2")
' CLSID: {E2E0FB24-E58F-458f-84E0-6E09D2D51511}

e.EncodingStyle = ""
e.SetMethod "login", "urn:enterprise.soap.sforce.com"
'e.URI = "urn:enterprise.soap.sforce.com"

e.Parameters.Create "username", "sfdcuser@org.com", "urn:login"
e.Parameters.Create "password", "pwd+token", "urn:login"

' CLSID: {C7899023-E487-4268-AE2A-4EC50136DAB3}
'set mgr = CreateObject("pocketSOAP.Attachments")
'mgr.Format = formatMime

' CLSID: {D76BA06F-ABF3-4c1f-BDC9-1848D4E3CF2B}
dim t
set t = CreateObject("PocketSOAP.HTTPTransport.2")
t.SOAPAction = ""

t.Send "https://test.salesforce.com/services/Soap/u/29.0/", e.serialize

wscript.echo e.serialize

e.parse t ' <--- fails here with 'Error during parsing, no element found at line 1
' Code: 80044240, PocketSOAP.Envelope.11

wscript.echo "debug = " & e.parameters.item(0).Value

Am implementing outbound messaging in a .Net web application.  Am sending in the ID only.  Receive an acknowledgment back and everything is working to that point. 

The next step is to to re-access Salesforce.  Multiple posts say that with the session id passed through the outbound message you can get back to Salesrooms without logging in again.

 

Does anyone have an example of code for that?  Have been trying to use the SforceService but it appears that you MUST log in with credentails. 

Trapdoor is awesome but I do have some things that I wish I could control or fix.

 

1.) Duplicate URL.

I entered a URL into my list of servers as http://www.salesforce.com/login and then again as http://www.salesforce.com/login/

Trapdoor lists these as 2 distinct servers but if I delete one in order to correct it, Trapdoor deletes the other server in the list too.

I wish I could manually edit the list of servers and login details so that I could correct my typo.

 

2.) Sorting

I see that there is a "sort by alias" option but I don't see this working as expected.

If I had access to the list of servers ( see 1 above ) I would be happy to manually edit and order my servers.

 

Thanks !!

Hi,

 

I am trying to communicate with a webservice hosted in one of the sandbox Org.s using SOAPUI(desktop tool). This tool gives me the below request structure

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sl="http://soap.sforce.com/schemas/class/XXXXXXXXXXXXXXXX">
   <soapenv:Header>
      <sl:AllowFieldTruncationHeader>
         <sl:allowFieldTruncation></sl:allowFieldTruncation>
      </sl:AllowFieldTruncationHeader>
      <sl:DebuggingHeader>
         <!--Zero or more repetitions:-->
         <sl:categories>
            <sl:category></sl:category>
            <sl:level></sl:level>
         </sl:categories>
         <sl:debugLevel></sl:debugLevel>
      </sl:DebuggingHeader>
      <sl:CallOptions>
         <sl:client></sl:client>
      </sl:CallOptions>
      <sl:SessionHeader>
         <sl:sessionId>XXXXXXXXXXX!AQgAQDClDsbFptrQ5zWifnhNyIf2WI4HwvF49kZbOUr7Y59MTSPnUZCuHUULR7T8gbIs239c9Df0yXg5PYsUl.ixIuRqA4ji</sl:sessionId>
      </sl:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <sl:updateAssetRecords>
         <!--Zero or more repetitions:-->
         <sl:Asset_Utilization>
            <!--Optional:-->
            <sl:Fusion_Id>12345</sl:Fusion_Id>
            <!--Optional:-->
            <sl:Product_SKU>12345</sl:Product_SKU>
            <!--Optional:-->
            <sl:UtilizationBucket1>12345</sl:UtilizationBucket1>
            <!--Optional:-->
            <sl:UtilizationBucket2>12345</sl:UtilizationBucket2>
            <!--Optional:-->
            <sl:UtilizationBucket3>12345</sl:UtilizationBucket3>
            <!--Optional:-->
            <sl:UtilizationBucket4>12345</sl:UtilizationBucket4>
            <!--Optional:-->
            <sl:UtilizationBucket5>12345</sl:UtilizationBucket5>
            <!--Optional:-->
            <sl:UtilizationBucket6>12345</sl:UtilizationBucket6>
            <!--Optional:-->
            <sl:UtilizationDescription>12345</sl:UtilizationDescription>
         </sl:Asset_Utilization>
      </sl:updateAssetRecords>
   </soapenv:Body>
</soapenv:Envelope>

When I am submitting the above request it returns me the below response with Error message in it.

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Client</faultcode>
         <faultstring>'' is not valid for type xsd:boolean, should be '0', '1', 'true' or 'false'</faultstring>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>

 

Can someone please help me to resolve the error?

 

 

Hi,

 

How many different ways to integrate .net with salesforce?

 

I tried using enterprice.wsdl. I was able to connect with salesforce but there are some problems using enterprise.wsdl

1. we need to get enterprise.wsdl if we need to use this code with other environment (i.e. if we have used sandbox during development and then we need to use that code with production)

2. every time we need to get latest enterprice.wsdl if we make changes to salesforce metadata.

 

I want to make it dynamic like java. I have integrated salesforce with java and it was dynamic (using parner.wsdl). But I donot have idea for .net.

 

Any one provide me sample code?

Hello,

 

I try to generate Apex classes from WSDL file but I get this error : Apex Generation Failed Unable to find schema for element; {http://tempuri.org/}GetConsumerOrdersResponse

 

I don't understand why but I think the problem is about namespace?

 

This is my WSDL file : http://www.petit-fichier.fr/2013/11/14/test3/ (too large for this forum)

 

 

Thanks to people who will help me.

Hello, after calling login() and try making a call, say query(), I get the following error:

 

exceptionMessage='Destination URL not reset. The URL returned from login must be set in the SforceService'

 

According to the SOAP API documentation for login() it says the following:

 

After logging in, a client application needs to perform these tasks:

  • Set the session ID in the SOAP header so that the API can validate subsequent requests for this session.
  • Specify the server URL as the target for subsequent service requests. You must change to the server URL, the login server only supports login calls.

How is this done when using the force.com WSC?  All the examples I've seen set the username and password in the ConnectorConfig.  I see there's a setSessionHeader() in PartnerConnection but I don't see any method to set the server url. 

 

Can someone point me in the right direction?

 

 

 

  • November 06, 2013
  • Like
  • 0

I have written a webservice in .net that receive the outbound message from salesforce. With the Id received from the Salesforce outbound message, I want to query the related objects and its fields. Can I achieve this without salesforce authentication? With the session id I get from outbound message can I query the objects? I am confused. Please help me out. 

  • November 06, 2013
  • Like
  • 0

Hi,

 

I'm having trouble configuring my Visual Studio project with SOAP.

 

I have downloaded two WSDLs and added them as Service Reference. The contents then show up under a new namespace in the project, and I see a bunch of subclasses, however, I don't see the SforceService class that is mentioned in the Quick Start guide:

 

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_quickstart_steps.htm#topic-title

 

What class should I use as the binding class?


Regards,

James

Just ran into a very confusing error.
We have an application which makes API calls to Salesforce - specifically a POST method which uploads cases . This is working fine sandbox environment. But I get Internal server error in production.

I have everything similar in sandbox and production and is very weird to get this error.

 

Any pointers??

I'm trying to follow the example of how to authenticate via REST in the following link however what is shown in the example does not match what I find in my account.

http://wiki.developerforce.com/page/Consuming_Force.com_SOAP_and_REST_Web_Services_from_.NET_Applications

 

When I go to Remote Access under Develop it gives me the following message.

 

"Remote Access Objects have been moved to Applications. You'll be redirected to that page in five seconds, or you can click Take Me There to go now. "

 

Then when it goes there I don't see any information on acquiring app key and secret key.

Hi guys,

 

I have a very strange problem with a custom DateTime field. When I write any date+time value, the date will write correctly but the time portion will always be written at 01:00:00 For example the java Date object contains 2013-09-24T15:53:27.000Z (as confirmed by a trace output statement) then when the field is written to Salesforce it will display as "24/09/2013 01:00". Fields are being written in the usual way:

 

javaDate=new Date();

SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
String strFormattedDate = sdf.format(javaDate);

System.out.println("javaDate="+strFormattedDate);

 

SObject[] records=new SObject[0];

records[0].setType("CustomTable__c");

records[0].setField("DateCreated__c", javaDate);

saveResults = conn.create(records);

 

Any idea why this is happening? Is it something about my custom Date/Time field "DateCreated__c" ???

 

Thanks,

Mark.

I have downloaded MailDrop from the company page but when I try to install it on my Mac the error message appears "Maildrop can't be opened because it is from an unidentified developer".   My security is set to allow installation of only apps from the Mac App Store and identified developers, and I don't particularly want to change this (even if I knew how). What should I do? 

  • September 19, 2013
  • Like
  • 0

Hi,

 

I am trying to download attachments from Salesforce to upload it to Sharepoint. The issue I am facing is that, the download works fine with attachments like .txt file etc, but for Word or Excel documents gives an error when trying to open the document "the document cannot be opened because there are problems with the contents". 

 

I am doing this via c# REST api. 

 

//example of word doc retrieval
string bodyData = HttpGet(token.instance_url + "/services/data/v28.0/sobjects/Attachment/00Pi0000001UMXa/Body", "");
byte[] encData_byte = System.Text.Encoding.UTF8.GetBytes(bodyData);
File.WriteAllBytes(@"c:\yourfile.docx", encData_byte);

 

From SF documents I understood that the string returned by querying the attachment is Base64Encoded. So in the code you need to ConvertFromBase64. But when I tried to convert the string using Convert.ToBase64String, it always gave an error saying "System.FormatException : Invalid character"

 

Have anyone faced something similar?

 

Cheers,

Ashwin

 

I implemented Oauth 2.0 means using WebClient in C# to send GET and POST messages directly to Salesforce.

 

For those unfamilar with Oauth, maybe seeing my code samples will help them if I outline the steps in c# type syntax.

Maybe someone who know's a lot about configuring Salesforce will be able to tell me if they see something I'm doing wrong, at least I hope...

 

String oauth_scope = "refresh_token api full chatter_api id";

 

String url = String.Format( "{0}?client_id={1}&redirect_uri={2}&response_type=code&scope={3}", "https://login.salesforce.com/services/oauth2/authorize?", _consumerKey_web_app, nextanalytics.MyString.UrlEncode( SALESFORCE_REDIRECTS_TO_THIS_URL_AFTER_URL_AUTH ), nextanalytics.MyString.UrlEncode( oauth_scope ) ); HttpWebRequest myRequest = (HttpWebRequest) WebRequest.Create( url );;

 

 

 

This comes back fine. I get back a URL to my embedded browser with a code=VALUE on it.

I POST a response back to salesforce (again using WebClient.

 

WebClient client = new WebClient();
#if ! MONO
client.Proxy.Credentials = CredentialCache.DefaultCredentials;
#endif
try
{
NameValueCollection values = new NameValueCollection();
values.Add( "client_id", _consumerKey_web_app );
values.Add( "client_secret", _consumerSecret_web_app_offline );
values.Add( "grant_type", "authorization_code" );
values.Add( "redirect_uri", SALESFORCE_REDIRECTS_TO_THIS_URL_AFTER_URL_AUTH );
values.Add( "code", authorization_code );
Byte[] responseBytes = client.UploadValues( URL_TOKEN_ENDPOINT_SECOND, values );
String errMsg = parse_result_from_token_endpoint( Encoding.UTF8.GetString( responseBytes ) );

 

The parse_result function is just something I wrote that does the following:

HandlerForJSON parsed = new HandlerForJSON();
System.Collections.Hashtable hashtable = (System.Collections.Hashtable) parsed.JsonDecode( response );
short_lived_access_token = (String) parsed.hashtable["access_token"];
refresh_token = (String) parsed.hashtable["refresh_token"];
instance_url = (String) parsed.hashtable["instance_url"]; 
issued_at_num_secs_since_unix_epoc = (String) parsed.hashtable["issued_at"];

 

All my values look correct.

The refresh_token seems correct, and so does the short_lived_access_token. The instance_url is used (by me) to build other method calls. For example, I can submit this:

 

String new_url = instance_url + "/services/data/" + "?access_token=xyz..."

 

I get back a nice json string that is an array of versions, as documented.

I pick the the last one in the array, thinking it's going to be the most recent version.

With this dynamic "version" information, I'm supposed to be able construct a web url that looks like this:

 

"https://na11.salesforce.com/services/data/v28.0/"

 

From what I understand, if I submit that, with an un-expired access_token, it should give me back my "Resources" which would hypothetically look like:

{
"sobjects" : "/services/data/v28.0/sobjects",
"search" : "/services/data/v28.0/search",
"query" : "/services/data/v28.0/query",
"recent" : "/services/data/v28.0/recent"
}

 

But my problem is that I always get back an error 401 Unauthorized unless it the first call to get the version(s) 

 

With OAuth, 401 is often the error you get when your access_token expires and it's time to use the refresh_token. But my problem is that the access_token had just been issued, and used a split second earlier, so expiry is not likely the problem.  

 

I suspect it's something more fundamental, something about the configuration. Basically, I don't understand why I can query the versions but it fails on the immediate next call to get the Resources.

 

At first, I thought to look carefully at the scope(s) I was using.

String oauth_scope = "refresh_token api full chatter_api id"; 

I've tried different combinations and nothing seems to help.

 

I've double checked, and those scopes do match what I chose for the "connected App" that I created on the server. 

 

I also wondered if there is some security setting I'm supposed to do in the User Setup, App Setup, or Administration Setup. When I look, I can't see anything...

 

I'm stuck on this. I'm sure you know the feeling. Anyone out there knows how to get a connectedApp that uses Oauth 2.0 to be able to issue GET calls to various methods, more than just getting which instance_url to use?

 

 

 

  • August 02, 2013
  • Like
  • 0

IS there a way to change to a different case queue in Maildrop? I have multiple service console app with different queues and need them to go into their proper queues. Thanks

  • June 27, 2013
  • Like
  • 0

Now that LoginHistory object is exposed via API I was trying that out and I am running into a problem related to Auth. I am using REST API as per instr given at http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#StartTopic=Content/quickstart.ht...

 

I am able to do everything for the Account object as listed in there but when I try to access access LoginHistory object, it throws up an error that the resource does not exsist. I have given FULL scope for the connected app I created.

 

The command I am using is  curl https://na15.salesforce.com/services/data/v20.0/sobjects/LoginHistory -H 'Authorization: Bearer access_token' -H "X-PrettyPrint:1" with access_token replaced with the my own access_token/session id. I am getting the following response, 

 

{
"message" : "The requested resource does not exist",
"errorCode" : "NOT_FOUND"
}

 

PS: I am using a developer edition account 

 

Any inputs?

Hi Everyone,

I know its so easy in APEX code, but I am writing a native Android Java app, and I want to do a query that returns a custom object (Retail_Stores) where the current user is the owner of that object.  I am not sure how to reference the current user or get his id.  Any help is greatly appreciated.  Here is what my current query looks like.

String sfRequest = "SELECT Name, Id, Lat__c, Long__c, Address_1__c, City__c, State__c, Phone__c, Retailer_Store_Type__c, Field_Team_Tier__c FROM Retail_Store__c  WHERE (Retail_Store__c.Owner= :UserInfo.getUserId())  LIMIT "+maxNumStores;

 

Thanks for your consideration and help.

remember to turn attachments back on in the maildrop preferences.

I just posted a new build of Maildrop that has a work around for the error with attachments on Lion Mail. (do check for updates from the menu)

 

To recap the story so far:

1. There is a bug in the version of Mail provided in OSX 10.7 (aka Lion) that causes an error when you try and access an attachment via applescript, the error shows in maildrop when you try and add an email that contains an attachment.

 

2. The new build will skip all attachments applescript operations if you turn off attachments in the maildrop preferences, This will allow you to add emails as normal, but not any attachments.

 

3. When apple releases a fix for the applescript problem, you can re-enable attachments in the preferences and be back to normal. (there is a bug logged with Apple on this, i will post updates when i get them to the issue tracker)

 

4. When you start the new version of Maildrop on Lion, there will be a window with this information as well.

 

 

I build a OSX native demo client for the streaming API so that you can quickly try it out and see it in action.

 

http://www.pocketsoap.com/osx/streamer/

 

Source is available on Github  https://github.com/superfell/StreamingApiDemo

Someone asked  a question about getDeleted, which i accidentally deleted, sorry.

 

The answer is that you'll need to still use the soap api to call getDeleted.

For everyone that's testing stuff with the command line, check out jsawk, this allows you to parse & process json from the command line. (If you're on a Mac, you can get the spidermonkey dependency via macports)

 

I have this script to get me an oauth token via the username password flow

 

 

curl https://login.salesforce.com/services/oauth2/token -d grant_type=password -d client_id=myClientId -d client_secret=mySecret -d username=foo@example.com -d password=myPassword  -# | ./jsawk "return this.access_token"

 This uses jsawk to extract the access_token value from the response json, using the shell's ` operator, its easy to stick this in a shell variable,

 

export SFDC_SID=`./login.sh`

You can then easily refer to your token when making curl calls to the rest API, e.g.

 

curl -H "Authorization: OAuth $SFDC_SID" http://na1.salesforce.com/services/data/v20.0/recent

 

 

 Of course, you can use jsawk on these as well to process the response, e.g. this will show just the Ids of the records in your MRU

 

 

curl -H "Authorization: OAuth $SFDC_SID" http://na1.salesforce.com/services/data/v20.0/recent | ./jsawk "return this.Id"
["006300000023MvwAAE","a003000000E2BalAAF","0033000000h0k6qAAA","0033000000jWKwJAAW","0033000000jWKwIAAW","0033000000h0k76AAA","0033000000ZsocCAAR","0033000000ZsimSAAR","0033000000PVjEqAAL","01530000000KBIOAA4"]
["006300000023MvwAAE","a003000000E2BalAAF","0033000000h0k6qAAA","0033000000jWKwJAAW","0033000000jWKwIAAW","0033000000h0k76AAA","0033000000ZsocCAAR","0033000000ZsimSAAR","0033000000PVjEqAAL","01530000000KBIOAA4"]

 

 

 

 

Errors are always reported with an http status code, and an standardized error formated payload, the status codes used vary based on the best match to the HTTP definitions, mostly for errors you're going to see 4xx or possibly a 500 status code.

 

The error payload itself is always an array of errors, each error has a message, errorCode and optional fields array as properties. e.g.

 

 

< HTTP/1.1 400 Bad Request
< Server: 
< Content-Type: application/json; charset=UTF-8
< Content-Length: 360
< Date: Thu, 02 Sep 2010 03:20:49 GMT
< 
[ {
  "message" : "\nselect id,name,type from accountx\n                         ^\nERROR at Row:1:Column:26\nsObject type 'accountx' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.",
  "errorCode" : "INVALID_TYPE"
} ]

 

 

for XML formatted responses, you get an out Errors element, and an inner Error element for each error, e.g.

 

 

< HTTP/1.1 400 Bad Request
< Server: 
< Content-Type: application/xml; charset=UTF-8
< Content-Length: 475
< Date: Thu, 02 Sep 2010 03:24:24 GMT
< 
<?xml version="1.0" encoding="UTF-8"?>
<Errors>
    <Error>
        <errorCode>INVALID_TYPE</errorCode>
        <message>
select id,name,type from accountx
                         ^
ERROR at Row:1:Column:26
sObject type &apos;accountx&apos; is not supported. If you are attempting to use a custom object, be sure to append the &apos;__c&apos; after the entity name. Please reference your WSDL or the describe call for the appropriate names.</message>
    </Error>
</Errors>

 

 

Apache's HttpClient doesn't yet have a PatchMethod class, but its easy to do PATCH requests by override the PostMethod, e.g.

 

 

	public static void patch(String url, String sid) throws IOException {
		PostMethod m = new PostMethod(url) {
			@Override public String getName() { return "PATCH"; }
		};
		
		m.setRequestHeader("Authorization", "OAuth " + sid);

		Map<String, Object> accUpdate = new HashMap<String, Object>();
		accUpdate.put("Name", "Patch test");
		accUpdate.put("AnnualRevenue", 10);
		ObjectMapper mapper = new ObjectMapper();
		m.setRequestEntity(new StringRequestEntity(mapper.writeValueAsString(accUpdate), "application/json", "UTF-8"));
		
		HttpClient c = new HttpClient();
		int sc = c.executeMethod(m);
		System.out.println("PATCH call returned a status code of " + sc);
		if (sc > 299) {
			// deserialize the returned error message
			List<ApiError> errors = mapper.readValue(m.getResponseBodyAsStream(), new TypeReference<List<ApiError>>() {} );
			for (ApiError e : errors)
				System.out.println(e.errorCode + " " + e.message);
		}
	}
	
	private static class ApiError {
		public String errorCode;
		public String message;
		public String [] fields;
	}

 

 

The sample also uses the jackson json library, which I'd highly recommend for the java folks.

 

If you're stuck with an http library that doesn't allow for overriding, or setting an arbitary http method name, then you can send a POST request and provide an override to the http method via the query string param _HttpMethod, in the above example, you could replace the PostMethod line with this instead 

 

 

PostMethod m = new PostMethod(url + "?_HttpMethod=PATCH");

 

 


This new OSX app will let you make API calls to salesforce from AppleScript, use it to build integrations/automation between salesforce.com and your favorite OSX apps.

http://www.pocketsoap.com/osx/applescript/

Someone asked for an example of this, here's some code that creates a contact and uses an external ID on the account record to set the relationship to the account (rather than using the salesforce id for the account). The code assumes there's an field called extId__c on account which is flagged as an external Id, and that the account with the value ID_001 already exists.

 

 

            XmlDocument doc = new XmlDocument();
            XmlElement acc = doc.CreateElement("Account");
            XmlElement extId = doc.CreateElement("extId__c");
            extId.InnerText = "ID_001";
            XmlElement ty = doc.CreateElement("type");
            ty.InnerText = "Account";
            acc.AppendChild(ty);
            acc.AppendChild(extId);

            sf.sObject contact = new sf.sObject();
            contact.type = "Contact";
            XmlElement e1 = doc.CreateElement("FirstName");
            XmlElement e2 = doc.CreateElement("LastName");
            e1.InnerText = "Simon";
            e2.InnerText = "Fell";
            contact.Any = new XmlElement[] { e1, e2, acc };

            sf.SaveResult sr = s.create(new sf.sObject[] { contact })[0];
            if (sr.success)
                Console.WriteLine("new contact id is {0}", sr.id);
            else
                Console.WriteLine("Error {0} {1}", sr.errors[0].statusCode, sr.errors[0].message);

 

 

Has anyone tried PocketMac backup for Salesforce ?

http://www.pocketmac.com/product.php?id=37

 

it says backup, but really it looks like 1 way or 2 way sync. It seems to offer support for address book groups, and to pick which calendars to sync in ical (so in theory you can sync to the entourage calendar). For those folks waiting on those features from SF3, you might want to check this out.

I just posted the final Maildrop 2.0 build. You can download it from the project download page, or if you're already running Maildrop, just restart it, or pick check for updates to have it autoupdate.


Major new features include support for email attachments, the new buttonbar UI to replace the scripts menu, and the configurable search column for the 'What' search. Maildrop 2.0 runs on Tiger and Leopard, I have some ideas for the next version, which may mean its Leopard only.

Details of the new features, and download info.
http://www.pocketsoap.com/weblog/2008/11/1832.html

Feedback welcome.
If you're using SF3, then you may have already upgraded to v0.6, this adds support for multiday allday events, and probably most importantly, it now has the ability to prompt you to confirm that you want the sync process to make changes to salesforce.com, you get a summary of how many changes its going to make, and you can either allow it, or cancel the sync. If you're new to SF3, head over to http://code.google.com/p/sf3/ to check it out.


Also, i released today sfical.py, this is a simple python script that will allow to subscribe to your salesforce.com calendar in iCal, this is a simple read-only copy of your salesforce.com calendar in iCal. details & download available from http://www.pocketsoap.com/weblog/2008/06/1816.html


Feel free to let me know how you get on with either of them.

Message Edited by SimonF on 06-26-2008 09:12 PM
This an OSX 10.5 App that exposes the Document Repository in Salesforce.com as read-only mounted volume on your mac. Similar to the sfdcFuse but with a real app UI instead of a commandline interface.

More details on my blog http://www.pocketsoap.com/weblog/2008/03/1810.html

and everything is released under the open source BSD license, you can grab the install, source code etc from the project page on Google code.
http://code.google.com/p/sffs/
restart sfCubed to pickup the update, this fixes the problem with all day events not picking up date changes in salesforce, and addresses some filtering issues on 10.5.2. All the details are available on the project site http://code.google.com/p/sf3/
I'm happy to announce that Maildrop is now an open source project, with the source code being released under the BSD license.

Checkout the project's home page at Google code.
With the recent 0.52 release, I've decided to go Open Source, checkout the project on Google code http://code.google.com/p/sf3/
feel free to log bugs, feature requests etc in the issue tracker, and of course if anyone want to grab the source and get their hands dirty, patches are welcome.
I was interested in seeing what people's thoughts were on Leopard, have you upgraded, do you plan to upgrade soon (I've heard a few folks say they're waiting for 10.5.2), do you have no plans to upgrade ?

There's a lot of time & code saving features for developers in Leopard, but they're Leopard only. If future versions of SF3, Maildrop, Trapdoor were Leopard only, would that be an issue?
I just posted an updated build of the ApexDataLoader for OSX. (its using the 10.0 DataLoader, so has all the upsert features).
see http://www.pocketsoap.com/weblog/2008/01/1800.html
For those of you going to Dreamforce, I'll be there if anyone want to talk Mac / Salesforce.com stuff. Best place to catch me will be in the ADN lab, or the developer lounge. Feel free to post here if you want to schedule something specific.

I just posted the final Maildrop 2.0 build. You can download it from the project download page, or if you're already running Maildrop, just restart it, or pick check for updates to have it autoupdate.


Major new features include support for email attachments, the new buttonbar UI to replace the scripts menu, and the configurable search column for the 'What' search. Maildrop 2.0 runs on Tiger and Leopard, I have some ideas for the next version, which may mean its Leopard only.

Details of the new features, and download info.
http://www.pocketsoap.com/weblog/2008/11/1832.html

Feedback welcome.
If you're using SF3, then you may have already upgraded to v0.6, this adds support for multiday allday events, and probably most importantly, it now has the ability to prompt you to confirm that you want the sync process to make changes to salesforce.com, you get a summary of how many changes its going to make, and you can either allow it, or cancel the sync. If you're new to SF3, head over to http://code.google.com/p/sf3/ to check it out.


Also, i released today sfical.py, this is a simple python script that will allow to subscribe to your salesforce.com calendar in iCal, this is a simple read-only copy of your salesforce.com calendar in iCal. details & download available from http://www.pocketsoap.com/weblog/2008/06/1816.html


Feel free to let me know how you get on with either of them.

Message Edited by SimonF on 06-26-2008 09:12 PM
This an OSX 10.5 App that exposes the Document Repository in Salesforce.com as read-only mounted volume on your mac. Similar to the sfdcFuse but with a real app UI instead of a commandline interface.

More details on my blog http://www.pocketsoap.com/weblog/2008/03/1810.html

and everything is released under the open source BSD license, you can grab the install, source code etc from the project page on Google code.
http://code.google.com/p/sffs/
restart sfCubed to pickup the update, this fixes the problem with all day events not picking up date changes in salesforce, and addresses some filtering issues on 10.5.2. All the details are available on the project site http://code.google.com/p/sf3/
I'm happy to announce that Maildrop is now an open source project, with the source code being released under the BSD license.

Checkout the project's home page at Google code.
With the recent 0.52 release, I've decided to go Open Source, checkout the project on Google code http://code.google.com/p/sf3/
feel free to log bugs, feature requests etc in the issue tracker, and of course if anyone want to grab the source and get their hands dirty, patches are welcome.
I was interested in seeing what people's thoughts were on Leopard, have you upgraded, do you plan to upgrade soon (I've heard a few folks say they're waiting for 10.5.2), do you have no plans to upgrade ?

There's a lot of time & code saving features for developers in Leopard, but they're Leopard only. If future versions of SF3, Maildrop, Trapdoor were Leopard only, would that be an issue?
I just posted an updated build of the ApexDataLoader for OSX. (its using the 10.0 DataLoader, so has all the upsert features).
see http://www.pocketsoap.com/weblog/2008/01/1800.html
For those of you going to Dreamforce, I'll be there if anyone want to talk Mac / Salesforce.com stuff. Best place to catch me will be in the ADN lab, or the developer lounge. Feel free to post here if you want to schedule something specific.
I was reminded by the Data Loaders' original author (the infamous Lexi) today that the more recent versions only have minor functionality improvements in them, so rather than waiting for the source of those versions to get released, I went ahead and built a new OSX version of the data loader source that is there. This is v7.0 of the data loader, it includes export, insert, update, and upsert. (but not the FK externalId support). I think makes it about 2 revs out of date, but i think is still useful anyway. You can grab a copy from my blog


For those people running PPC Macs that had trouble running SoqlXplorer, the new 0.84 release should fix that issue.
If you use Maildrop with Mail a lot it probably bugs you that the menu to run the Maildrop options is not very handy. I just wrote up some details of how to use a Mail plugin called Mail Act-On to enable to you run the 2 Maildrop commands directly from the keyboard.

see http://www.pocketsoap.com/weblog/2007/06/1770.html




Message Edited by SimonF on 06-23-2007 12:20 AM

Anyone heading to the WWDC this week?
I seem to recall that people were asking about mailmerge, looks like the Conga Mail Merge app on the AppExchange supports Macs. see http://www.salesforce.com/appexchange/detail_overview.jsp?NavCode__c=&id=a0330000002f6sXAAQ

If anyone's tried it, please let us know how you got on.

Cheers
Simon
I just posted an update to Maildrop, it has a couple of bug fixes along with some new features.
  • Can now create leads in addition to contacts from the add email page, the add lead/contact buttons are now much more obvious.
  • The Add Email dialog is reset between emails, it no longer defaults to the last email's selections.
  • Malformed search error with email addresses containing dashes is fixed.
  • New menu item to reinstall the scripts (under help), and error reporting when the script install fails.
  • New application icon and updated help.
If you have an earlier version of Maildrop, it'll auto update the next time you start, or pick check for updates from the help menu.

This I think was pretty much everything that people commented one, other than a couple of Mail specific issues, which i'll be looking into next.

I also got around to putting together a single page that details all the Saleforce.com/OSX tools I've built, see http://www.pocketsoap.com/osx/

I've been doing a bunch of Mac stuff recently, and have open sourced the client library i wrote to access the API. see http://www.pocketsoap.com/osx/zkSforce/ Share & Enjoy
I posted an updated version of Beatbox, enjoy! for those of you that live & die by your RSS aggregators, one of the new samples is soql2atom.py converts a SOQL query results into an Atom 1.0 formated feed
Its pretty amazing what 400 lines of python code can actually do, i put together a simple yet powerful client stub for the sforce API over the weekend, its only dependency is on xmltramp (which rocks), which is included in the download.

enjoy! http://www.pocketsoap.com/weblog/2006/02/1599.html
released under the BSD license, this is a simple .NET 2.0 application that lets you explorer your salesforce.com schema.

see http://www.pocketsoap.com/weblog/2006/02/1596.html
For anyone moving from pre 7.0 to 7.0 and running into probems where you get a 'must send concrete type' when you think you are sending a concrete type, make sure you're using the correct 2001 xml schema namespaces, e.g. (prefix's don't matter)
mlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
mlns:xsd="http://www.w3.org/2001/XMLSchema"

and not one of the earlier interim namespaces such as
mlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
If you do nothing else, make sure your perf sensitive integrations are taking advantage of the sforce support for gzip. It could get you an easy 6x perf increase!.

see http://blog.sforce.com/sforce/2005/12/gzip_matters.html and
http://www.pocketsoap.com/weblog/2005/12/1583.html
If I already have a JSON HTTP Post object can I simply send requests to the salesforce.com website for updating my company data automatically? Every manual I read requires the SDK be installed. I have not had to do this with previous vendors, I just use the provided URIs and send the requests through my platform. Is installing the SDK a requirement?
When the API documentation (especially Bulk and Rest) refer to sObjects, could some one please cofirm that they mean ALL the stardard objects:

http://www.salesforce.com/us/developer/docs/officetoolkit/Content/sforce_api_objects_list.htm

and not JUST the "Sales Objects" here:

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_majors.htm

IN other words, you can use the ROW API call for ALL objects including something like Attachments?

Thank you!
Ryan

Side note: I feel our industry needs to settle down about abreviations.   Ambiguity no es bueno!
I'm having issue creating a task via REST API and need some help as to point out what I may be doing wrong. My code is the following:

public class SalesForceEvent
{
    public SalesForceAccount Account { get; set; }
    public string Id { get; set; }
    public string AccountId { get; set; }
    public string OwnerId { get; set; }
    public string Subject { get; set; }
    public string Type { get; set; }
    public string Description { get; set; }
    public string Status { get; set; }
    public string ActivityDate { get; set; }
    public bool IsClosed { get; set; }
    public bool IsDeleted { get; set; }
    public string Priority { get; set; }
    public string WhoId { get; set; }
    public string WhatId { get; set; }

}

var uri = serviceUrl + "/services/data/v20.0/sobjects/Account/task/";

var task = new SalesForceEvent();
task.OwnerId = "XXXXXXXXX";
task.Account = acct;
task.ActivityDate = DateTime.Now.ToString();
task.Subject = "Call";
task.Type = "Call";
task.Status = "Completed";
task.Description = " A Call for this new task";
task.IsClosed = true;
task.Priority = "Normal";
task.WhoId = "";
task.WhatId = "XXXXXXXXX";


var ser = new JavaScriptSerializer();
var body = ser.Serialize(task);

var req = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(uri);
req.Headers.Add("Authorization: OAuth " + SFHelper.SalesForceToken.access_token);
req.ContentType = "application/json";
req.Method = "POST";

byte[] data = System.Text.Encoding.ASCII.GetBytes(body);
req.ContentLength = body.Length;
var os = req.GetRequestStream();
os.Write(data, 0, data.Length);
os.Close();

WebResponse resp;

try
{
    resp = req.GetResponse();
}
catch (WebException ex)
{
    resp = ex.Response;
}

if (resp != null)
{
    HtmlGenericControl hgc = new HtmlGenericControl();
    StringBuilder sb = new StringBuilder();

    System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
    sb.Append(sr.ReadToEnd().Trim());

    hgc.InnerHtml = sb.ToString();
    plcResults.Controls.Add(hgc);

}

When making the call I get the following error message:

[{"errorCode":"NOT_FOUND","message":"Provided external ID field does not exist or is not accessible: task"}]

Any assistance is greatly appreciated.

Hi,

I want to perform CRUD operation mainly create/update on standard object via web services (rest webservice). So, Do i need to write rest webservice code in apex to create Lead or Account or any standard object ????

OR Default web services are already availalbe in salesforce ??? If YES then please let me know.

 

I went to the Android Play Store on my Android phone and found the Salesforce1 App.  It shows a date of 3/17/2014 and includes comments --

What’s new in 5.1.1:
• Bug fixes and improvements
What’s new in 5.2:
• Custom Branding
• Bug fixes and improvements

But when I downloaded it , I get the Chatter icon, not the SF1 icon.  And when I run it and check the version it says it is "About Chatter Version 3.4.2 Build number 8".

Am I not getting the latest version?  Anyone know why?

For one thing, I'm only getting "Feed" and RECENT, not the other tabs I have configured including some custom pages under APPS.  All these work fine on iPad when pointing to the same org.
How come I can't dynamically cast a QueryResult to an sObject and view the values without have to cast the result to a difinitive sObject? I've been able to view returned values from a query within Microsoft Access, loop through the queryresult and then insert record values into the appropriate tables without having to specifiy whether it is an Account or Contact, or Lead, etc.

Instead of having to do something like:
sObject s = new Account();
Account a = Account(s).

Why can't I just loop through the sObject records and retrieve the values?

I'm working on an integration piece and the sObject type has to be dynamic. I cannot cast it to a specific sobject every single time I need to retrieve records.

try
                    {
                        QueryResult qResult = sfProd.query(strSelectStatement);
                        sObject[] s = qResult.records;
                       
                        Boolean done = false;

                        if (qResult.size > 0)
                        {
                            while (!done)
                            {
                                // foreach statement cannot operate on variables of type QueryResult because QueryResult does not contain a public definition for GetEnumerator
                                //foreach (QueryResult q in qResult)
                                //{
                                //}
                               
                                for (Int32 j = 0; j < qResult.records.Length; j++)
                                {
                                    MessageBox.Show(s[j].GetType().ToString());
                                    MessageBox.Show(s[j].GetType().Name);
                                    //MessageBox.Show(s[j].GetType().GetFields("Name").ToString());
                                    MessageBox.Show(s[j].Id.ToString());
                                }

                                if (qResult.done)
                                {
                                    done = true;
                                }
                                else
                                {
                                    qResult = sfProd.queryMore(qResult.queryLocator);
                                }
                               
                            }
                        }
                    }
                    catch (SoapException e)
                    {
                        MessageBox.Show(e.Message);
                    }

Hi,
I have fetched the AsyncApexJob from .Net.
In SOQL i got the "Bind variables only allowed in Apex code" Error.

My code is:

string res = "Failed";
            QueryResult query = null;
            string soql;
            soql = "SELECT Status,JobType,NumberOfErrors,CompletedDate FROM AsyncApexJob WHERE Status="+res+"";
            query = sfdcbind.query(soql);

Anyone help to solve this.
In API Sections, I'm not getting anything to generate WSDL.

Please see attached image.

Help asap. There is no link coming to generate WSDL, I want to access Contacts data in my .net application.

User-added image
Hi,

I'm trying to do upserts progrmatically.  For some reason I'm getting an INVALID_TYPE_ON_FIELD_IN_RECORD error for integer fields.
For example 5267 is reported as invalid value for field PaperID__c (see below).

I¨m quite buffled by this.



<?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Header><sforce:SessionHeader xmlns:sforce="urn:partner.soap.sforce.com"><sessionId xsi:type="xsd:string">00Dg0000003LRFz!ARAAQGWdG_dr.Ia_2V3QWeFZb7jWZJkn23A905ygVgvCN8_6MjC8aaqrBujiH4Gtp0_wUKzWW8HDr4CeIjqsOjaiobVp6VhH</sessionId></sforce:SessionHeader></soap:Header><soap:Body><sforce:upsert xmlns:sfons="urn:sobject.partner.soap.sforce.com" xmlns:sforce="urn:partner.soap.sforce.com">

      <sforce:externalIDFieldName xsi:type="xsd:string">PaperID__c</sforce:externalIDFieldName>
      <sObjects xsi:type="sforce:Account">

         <sforce:PaperID__c xsi:type="xsd:int">5267</sforce:PaperID__c>
       
        <sforce:name xsi:type="xsd:string">Test test5eeerreedede</sforce:name>
        <sforce:type xsi:type="xsd:string">0</sforce:type><sforce:fieldsToNull xsi:type="xsd:string">website</sforce:fieldsToNull>
        <sforce:fieldsToNull xsi:type="xsd:string">country__c</sforce:fieldsToNull>
        <sforce:fieldsToNull xsi:type="xsd:string">papertype__c</sforce:fieldsToNull></sObjects>
    </sforce:upsert></soap:Body></soap:Envelope>
hi,

i have to get a Java application to interface with a Web-Service (WS) that is avaiable via SalesForce (SF).

my app has to have its details loaded from property files so that we can test it in different environments before it can be deployed into production.

for that reason, i have to use different URLs, username and password when calling the WS.

with that in mind i have coubled together the code below that i have copied from another developer's blog :
http://kperisetla.blogspot.co.uk/2011/09/creating-custom-apex-web-service-in.html

it should have worked but it does not.
i can collect the correct loginResult and i try setting the URL to the one given by SF.
but it keeps giving me errors as if this object is not available/exist.

certainly, as a new SF user i am missing something unbelieably obvious.

could one of you experts assist me in solving this puzzle?

many thanks,




[error]

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client
faultSubcode:
faultString: No operation available for request {http://soap.sforce.com/schemas/class/BananaWs}processInfoXML
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:No operation available for request {http://soap.sforce.com/schemas/class/BananaWs}processInfoXML
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
...

[/error]





[code]


String rsFileProcess = new String();
String xmlFile2Process = "<root><data>some long string goes here</data></root>";

String varContext_username = "app.use@sf.bananas.org.int";
String varContext_password = "Jggbnfkkr88jmkdmXxymJUhP9IeG7yvDlLYXr1jvG";
String varContext_loginUri = "https://test.salesforce.com/";

System.out.println(
"\n\n\tLOGIN DETAILS FOR WS"
+"\n\tuser:\t" + varContext_username
+"\n\tpwd:\t" + varContext_password
);


//Get a stub for calling partner WSDL's login method in order to get SessionID
SoapBindingStub bind = (SoapBindingStub)new SforceServiceLocator().getSoap();

LoginResult lr=bind.login(
varContext_username,
varContext_password
);

//Create a sessionHeader object and set its sessioId property to sessionId
//received in loginResult object                       
SessionHeader sh=new SessionHeader();
sh.setSessionId(lr.getSessionId());

//Create a service locator object for your custom web service
BananaWsServiceLocator locator=new BananaWsServiceLocator();

//Get URL for your custom web service
URL url=new URL(lr.getServerUrl());

//Create a stub for your custom web service with URL for your service and locator as parameters
BananaWsBindingStub stub=new BananaWsBindingStub(url, locator);

//Set the header property of stub with name "SessionHeader" and value as sh-sessionHeader
//object created above
stub.setHeader(locator.getBananaWsAddress(), "SessionHeader", sh);

//now make call to custom service-in
rsFileProcess = stub
.processInfoXML(xmlFile2Process);

System.out.println(

"the file processing returned :: " + rsFileProcess

);


[/code]
I have the following code:

User userupdate = new User();
userupdate.Id = "005G0000003VyQuIAK"; // this is a legit ID, I checked
userupdate.IsActive = false;
binding.update(new sObject[] {userupdate}); // binding is my active connection to SFDC, and allows me to perform other actions no problem

But the user Active field is not updating. Am I missing something?

Regards,
James
I have created a notification listener web service in C# which serve as a endpoint url in Outbound Message definition in Salesforce. I am trying to test the message recieved from Outbound Message. But couldnt find the way to test the same.

Endpoint Url - https://
WCF Service using Notification service - http://hostname/SalesforceNotification.asmx as a web reference
I'm after a recent working example (code) that I can prototype in VBScript and then pass onto my client, who needs to make a targeted change to a legacy VB6 app to make a real-time query against a Contact record in Salesforce.  The query is currently against a SQL DB that is not part of the legacy app, but will be migrated to salesforce.com.

The code I'm using (below), fails on when trying to parse the response (e.parse t)
--> Error during parsing, no element found at line 1
--> Code: 80044240, PocketSOAP.Envelope.11:

This article (https://developer.salesforce.com/forums/ForumsMain?id=906F00000008rMBIAY) from 2004 with replies from the PocketSOAP creator @Superfell is useful, but doesn't quite have a full example.

' PocketSOAP calling SOAP API / Partner WSDL

dim e
set e = CreateObject("PocketSOAP.Envelope.2")
' CLSID: {E2E0FB24-E58F-458f-84E0-6E09D2D51511}

e.EncodingStyle = ""
e.SetMethod "login", "urn:enterprise.soap.sforce.com"
'e.URI = "urn:enterprise.soap.sforce.com"

e.Parameters.Create "username", "sfdcuser@org.com", "urn:login"
e.Parameters.Create "password", "pwd+token", "urn:login"

' CLSID: {C7899023-E487-4268-AE2A-4EC50136DAB3}
'set mgr = CreateObject("pocketSOAP.Attachments")
'mgr.Format = formatMime

' CLSID: {D76BA06F-ABF3-4c1f-BDC9-1848D4E3CF2B}
dim t
set t = CreateObject("PocketSOAP.HTTPTransport.2")
t.SOAPAction = ""

t.Send "https://test.salesforce.com/services/Soap/u/29.0/", e.serialize

wscript.echo e.serialize

e.parse t ' <--- fails here with 'Error during parsing, no element found at line 1
' Code: 80044240, PocketSOAP.Envelope.11

wscript.echo "debug = " & e.parameters.item(0).Value

have a webservice written in .net which gets the request from the outbound message and sends the response. But salesforce keeps hitting my application and it still waits in outbound queue. How do I stop salesforce to hit the application once the response is received? Following is my code sample

notificationsResponse INotificationBinding.Pur(PTrans.notifications PurP)
    {
        string id,session = null;
        PTrans.notifications test = PurP;
        session = test.SessionId;
        string url = test.EnterpriseUrl;
        PTrans.Transaction__cNotification[] request = PurP.Notification;
        PTrans.notificationsResponse response = new notificationsResponse();
        response.Ack = true;
        return response;
    }
When I tested with soapui, I get the following response,

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <notificationsResponse xmlns="http://soap.sforce.com/2005/09/outbound">
         <Ack>true</Ack>
      </notificationsResponse>
   </soap:Body>
</soap:Envelope>
  • January 22, 2014
  • Like
  • 0
We are using cURL (per quickstart instructions) to initiate REST API connectivity. 

When issuing the command to get a security token - https://na11.salesforce.com/services/oauth2/token - we get back the error:

Failed: API security token required","error":"invalid_grant"

Which seems odd, since we're asking for the token. The client_id, client_secret, grant_type, username, and password all look fine. 

Assuming all that information is correct, what other reasons would the app not grant a security token?
Hi.

One of my SF users has set the mandatory state on a custom field.

But when I export the enterprise WSDL file, that column, though correctly typed, has a minOccurs="0".

<element name="Prospective_Target__c" nillable="true" minOccurs="0" type="xsd:double"/>

As a consequence, my mapper hasn't got the all the rules it needs to enforce this rule automatically.

Setting minOccurs="1" maxOccurs="1" is a very easily understood pattern, and especially on a simple element.

Is this something that could be done?

Conversly, because the WSDL files say the column is NOT mandatory in any descernible way, it shouldn't reject content in the way it now does. Hmm. Yeah, I know that's pushing things a bit, but I hope you can see the point.

I'm new on here, so is there anything else I need to ask to get some resolution on this?
I am trying to export my personal SF.com  data to spreadsheet format and then use that file to integrate with the sample you sent me yesterday instead of doing it manually.

The hitch is this, I am working on a MAC and when I prep the file on SF.com in the Data area, then save and export, my options are csv or xls, neither of which works when save the file on my MAC and open to view.

I am quite familiar with importing and exporting on my MAC, being the intuitive machine it is it just almost does the job on its own, but with SF the end result file is unusable. My search on this issue led me to reading about Force.com Excel Connector (there is no OSX version?) and other ways around this matter, landing up on this page http://www.ericsantiago.com/eric_santiago/2010/03/mac-daddy.html, who recommends LexiLoader.  I've installed LexiLoader for OSX on my MAC when I run it, it asks me to insert my SF.com access details and then error messages me they are incorrect, and they are not. So back to the drawing board.

Any help on this would be appreciated. Alternatively I will just have to do this list manually ):

I was thrilled to find this:

 

tell application "SalesforceScripting"
	set mySession to login username "myemail@mydomain.com" password "passwordtokenhere"
	
	--  Create a new Account in Salesforce
	
	set acc to make SObject
	set type of acc to "Account"
	acc setField named "Name" to "3 New Test Account"
	acc setField named "PDS__QB_Billing_Address__c" to "3 New Test Account
John Doe
123 Main Street
Arlington, TX 75007"
	acc setField named "Phone" to "(888) 555-6666"
	set res to mySession create sobjects acc
	Id of first item of res
	
end tell

 


And It works like a champ. I've spent the last couple of hours scouring the net and the script library trying to find out how to use something similar, or to add to it, so that I can create an Opportunity and Contact by adding some instructions to this.

 

I'm stuck. I guess I don't know enough about Apex and the SF system yet to read what needs to be in the script.

 

Any insight as to how to add Accounts/Contacts/Opportunities at the same time would be greatly appreciated.

  • June 28, 2011
  • Like
  • 0