• Zachariah Rosenberg
  • NEWBIE
  • 25 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 7
    Questions
  • 5
    Replies
Hello,

I'm trying to strategize how best to run this series of SOQL queries without triggering the limits. I have a csv of approximately 10,000 records. The goal is to check for each record whether there is a contact.owner.name associated with it. For instance (not complete, of course):

For(integer i:[csv file]){
SELECT Contact.Owner.Name. Contact.Custom_Field__c FROM Contact WHERE Contact.Custom_Field__c = csvFile[i]
}

How would you recommend I grab the data for all 10,000 records?

Thank you so much for your time and consideration of my inquiry.

With gratitude,
Zac
Hello,

Im trying to write a SOQL query that will grab one of the Contact object's standard fields "Contact Owner", which is a Lookup(User) field.

The field name is "Owner", but when I try to query

SELECT Contact.Owner FROM Contact

I get an error stating that there is no such field.

How can I grab this field?

Thank you!
Hello,

I'm trying to write an REST aPI call from my google sheets. I originally wrote the call in python, which worked wonderfully. Porting it to JS on google apps, I'm getting a "grant_type" error:
 
function authenticateSF(){

  var url = 'https://login.salesforce.com/services/oauth2/token';
  var options = {
    grant_type:'password',
    client_id:'XXXXXXXXXXX',
    client_secret:'111111111111',
    username:'ITSME@smee.com',
    password:'smee'
  };

  var results = UrlFetchApp.fetch(url, options);
}

Produces:
 
Request failed for https://login.salesforce.com/services/oauth2/token returned code 400. Truncated server response: {"error_description":"grant type not supported","error":"unsupported_grant_type"} (use muteHttpExceptions option to examine full response) (line 12, file "Code")

I saw someone else on this board had a similar problem (https://developer.salesforce.com/forums/#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F00000009At3IAE), and he just went the OAuth route. I'd prefer not to, if possible. 

What might the issue be?

Thank you!
 
Hello,

I'm going through the Salesforce API REST guide, and I'm trying to authenticate via session id. My script is in python:

    import urllib, urllib2
    url = 'https://login.salesforce.com/services/oauth2/token'
    values = {
        "grant_type":"password",
        "client_id":"aaaaaaaaaaaa11111111111111",
        "client_secret":"1111111111111",
        "username":"myuser@domain.com",
        "password":"mypassword"
    }
    data = urllib.urlencode(values)
    req = urllib2.Request(url,data)
    sf = urllib2.urlopen(req)

I'm receiving a 400 Error:

    Traceback (most recent call last):
      File "/Users/ZR/Desktop/sf.py", line 14, in <module>
        sf = urllib2.urlopen(req)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 127, in urlopen
        return _opener.open(url, data, timeout)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 410, in open
        response = meth(req, response)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 523, in http_response
        'http', request, response, code, msg, hdrs)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 448, in error
        return self._call_chain(*args)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
        result = func(*args)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 531, in http_error_default
        raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    urllib2.HTTPError: HTTP Error 400: Bad Request
    [Finished in 0.4s with exit code 1]

Where have I gone wrong?

Thank you!