• JD Bell
  • NEWBIE
  • 0 Points
  • Member since 2014

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

I want to get the relative URL for the static resource in a controller. The StaticResrouce object does not seem to have any information about the number (1300899525000)  I see in the relative URL.

https://na7.salesforce.com/resource/1300899525000/Image_DefaultProductIcon

  • March 23, 2011
  • Like
  • 0
Hi everyone,

I'm getting too many redirects error on the page when I preview lightning apps. It was working fine until last night and I'm suddenly getting this, I tried on all different browsers Chrome, Safari, and FireFox without luck. I also tried on incognito window but it didn't help. The app from trailhead tutorial is also displaying the same error when I click preview. Any ideas?

Thanks in advance!

A customer received this exception:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Apex script unhandled exception by user/organization: <userId>/<orgId>

Visualforce Page: /apex/g2wintegration__g2wInitialize

 

caused by: System.ListException: Row with duplicate Name at index: 2

Class.g2wIntegration.g2wUtils.g2wAccessTokenURL: line 99, column 1
Class.g2wIntegration.g2wInitializeController.autoRun: line 24, column 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Line 99 refers to this line, which invokes the code to grab the custom list setting rows:

Map<String, G2WAccessTokens__c> tokens = G2WAccessTokens__c.getAll();

 

I interpret that error as there are two custom setting rows with the same name - is that accurate? If so, there seems to be a bug in Custom Settings.

In any custom list setting, the name must be unique, but somehow this was not the case for this customer.

 

We set the name to the UserId and have additional checks to ensure if the setting exists, that it gets updated versus trying to insert a new one. Even if code wasn't in place, inserting a 2nd row with the same name throws an exception in Apex, but that didn't happen.

 

Is there any way 2 custom list setting rows can be inserted twice?  All of our tests to reproduce this issue throw exceptions as Apex doesn't allow inserting 2 with the same name.  

I am following the guidelines from the Chatter guide and somehow I can't get the OAuth to work. 

 

It's not working from Java or curl.   Here is what I am doing:

 

mike$ curl --form client_id=3MVG9yZ.WNe6bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxu5AjB4oT9kxi8SEhY --form client_secret=26542xxxxxxxxxxx78  --form grant_type=password --form username=xxxxxxxx@gmail.com --form password=xxxxxxx https://na11.salesforce.com/services/oauth2/token

 

What I am getting is:

{"error":"invalid_grant","error_description":"authentication failure - Invalid Password"}

 

I double checked and I am getting into na11 with the right password.  Is there anything else I need to do?

 

Here are the settings in my remote access:

 



Applicationchatter



Callback URLhttps://na11.salesforce.com/ConnectTest/oauth/_callback /// temp one



No user approval required for users in this organizationNot Checked