Rectangle 27 4

If you work with table data you should use Pandas library

import pandas as pd 
from datetime import datetime
import beatbox

service = beatbox.PythonClient()  
service.login('login_here', 'creds_here')


query_result = service.query("SELECT Name, Country, CreatedDate FROM Lead limit 5")  # CreatedDate is a datetime object
records = query_result['records']      # records is a list of dictionaries

records is a list of dictionaries as you mentioned before

df = pd.DataFrame(records)
print (df)

     Country         CreatedDate Id              Name  type
0  United States 2011-05-26 23:39:58       qwe qwe      Lead
1         France 2011-09-01 08:45:26       qwe qwe      Lead
2         France 2011-09-01 08:37:36       qwe qwe      Lead
3         France 2011-09-01 08:46:38       qwe qwe      Lead
4         France 2011-09-01 08:46:57       qwe qwe      Lead

Now you have table-style Dataframe object. You can index multiple columns and rows:

df['CreatedDate']

0   2011-05-26 23:39:58
1   2011-09-01 08:45:26
2   2011-09-01 08:37:36
3   2011-09-01 08:46:38
4   2011-09-01 08:46:57

How to extract raw data from Salesforce using Beatbox python API - Sta...

python salesforce beatbox
Rectangle 27 0

This question on SO addresses the geocoding API specifically being run from a visualforce page directly, Salesforce: Google maps query status 620 G_GEO_TOO_MANY_QUERIES and it does seem to mean that without a key the limits are shared. I would suspect that unless you plan on giving the app away that you are working on, you will pretty much be forced to pick up an upgraded API key. One thing you may want to look at to work around this is hosting the maps portion in another location, and iframing it into Salesforce.

Hosting it elsewhere and iframing it won't be an acceptable solution. From the discussions on the question you linked, I'm inclined to think it is shared

API key might be the 'key' maybe we'll make that a configurable setting

Little stale now, but I found the relevant piece of documentation for this one: developers.google.com/maps/articles/geocodestrat ... many cloud computing infrastructures, such as Google App Engine or Amazon Web Services, share IP addresses between different applications. Your requests may run up against quota used by other applications wholly outside your control.

if you could post that as an answer i could accept it :)

