• lonedeveloper
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies

Hi,

 

We implemented OAuth 2.0 using Web Server Authentication Flow. It was working fine in October/November but all of a sudden it has stopped working. Whenever we try authorising a new client the server return (400) Bad Request with the body

 

{"error":"unsupported_grant_type","error_description":"grant type not supported"}

 

grant_type is set as authorization_code which is definitely valid.

 

Is there any reason why OAuth would suddenly stop working?

 


This is how we have implemented OAuth:

 

First user is directed to: https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=blah.id&redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx&scope=api%20refresh_token

 

User is prompted by Salesforce to login to their account.

 

Once user is authenticated Salesforce calls Callback.aspx, Callback.aspx requests refresh token on behalf of the client by making a POST request to: https://login.salesforce.com/services/oauth2/token with the payload:

grant_type=authorization_code&code=blah.code&client_id=blah.Id&client_secret=11111111&redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx

 

Content type is definitely: application/x-www-form-urlencoded

 

Many thanks,

Hi,

 

I am running Apex Job in before delete trigger and noticed the deletion of a single Campaign through Salesforce interface takes around 34 seconds and Apex Job has completed running when the Campaign is deleted using Salesforce interface.  When I run the same Apex Job on the same number of records (15,000) using VisualForce page runs instantly, the job is queued  and runs after the VisualForce page has completed.

 

In this screen shot the first job was queued using VisualForce and the second and third were queued using trigger:

 

Screen shot of Apex Jobs page

 

As you can see although the same number of records (15,000) are processed by the same Apex Job when it is queued using Trigger no batches are created (at least according to the user interface) and based on Submitted and Completed date the job is not Asynchronously. 

 

Apex Job is queued like this:

 

BatchDeleteResults batch = new BatchDeleteResults();
batch.deleteQuery = deleteQuery;
    	
ID batchId = Database.executeBatch(batch);

 

Has anyone else experienced something like this?

 

Thanks,

Hi,

 

I am writing trigger to delete custom objects upon deletion of a Campaign. 

 

Is there a limit of how many records can be deleted in a trigger?

 

I need to delete upto 300,000 records so wondering if this is possible to delete in a trigger. If not, is it possible to create Apex Job and execute in a trigger?

 

Thanks,

Hi,

My company is looking at possibility of developing and offering AppExchange application that will allow our customers to integrate our application with Salesforce CRM. So what license do we need for this?

Thanks.

Hi,

 

We implemented OAuth 2.0 using Web Server Authentication Flow. It was working fine in October/November but all of a sudden it has stopped working. Whenever we try authorising a new client the server return (400) Bad Request with the body

 

{"error":"unsupported_grant_type","error_description":"grant type not supported"}

 

grant_type is set as authorization_code which is definitely valid.

 

Is there any reason why OAuth would suddenly stop working?

 


This is how we have implemented OAuth:

 

First user is directed to: https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=blah.id&redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx&scope=api%20refresh_token

 

User is prompted by Salesforce to login to their account.

 

Once user is authenticated Salesforce calls Callback.aspx, Callback.aspx requests refresh token on behalf of the client by making a POST request to: https://login.salesforce.com/services/oauth2/token with the payload:

grant_type=authorization_code&code=blah.code&client_id=blah.Id&client_secret=11111111&redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx

 

Content type is definitely: application/x-www-form-urlencoded

 

Many thanks,

Hi,

 

I am running Apex Job in before delete trigger and noticed the deletion of a single Campaign through Salesforce interface takes around 34 seconds and Apex Job has completed running when the Campaign is deleted using Salesforce interface.  When I run the same Apex Job on the same number of records (15,000) using VisualForce page runs instantly, the job is queued  and runs after the VisualForce page has completed.

 

In this screen shot the first job was queued using VisualForce and the second and third were queued using trigger:

 

Screen shot of Apex Jobs page

 

As you can see although the same number of records (15,000) are processed by the same Apex Job when it is queued using Trigger no batches are created (at least according to the user interface) and based on Submitted and Completed date the job is not Asynchronously. 

 

Apex Job is queued like this:

 

BatchDeleteResults batch = new BatchDeleteResults();
batch.deleteQuery = deleteQuery;
    	
ID batchId = Database.executeBatch(batch);

 

Has anyone else experienced something like this?

 

Thanks,

Hi,

 

I am writing trigger to delete custom objects upon deletion of a Campaign. 

 

Is there a limit of how many records can be deleted in a trigger?

 

I need to delete upto 300,000 records so wondering if this is possible to delete in a trigger. If not, is it possible to create Apex Job and execute in a trigger?

 

Thanks,

As soon as I try to query data using the Bulk API (24.0) and use a relationship I get the following message:

 

InvalidBatch : Failed to process query: FUNCTIONALITY_NOT_ENABLED: Foreign Key Relationships not supported in Bulk Query

 

According to the docs this is not a limitation of the Bulk API.  Is it possible to perform a query like: "SELECT Id, FIrstName, LastName, Account.Name FROM Contact"  or are we limited to a single table?

 

GlennW

Hi,

My company is looking at possibility of developing and offering AppExchange application that will allow our customers to integrate our application with Salesforce CRM. So what license do we need for this?

Thanks.