-
ChatterFeed
-
675Best Answers
-
22Likes Received
-
0Likes Given
-
36Questions
-
8048Replies
Error Creating Task via REST API
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.
-
- John Broaddus
- May 17, 2014
- Like
- 0
- Continue reading or reply
Trouble setting the User.IsActive field
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
-
- jpgilbert
- March 10, 2014
- Like
- 0
- Continue reading or reply
Using PocketSOAP to call the SOAP API from VBScript/VB6
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
-
- David Thomas
- February 25, 2014
- Like
- 0
- Continue reading or reply
Outbound Message - Call Back
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.
-
- ShadowlessKick
- December 13, 2013
- Like
- 0
- Continue reading or reply
Trapdoor Wish List
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 !!
-
- Ryan Lambert
- December 10, 2013
- Like
- 0
- Continue reading or reply
Communicating with an Apex webservice
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?
-
- bvramkumar
- November 21, 2013
- Like
- 0
- Continue reading or reply
Urgent::Salesforce Integration with .net
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?
-
- Dhaval Panchal
- November 19, 2013
- Like
- 0
- Continue reading or reply
Apex Generation Failed Unable to find schema for element;
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.
-
- Aurélien.Laval
- November 14, 2013
- Like
- 0
- Continue reading or reply
WSC - Setting session id and server URL after calling login()
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?
-
- bryano
- November 06, 2013
- Like
- 0
- Continue reading or reply
Salesforce .net Integration
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.
-
- sweetz
- November 06, 2013
- Like
- 0
- Continue reading or reply
trouble setting up a .net project with SOAP WSDL
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
-
- JGilbert
- October 29, 2013
- Like
- 0
- Continue reading or reply
Rest API calls giving error in production.
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??
-
- sami ami
- October 10, 2013
- Like
- 0
- Continue reading or reply
Authenticating REST Users
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.
-
- Scott W.
- October 02, 2013
- Like
- 0
- Continue reading or reply
Java SOAP API Date problem
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.
-
- Code monkey see code monkey do
- September 24, 2013
- Like
- 0
- Continue reading or reply
MailDrop won't open because from an unidentified developer
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?
-
- TB2
- September 19, 2013
- Like
- 0
- Continue reading or reply
c# Issue with downloading attachments
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
-
- Ashwin Sidharth
- August 25, 2013
- Like
- 0
- Continue reading or reply
Confused why calls to /services/data/ works but everything else returns 401 error
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?
-
- ward
- August 02, 2013
- Like
- 0
- Continue reading or reply
add case to different case queues in Maildrop
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
-
- jcald
- June 27, 2013
- Like
- 0
- Continue reading or reply
Login History API
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?
-
- SF-NewBie
- June 13, 2013
- Like
- 0
- Continue reading or reply
Android Native App with SOQL query that references current user
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.
-
- Pancho
- June 11, 2013
- Like
- 0
- Continue reading or reply
Lion 10.7.2 update addresses attachments applescript error w/ maildrop
remember to turn attachments back on in the maildrop preferences.
-
- Superfell
- October 13, 2011
- Like
- 0
- Continue reading or reply
Maildrop update
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.
-
- Superfell
- September 01, 2011
- Like
- 0
- Continue reading or reply
OSX Demo Client
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
-
- Superfell
- July 09, 2011
- Like
- 0
- Continue reading or reply
getDeleted()
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.
-
- Superfell
- May 25, 2011
- Like
- 0
- Continue reading or reply
jsawk
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"
-
- Superfell
- October 28, 2010
- Like
- 0
- Continue reading or reply
Error Structures
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 '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.</message> </Error> </Errors>
-
- Superfell
- September 02, 2010
- Like
- 0
- Continue reading or reply
PATCH example with apache HttpClient
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");
-
- Superfell
- August 28, 2010
- Like
- 0
- Continue reading or reply
AppleScript connector
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.
-
- Superfell
- June 04, 2010
- Like
- 0
- Continue reading or reply
Create with foreign keys with partner API
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);
-
- Superfell
- May 13, 2010
- Like
- 0
- Continue reading or reply
backup/sync
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.
-
- Superfell
- February 11, 2009
- Like
- 0
- Continue reading or reply
Maildrop 2.0 released
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.
-
- Superfell
- December 07, 2008
- Like
- 1
- Continue reading or reply
Maildrop 2.0 beta
http://www.pocketsoap.com/weblog/2008/11/1832.html
Feedback welcome.
-
- Superfell
- November 22, 2008
- Like
- 1
- Continue reading or reply
SF3 v0.6 and sfical.py
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
-
- Superfell
- June 27, 2008
- Like
- 1
- Continue reading or reply
ANN: SFFS (aka the SalesForce File System)
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/
-
- Superfell
- March 07, 2008
- Like
- 1
- Continue reading or reply
sfCubed 0.53 released
-
- Superfell
- February 19, 2008
- Like
- 1
- Continue reading or reply
Maildrop is now open source
Checkout the project's home page at Google code.
-
- Superfell
- February 18, 2008
- Like
- 1
- Continue reading or reply
SF3 Open Sourced
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.
-
- Superfell
- February 10, 2008
- Like
- 1
- Continue reading or reply
Who's NOT moving to Leopard ?
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?
-
- Superfell
- February 09, 2008
- Like
- 1
- Continue reading or reply
ApexDataLoader
see http://www.pocketsoap.com/weblog/2008/01/1800.html
-
- Superfell
- January 21, 2008
- Like
- 1
- Continue reading or reply
Dreamforce
-
- Superfell
- September 15, 2007
- Like
- 1
- Continue reading or reply
Maildrop 2.0 released
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.
-
- Superfell
- December 07, 2008
- Like
- 1
- Continue reading or reply
Maildrop 2.0 beta
http://www.pocketsoap.com/weblog/2008/11/1832.html
Feedback welcome.
-
- Superfell
- November 22, 2008
- Like
- 1
- Continue reading or reply
SF3 v0.6 and sfical.py
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
-
- Superfell
- June 27, 2008
- Like
- 1
- Continue reading or reply
ANN: SFFS (aka the SalesForce File System)
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/
-
- Superfell
- March 07, 2008
- Like
- 1
- Continue reading or reply
sfCubed 0.53 released
-
- Superfell
- February 19, 2008
- Like
- 1
- Continue reading or reply
Maildrop is now open source
Checkout the project's home page at Google code.
-
- Superfell
- February 18, 2008
- Like
- 1
- Continue reading or reply
SF3 Open Sourced
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.
-
- Superfell
- February 10, 2008
- Like
- 1
- Continue reading or reply
Who's NOT moving to Leopard ?
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?
-
- Superfell
- February 09, 2008
- Like
- 1
- Continue reading or reply
ApexDataLoader
see http://www.pocketsoap.com/weblog/2008/01/1800.html
-
- Superfell
- January 21, 2008
- Like
- 1
- Continue reading or reply
Dreamforce
-
- Superfell
- September 15, 2007
- Like
- 1
- Continue reading or reply
Data Loader for OSX
-
- Superfell
- July 17, 2007
- Like
- 1
- Continue reading or reply
SoqlXplorer 0.84
-
- Superfell
- June 26, 2007
- Like
- 1
- Continue reading or reply
Use Maildrop from the Keyboard in Mail
see http://www.pocketsoap.com/weblog/2007/06/1770.html
Message Edited by SimonF on 06-23-2007 12:20 AM
-
- Superfell
- June 23, 2007
- Like
- 1
- Continue reading or reply
-
- Superfell
- June 11, 2007
- Like
- 1
- Continue reading or reply
Mailmerge
If anyone's tried it, please let us know how you got on.
Cheers
Simon
-
- Superfell
- April 17, 2007
- Like
- 1
- Continue reading or reply
Maildrop v1.3
- 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.
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/
-
- Superfell
- April 10, 2007
- Like
- 1
- Continue reading or reply
Cocoa/ Objective-C library for accessing the API
-
- Superfell
- November 22, 2006
- Like
- 1
- Continue reading or reply
ANN: Beatbox 0.9
-
- Superfell
- April 18, 2006
- Like
- 1
- Continue reading or reply
ANN: Beatbox a python library for calling sforce
enjoy! http://www.pocketsoap.com/weblog/2006/02/1599.html
-
- Superfell
- February 20, 2006
- Like
- 1
- Continue reading or reply
SforceHerder
see http://www.pocketsoap.com/weblog/2006/02/1596.html
-
- Superfell
- February 18, 2006
- Like
- 1
- Continue reading or reply
API v7.0 requires you to use the correct XML Schema namespaces
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"
-
- Superfell
- January 21, 2006
- Like
- 1
- Continue reading or reply
gzip matters
see http://blog.sforce.com/sforce/2005/12/gzip_matters.html and
http://www.pocketsoap.com/weblog/2005/12/1583.html
-
- Superfell
- December 05, 2005
- Like
- 1
- Continue reading or reply
Already have a JSON HTTP Post object
- Chad Saar
- June 05, 2014
- Like
- 0
- Continue reading or reply
Rest API: for "Sales Objects" or "Standard 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!
- Ryan Panos
- June 03, 2014
- Like
- 0
- Continue reading or reply
Error Creating Task via REST API
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.
- John Broaddus
- May 17, 2014
- Like
- 0
- Continue reading or reply
are default rest/soap services available to perform CRUD operation on standard objects ????
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.
- Michael Dsoza
- May 14, 2014
- Like
- 0
- Continue reading or reply
Salesforce1 version on Android, I get Chatter 3.4.2 when I downloaded from the Play Store.
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.
- Ken Koellner
- April 30, 2014
- Like
- 0
- Continue reading or reply
How can I dynamically cast a QueryResult to an sObject and view the values returned in the QueryResult without having to specify an actual sobject such as Account or Contact?
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);
}
- venturec3
- April 18, 2014
- Like
- 0
- Continue reading or reply
Bind variables only allowed in Apex code error in SOQL query from .Net
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.
- vino1.395228003587918E12
- April 17, 2014
- Like
- 0
- Continue reading or reply
How 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.
- Vishal P 4
- April 17, 2014
- Like
- 1
- Continue reading or reply
INVALID_TYPE_ON_FIELD_IN_RECORD for integer value
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>
- jiri1.3966104396934639E12
- April 15, 2014
- Like
- 0
- Continue reading or reply
No operation available for request {http://soap.sforce.com/schemas/class/BananaWs}processInfoXML
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]
- nicolas.diogo1.3953155885519846E12
- March 20, 2014
- Like
- 0
- Continue reading or reply
Trouble setting the User.IsActive field
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
- jpgilbert
- March 10, 2014
- Like
- 0
- Continue reading or reply
Problem reading Outbound Message in Notification Service listener in C#
Endpoint Url - https://
WCF Service using Notification service - http://hostname/SalesforceNotification.asmx as a web reference
- poonam.8d1.3939297558988455E12
- March 05, 2014
- Like
- 0
- Continue reading or reply
Using PocketSOAP to call the SOAP API from VBScript/VB6
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
- David Thomas
- February 25, 2014
- Like
- 0
- Continue reading or reply
Outbound message hits webservice continously
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>
- sweetz
- January 22, 2014
- Like
- 0
- Continue reading or reply
REST API Quickstart - Requesting a security token
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?
- jon1.3903427820537283E12
- January 21, 2014
- Like
- 0
- Continue reading or reply
Mandatory fields are not tagged as a minOccurs="1" in the WSDL files.
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?
- RichardQ
- January 15, 2014
- Like
- 0
- Continue reading or reply
nstalled LexiLoader on my Mac to export SF.com reports to my Mac and LexiLoader keeps telling me my SF.com access details are wrong, and they are not. Any ideas?
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 ):
- deborahform1.3892902758481E12
- January 09, 2014
- Like
- 0
- Continue reading or reply
Create New Account/Contact/Opportunity via Applescript and SalesforceScripting App
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.
- bigga
- June 28, 2011
- Like
- 0
- Continue reading or reply