salesforce - How does Google Geocoding API usage limits apply to [Sale...

google-maps salesforce policy visualforce
Rectangle 27 0

I can only speak from a .NET perspective. Any changes to SF requires re-downloading the Enterprise WSDL again and refreshing the web service. If older objects are accessible then it sounds like the service needs to be updated with the new wsdl.

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

Can't see custom object in Salesforce sandbox API? - Stack Overflow

salesforce
Rectangle 27 0

If you are displaying the Objects in SelectList and their labels Check this . You can alse display the API Names. Check this also

salesforce - List of all objects with labels and API names - Stack Ove...

salesforce visualforce apex soql
Rectangle 27 0

I found the solution... I had to make sure I was sending the data as an associative array like so:

$response = $client->makeContact
                (
                    array
                    (
                        "sLastName" => (string) $wpcf7_data->posted_data['last-name'],
                        "sFirstName" => (string) $wpcf7_data->posted_data['first-name'],
                        "sAddress1" => (string) $wpcf7_data->posted_data['address-one'],
                        "sAddress2" => (string) $wpcf7_data->posted_data['address-two'],
                        "sCity" => (string) $wpcf7_data->posted_data['town-city'],
                        "sPostcode" => (string) $wpcf7_data->posted_data['post-code'],
                        "sEmail" => (string) $wpcf7_data->posted_data['email-address'],
                        "sPhone" => (string) $wpcf7_data->posted_data['telephone'],
                        "sMobile" => (string) "",
                        "sEnquiries" => (string) $wpcf7_data->posted_data['enquiry'],
                        "sComment" => (string) $wpcf7_data->posted_data['comments'],
                        "sPropertyID" => (string) wpcf7_special_mail_tag_for_post_data( "", "_post_id" ),
                        "sPropertyName" => (string) wpcf7_special_mail_tag_for_post_data( "", "_post_title" ),
                    )
                );

Salesforce PHP SOAP API - Unable to get custom WebService working - St...

php api soap salesforce
Rectangle 27 0

Everything looks good, but instead of using "ID" for the Indexed Field Name, you need to use "Account__c". That should take care of your issue.

SalesForce Bulk API: Relationship between custom object and Account - ...

salesforce
Rectangle 27 0

For what it's worth, I was able to retrieve fields by using the "retrieve" method of the API in conjunction with the "query" method. I used the query method to get the SalesForce ID since you can specify your search criteria in query, then used the retrieve function with the specific ID from the query method. Doesn't seem to be the most efficient, but it gets the job done.

See the "Retrieving Records" section.

Trouble with SalesForce Query Results - PHP Toolkit - Stack Overflow

php salesforce soql
Rectangle 27 0

Create a StandardSetController for given object (the query you'll use to instantiate it can have "LIMIT 1" or something, no need to select all records). Then use getListViewOptions().

Remember that it will return views visible for current user (so only the public ones + ones marked as "visible only to me').

EDIT: To access it from outside (via SOAP or REST API)... I'm not aware of method to get these with REST calls I'm afraid. You might have to write a bit of Apex and expose a custom REST resource that will return this data. It's not that hard, see http://www.salesforce.com/us/developer/docs/apexcode/index_Left.htm#StartTopic=Content/apex_rest_code_sample_basic.htm for examples.

Thanks for your reply. Actually I am using PHP and trying to show list of views of any sObject using API.

I search in google and I came to know that, SAlesforce provide matadata API using SOAP only. help.salesforce.com/ . But I can`t use SOAP due to some restrictions. So can anyone tell me how to access list view of salesforce using http request from PHP?

Thank you. I saw your link. I can`t use any apex code, because I am implementing a web app in PHP where User will provide their Salesforce login credential and I have to fetch all Objects from Salesforce. Then they will select any Object and I have to show them all listviews for that selected object. So there is no fixed Salesforce Instance wheere I can write some Apex code.

No metadata API, no Apex... Sorry, if there's a way I'm not aware of any, maybe somebody else will post a better answer. You can also try asking on dedicated stack site: salesforce.stackexchange.com But I'm very doubtful. The getListViewOptions() would return you list of IDs, not their definitions (so you could recreate the columns & filter criteria in PHP) :( Best I could come up with was "recent items" (REST call to URL like /services/data/v26.0/sobjects/Account

rest - How to retrieve list views of any salesforce object using API? ...

api rest soap salesforce
Rectangle 27 0

I am sending http request to SAlesforce and passing soap body inside it. My code is following.

<?php
    error_reporting(E_ALL); 
    ini_set("display_errors", 1);
    require_once('salesforce.php');
    $username = 'amarnijersf1@gmail.com';
    $password = 'Rajib_1234ZpqndDYq1VWfOnLbCZc380gq5';
    $sforceWsdl = 'partner.xml';
    $sfdc = new salesforce($sforceWsdl);
    $loginResult = $sfdc->login($username, $password);
    //print_r($loginResult);
    $batchSize = new soapval('batchSize', null, 2);
    $sfdc->setHeader('QueryOptions', array($batchSize));
    if (!$loginResult){
        print_r("\nUnable to connect database: \n\n");
        print_r($sfdc->result);
        exit;
    }else{
        //print_r($sfdc->result['result']);
        $res = $sfdc->result['result'];
        $sesId = '';
        foreach($res as $k=>$v){
            if($k == 'sessionId'){
                $sesId = $v;
            }
        }

        $req = new HttpRequest('https://ap1-api.salesforce.com/services/Soap/m/26.0', HttpRequest::METH_POST);
        $req->addHeaders(array('Content-Type' => 'text/xml','SOAPAction' => 'retrieve'));
        $StrBody = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:met="http://soap.sforce.com/2006/04/metadata">';
            $StrBody .= '<soapenv:Header>';
                $StrBody .= '<met:CallOptions>';
                    $StrBody .= '<met:client>sample client</met:client>';
                $StrBody .= '</met:CallOptions>';
                $StrBody .= '<met:SessionHeader>';
                    $StrBody .= '<met:sessionId>'.$sesId.'</met:sessionId>';
                $StrBody .= '</met:SessionHeader>';
            $StrBody .= '</soapenv:Header>';
            $StrBody .= '<soapenv:Body>';
                $StrBody .= '<met:retrieve>';
                    $StrBody .= '<met:retrieveRequest>';
                        $StrBody .= '<met:apiVersion>26.0</met:apiVersion>';
                        $StrBody .= '<met:singlePackage>true</met:singlePackage>';
                        $StrBody .= '<met:unpackaged>';
                            $StrBody .= '<met:types>';
                                $StrBody .= '<met:members>Contact</met:members>';
                                $StrBody .= '<met:name>CustomObject</met:name>';
                            $StrBody .= '</met:types>';
                            $StrBody .= '<met:version>26.0</met:version>';
                        $StrBody .= '</met:unpackaged>';
                    $StrBody .= '</met:retrieveRequest>';
                $StrBody .= '</met:retrieve>';
            $StrBody .= '</soapenv:Body>';
        $StrBody .= '</soapenv:Envelope>';

        $req->setBody($StrBody);
        try{
            echo $req ->send()->getBody();
        }catch (HttpException $ex) {
            echo $ex;
        }
    }
    ?>

source view of the result is below.

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/2006/04/metadata"><soapenv:Body><retrieveResponse><result><done>false</done><id>04s90000002BpE0AAK</id><state>InProgress</state></result></retrieveResponse></soapenv:Body></soapenv:Envelope>

So you call it a HTTP request but in fact it's a SOAP call ;) I thought you said you can't use SOAP?

rest - How to retrieve list views of any salesforce object using API? ...

api rest soap salesforce
Rectangle 27 0

There's a good primer on http://developer.force.com showing how to integrate .net with your Salesforce.com org. See it here.

Thank you for the link. I mentioned in my original post that I'm already able to update standard objects like Lead and Opportunity without a problem but I'm looking for examples of how to do more advanced things like update custom objects lists, etc.

But it's the exact same process for custom objects as it is for standard objects, you just change the names. Instead of Lead as the object, you update MyObject__c -- instead of the Lead Status field, your field might be MyField__c. Other than that, updating custom objects uses the very same process as updating standard objects.

c# - Create new custom object and add to list in Salesforce using API ...

c# api salesforce
Rectangle 27 0

In addition to what Daniel Ballinger said, the Soap API also does not allow the 'IN' clause in SOQL queries. It's stupid, but then again, that's 95% of Salesforce.

salesforce - I am receiving the error "Bind variables only allowed in ...

salesforce soql jitterbit
Rectangle 27 0

We use similar scheme to sync data from a subsidiary instance before we bring them up to the full feature instance. Jitterbit 4 has salesforce connectors which allow very easy creation of sync tasks (query/upsert, but even without the wizards its easy to use sf api service), you just need to chain pairs of operations (one web service call to load data from source, another to upset at destination using source record ID as external ID in destination).

crm - can you do multiple Salesforce deployments, putting most users i...

salesforce crm
Rectangle 27 0

I think Salesforce Metadata API can be helpful in that case. But the Problem is it returns the zip files. I am not sure that the xml file returned by the Retrieve call is serialized form of the Object returned by the Salesforce API from DescribeLayout Call.

Can I access all page layouts specific to an object via the Salesforce...

api salesforce
Rectangle 27 0

The create call is returning an error, but you don't check for it, the returned SaveResult will tell you why it didn't create the user, you want something like

SaveResult[] results = connection.create(new SObject[] { user });
if (results[0].isSuccess())
    System.out.println("Created user: " + results[0].getId());
else
    System.out.println("Error: " + results[0].getErrors()[0].getStatusCode() + 
                       ":" + results[0].getErrors()[0].getMessage());

Hey thanks superfell, you are King! It solved my problem as I was able to understand where things were going wrong. Thanks again.

How to create a SalesForce 'User' with SOAP Partner API? - Stack Overf...

soap user salesforce
Rectangle 27 0

If you're using Salesforce's REST API try to use a wrapper client library, like SalesforceSharp.

SalesforceSharp supports many operations on Salesforce REST API, like POST:

client.Create("YourRecordEntityName", 
   new { Name = "name created", Description = "description created" }));

c# - Salesforce returns Unknown Error while trying to insert using RES...

c# .net rest salesforce
Rectangle 27 0

I'm not aware of any programmatic way to do that. Conga app could be one option but I believe they get the filters from the report's metadata and construct a matching SOQL query...

Hack, error-prone, web-scraping way would be to use something similar to trick I did with Apex: http://salesforce.stackexchange.com/questions/4303/scheduled-reports-as-attachment. Theoretically you'd be able to pull off similar thing from any other API access as long as you have the user's session Id (whether passed from logged in session or generated yourself from SOAP login call...)

api - Is there a programmatic interface for retrieving/exporting Repor...

api report salesforce
Rectangle 27 0

OK, got it, There is the describeSObjects() method which returns all the objects as describeSObject() which have all the required data to query any element. Cheers

Salesforce PHP SOAP API get custom object - Stack Overflow

php api soap salesforce
Rectangle 27 0

I also haven't seen any documentation about this, but if you look at the object metadata returned by the REST API for any standard object, it seems that the suffix 'Id' is appended to any field of type "reference". For example, Case has OwnerId, LastModifiedById, CreatedById, etc. This suffix is not present in the field names displayed in the browser interface. The WSDL for the SOAP API includes both the ID as a simple element of type "ID", as well as a complex child element for nesting the actual record.

Create Salesforce Case object with nested relationships using REST API...

api rest salesforce
Rectangle 27 0

Account.Name is not an external Id field! And neither is AccountNumber for that matter. I guess you're confused because it can be used as match field for de-duplication in "import my accounts & contacts" etc?

Schema.DescribeFieldResult f = Account.Name.getDescribe();
System.debug(f.isExternalID());  // false
System.debug(f.isUnique());      // false
System.debug(f.isIdLookup());    // false

You'll need to create your own Ext. Id. field if you want to use it in upserts (and fill it with data). In my org we have custom Account_Number__c...

Thanks eyescream for your genuine Answer. Does every Standard Salesforce Object behave in this manner in case of performing upsert operations using Bulk API? Thanks, Sanchit

I think so. As far as I know none of standard objects has any Ext ID or Unique field, it's entirely up to us how we customize them. (well OK, User.Username is unique but you get the idea). If you're 100% sure your acc. names will be unique - make your own Name__c field, setup a workflow that would fill it on ISNEW() || ISCHANGED(Name) and make a data fix to fill records you have so far, shouldn't be too hard :)

Could be a more recent addition of Salesforce API, but the latest docs on upsert() say this: "On standard objects, this call can use the name of any field with the idLookup field property instead of the external ID." And IDs do have this property.

java - Bulk API errors: Upsert on Standard Salesforce Object - Stack O...

java salesforce bulkinsert bulkloader bulk-load
Rectangle 27 0

It works fine with Salesforce REST API query datetime formats

DateTime now = DateTime.UtcNow;
string startDate = now.AddDays(-5).ToString("yyyy-MM-ddTHH\\:mm\\:ssZ");   
string endDate = now.ToString("yyyy-MM-ddTHH\\:mm\\:ssZ");  
//REST service Query 
string salesforceUrl= https://csxx.salesforce.com//services/data/v33.0/sobjects/Account/updated/?start=" + startDate + "&end=" + endDate;

// https://csxx.salesforce.com/services/data/v33.0/sobjects/Account/updated/?start=2015-03-10T15:15:57Z&end=2015-03-15T15:15:57Z

It returns the results from Salesforce without any issues.

c# - date format yyyy-MM-ddTHH:mm:ssZ - Stack Overflow

c#