• Vaughan Coder 6
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
I am trying to confirm based on this document: https://resources.docs.salesforce.com/202/latest/en-us/sfdc/pdf/salesforce_platform_encryption_implementation_guide.pdf on page 9, there is no way to encrypt the lead standard fields. Is this correct?
Hello All,

I am attempting to send out a group of reports individually to end users. The record ownership model that the org uses doesn't allow for dynamic reports. (The users may not own the records they need to report on) These users need weekly scheduled reports as well as a quarterly review report.

To my question: Does using apex scheduling to schedule reports to run quarterly prevent the weekly report from running if they end up being scheduled at the same time? Is there a priority between reports scheduled in the UI and apex scheduling of reports? Are there any system limitations I am likely not considering that will cause problem down the line?

Thanks!

Hello all,
I am using conga composer to generate a cuistom quote pdf. When sort order is used in the quote, the line items populate correctly on the pdf. (Hooray!) Unfortunately if the rows are never sorted, this does not happen. I believe the reason is that the sort order is not populated until it is sorted.

A display of sort order functionality
After I save the sort order this is what displays
Display of sort order functionality

Is there anyway to force the sort order to be generated automatically?

I'm trying to access the API of a sandbox instance using OAuth. 

1. I redirect the user to test.salesforce.com
2. The user confirms access and is redirected back to me
3. I exchange the code for a refreshToken
4. I immediately exchange the refresh_token for a new access_token using this command:

curl -X POST --data 'refresh_token=[refresh token form step 3]&client_id=[my client id]&client_secret=[my client secret]&grant_type=refresh_token' -H 'Accept: application/json' -H 'Sforce-Call-Options: client=fivetran' -H 'Content-Type: application/x-www-form-urlencoded' 'https://test.salesforce.com/services/oauth2/token'

Salesforce replies:

{"error":"invalid_grant","error_description":"expired access/refresh token"}

How can the token be expired? It was just issued. I have also used this exact same application logic to connect to production salesforce instances successfully (with a different application configuration, and using login.salesforce.com instead of test.salesforce.com).
I store the accessToken and refresh token so I can refresh it at some point in the future when the access token is no longer valid.  However, it seems that the refresh token would expired at some point or get invalidated automatically.  Can someone explain the lifetime of a refresh token?

in Digging_Deeper_into_OAuth_2.0_on_Force.com (https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com).  It is mentioned that it is only revoked by the user:
The refresh token represents the user's authorization to the application, and is valid until explicitly revoked by the user, via My Settings ➤ Personal ➤ Advanced User Details ➤ OAuth Connected Apps.
However, there is an edit in the same doc that mentiones that refresh token also have an expiration time:

The refresh token may have an indefinite lifetime, persisting for an admin-configured interval or until explicitly revoked by the end-user. The client application can store the refresh token, using it to periodically obtain fresh access tokens, but should be careful to protect it against unauthorized access, since, like a password, it can be repeatedly used to gain access to the resource server.
Since refresh tokens may expire or be revoked by the user outside the control of the client application, the client must handle failure to obtain an access token, typically by replaying the protocol from the start.

From http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com#Token_Refresh:

In this situation, the client application can use the refresh token to obtain a new access token. The refresh token represents the user's access grant to the application, and is valid until explicitly revoked by the user, via Setup ➤ My Personal Information ➤ Remote Access.

This is untrue.

I have a remote application that uses the OAuth web server flow. After I generate refresh and access tokens for a user, I fetch that user's data (accounts, contacts, leads, etc.) periodically. When the access token expires I generate a new one using the refresh token. This all happens in a long running process.

If I kill this process and start it up the next day or a few hours later, I receive an error message from the API telling me that the access token / refresh token has expired. If I try to refresh the token, I receive the same error message from the refresh token API endpoint. I take this to mean that the refresh token has also expired.

The user has not revoked access to the application nor has logged into any salesforce related applications or created any new salesforce browsing sessions. So nothing has happened except the passing of time.

Why is this happening? Can I prevent this in any way? As it stands now, this totally defeats the purpose of the refresh token schema.

Update:

Since there are no replies and many views: Does anyone periodically fetch data from salesforce accounts without storing a user's username and password, and without having the user's constantly reauthorize your external application? What does your workflow look like?

Is it possible to create a Custom Settings object in the IDE?  I have the metadata file for a custom settings object, but when I paste in the XML and try to save it, I get an error "cannot change Custom Settings Type"

 

thanks

david