• Fabian Manzano 6
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 5
    Replies
If there is a possiblity, then

Can I get a code sample (having @http post method) on how to upload pdf file into salesforce object (say as an attachment) sent to salesforce with a http request using multipart/from-data from some external site.

For a while I've gone through multipart/form-data in the developer forum, but I could only find the HTTP Request samples made from salesforce and not to salesforce.

Thanks,
Leafen.
This no longer works as described in the Trailhead.  Selecting "User with Limited Access to Treasures" on the CRUD & FLS Visualforce Demo tab yields an "insufficient access" error with no data returned.
I recently got Data Loader 39 and was trying to update settings for updating nulls.  I can't seem to save the settings.  I scroll to bottom of settings the screen won't go to the end and can't save.  I'm I missing a step?


User-added image
I have to use Oauth JWT flow to got the access token but while i execute my code then it show me following error,
 
{
     "error" : "invalid_grant",
     "error_description" : "user hasn't approved this consumer"
}

I setup all the related things like create the App and upload the certificate and also create the currect JWT token as per doc Here
and post the following request for access token,
 
HttpPost httpPost = new HttpPost("https://login.salesforce.com/services/oauth2/token");
httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded");
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("grant_type", "urn:ietf:params:oauth:grant-type:jwt-bearer"));
params.add(new BasicNameValuePair("assertion", clientAssertion));			
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse response = httpClient.execute(httpPost);

And I also accept the application and related permission by following request,

https://login.salesforce.com/services/oauth2/authorize?client_id=3MVG9ZL0ppGP5UrDITkMBDGuTYGHeynoEt40ZRWCcaYsycFHYDcm2LnqukCNurLNx33LH1c.0rrfG8VrQaqri&redirect_uri=https://localhost/myapp&response_type=code     

I think I done all the things to get the access token but I M GETTING ERROR.
Could you please somebody help me for solving this problem.
Thank You. 

Every time I try to run this query i get only 2 results:

 

Attachments[] records = [Select Name, ParentId, OwnerId, Id, Body, ContentType, Description, IsPrivate From Attachment Where Parent.Type IN ('File__c') AND Owner.IsActive = true];

 

I know including "Body" field will limit number of records returned in Eclipse to only 1, BUT I'm using this query in APEX class and in Debug Log as well but I'm only able to read 2 record everytime, but the total count of Attachment record returned from this query Should be 4152 records which it is not giving.

 

Is it some Bug?

  • March 03, 2012
  • Like
  • 1

Every time I try to run this query i get only 2 results:

 

Attachments[] records = [Select Name, ParentId, OwnerId, Id, Body, ContentType, Description, IsPrivate From Attachment Where Parent.Type IN ('File__c') AND Owner.IsActive = true];

 

I know including "Body" field will limit number of records returned in Eclipse to only 1, BUT I'm using this query in APEX class and in Debug Log as well but I'm only able to read 2 record everytime, but the total count of Attachment record returned from this query Should be 4152 records which it is not giving.

 

Is it some Bug?

  • March 03, 2012
  • Like
  • 1