• Elsa Roussel
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
I need to retreive an SSL flow (https://myflow.com/)

Our client had to change his certificate to one which issuer is know by Salesforce [geotrustglobalca]
I add the flow (https://myflow.com/) in the remote site settings.
But i still have the error folowing when trying to reitrive any information :
"System.CalloutException: sun.security.validator.ValidatorException: 
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"


If i analyze the SSL cerytificate using https://www.ssllabs.com, the only thing that's different from the doc is the issuer name :
in the doc i have something like [ Issuer: CN=GeoTrust Global CA, O=GeoTrust Inc., C=US ],
while i have [ Issuer : GeoTrust DV SSL CA ]...

Has anyone got an idea of what's going on ?
Is that Salesforce just doesn't recognise the certificat because the spelling is different ?
Or is there other settings to do that i'm unaware of ?

Thank you !

PS: I Have already check the SF doc on remote site connections and both-way auth...
Hello,
I have this errore while trying to deploy from the sand box to the production (no error in SB).
I'm setting up a new community with simple portal community licence (role are disable in this licence) and i'm fetching a existing user as the account owner :

adminProfile = [SELECT Id FROM Profile WHERE Name IN ('Administrateur système', 'System Administrator')].Id;
roleId = [SELECT Id FROM UserRole WHERE Name ='XXXX' ].Id;
List <User> ownerpossible = [SELECT Id, Name FROM User WHERE IsActive = True AND UserRoleId =:roleId AND ProfileId= :adminProfile LIMIT 1];

Any idea ?
(I've try this method http://blog.jeffdouglas.com/2010/09/02/error-portal-account-owner-must-have-a-role/ but the user doesn't have a role either)
thx
Hello,
I try to use a button or link to call an specific method in my controller but i can't seem to make it work...
This is the methode : 
public with sharing class newAssetssss_CONTROLLER {
/* the all controller code */
/* blablablabla */
public PageReference miseAJourAsset(){
System.debug('IS THERE ANYONE HERE ??????');
PageReference pageRedirect = new PageReference('http://www.google.com'); return pageRedirect; }
// OR :
// public PageReference miseAJourAsset(){
// System.debug('IS THERE ANYONE HERE ??????');
// return null;
// } }

and then the Visualforces : 

<!-- 1st try -->
<apex:page controller="newAssetssss_CONTROLLER">
<apex:form > <apex:pageMessages />
<apex:sectionHeader ><h1> THE HEADER ! </h1></apex:sectionHeader>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandbutton value="my button" action="{!miseAJourAsset}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!thelist}" var="listUpdatable">
<!-- the all table -->
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

<!-- Other try -->
<apex:page controller="newAssetssss_CONTROLLER">
<apex:form > <apex:pageMessages />
<apex:actionFunction name="miseAJourAsset" action="{!miseAJourAsset}" rerender="refresh"/>
<apex:sectionHeader ><h1> THE HEADER ! </h1></apex:sectionHeader>
<apex:pageBlock >
<apex:pageBlockButtons >
<input type="button" value="my button" onclick="miseAJourAsset();" />
<!-- <apex:commandbutton value="my button" onclick="miseAJourAsset();"/> -->
</apex:pageBlockButtons> <apex:pageBlockTable value="{!thelist}" var="listUpdatable">
<!-- the all table -->
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

In the debug consol i don't have the "System.debug('IS THERE ANYONE HERE ??????')" message, and when i click on the button (or link, because i tried with apex:commandLink too) the page is just refresh (no redirection, no change, nothing)...
What did I miss ?
 
When I try to deploy some component (without any link to chatter) i have the error : 

"ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser(), Details: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ProfileId]: [ProfileId] Class.ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser: line 31, column 1"

the test class ask for a ProfileId, while i can't modify it.

Name                            Version       Nom d'espace       Type
API salesforce.com        33.0             API                     salesforce.com
____________________________________________________________________________________________________
@isTest
private class ChatterAnswersAuthProviderRegTest {
  static testMethod void validateCreateUpdateUser() {
    User thisUser = [ select Id from User where Id = :UserInfo.getUserId() ];
    System.runAs ( thisUser ) {
      Auth.UserData userData = new Auth.UserData('testId', 'testFirst', 'testLast',
      'testFirst testLast', 'no-reply@salesforce.com', null, 'testuserlong', 'en_US', 'facebook',
      null, new Map<String, String>{'language' => 'en_US'});
      ChatterAnswersAuthProviderRegistration reg = new ChatterAnswersAuthProviderRegistration();
      Profile[] p = [SELECT Id FROM Profile WHERE Name = 'System Administrator'];
      User[] adminUser = [SELECT Id, Firstname, Lastname FROM User WHERE IsActive = true and ProfileId =: p[0].Id LIMIT 1];
      reg.setSiteAdminUserId(adminUser[0].Id);
      User newUser = reg.createUser(null, userData);
      System.assert(newUser != null, 'A new user should have been created');
      System.assertEquals(newUser.Firstname, 'testFirst', 'First name should have been same');
      System.assertEquals(newUser.Lastname, 'testLast', 'Last name should have been same');
      System.assertEquals(newUser.Email, 'no-reply@salesforce.com', 'Email should have been same');
      
      Contact c = new Contact();
      c.AccountId = (newUser.Username.split('@'))[0];
      c.LastName = 'contactLast';
      insert(c);
      
      newUser.Alias = 'firstusr';
      newUser.TimeZoneSidKey = 'America/Los_Angeles';
      newUser.LocaleSidKey = 'en_US';
      newUser.EmailEncodingKey = 'UTF-8';
      newUser.LanguageLocaleKey = 'en_US';
      newUser.ContactId = c.Id;
      // newUser.ProfileId = [SELECT Id FROM Profile WHERE Name = 'Standard User' LIMIT 1].Id;  [try to add this but i can't save]

      insert(newUser); // <= this is where the error is located :
      
      Auth.UserData updateUserData = new Auth.UserData('testId', 'updatedFirst', 'updatedLast',
      'updatedFirst updatedLast', 'no-reply@new.salesforce.com', null, 'testuserlong', 'en_US', 'facebook',
      null, new Map<String, String>{'language' => 'en_US'});
      reg.updateUser(newUser.Id, null, updateUserData);
      
      User dbUser =  [SELECT Id, Firstname, Lastname, Email FROM User WHERE Id = :newUser.Id];
      System.assertEquals(dbUser.Firstname, 'updatedFirst', 'First name should have been updated');
      System.assertEquals(dbUser.Lastname, 'updatedLast', 'Last name should have been updated');
      System.assertEquals(dbUser.Email, 'no-reply@new.salesforce.com', 'Email should have been updated');
    }
  }
}
________________________________________________________________________________________________
Hello,
I try to use a button or link to call an specific method in my controller but i can't seem to make it work...
This is the methode : 
public with sharing class newAssetssss_CONTROLLER {
/* the all controller code */
/* blablablabla */
public PageReference miseAJourAsset(){
System.debug('IS THERE ANYONE HERE ??????');
PageReference pageRedirect = new PageReference('http://www.google.com'); return pageRedirect; }
// OR :
// public PageReference miseAJourAsset(){
// System.debug('IS THERE ANYONE HERE ??????');
// return null;
// } }

and then the Visualforces : 

<!-- 1st try -->
<apex:page controller="newAssetssss_CONTROLLER">
<apex:form > <apex:pageMessages />
<apex:sectionHeader ><h1> THE HEADER ! </h1></apex:sectionHeader>
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandbutton value="my button" action="{!miseAJourAsset}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!thelist}" var="listUpdatable">
<!-- the all table -->
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

<!-- Other try -->
<apex:page controller="newAssetssss_CONTROLLER">
<apex:form > <apex:pageMessages />
<apex:actionFunction name="miseAJourAsset" action="{!miseAJourAsset}" rerender="refresh"/>
<apex:sectionHeader ><h1> THE HEADER ! </h1></apex:sectionHeader>
<apex:pageBlock >
<apex:pageBlockButtons >
<input type="button" value="my button" onclick="miseAJourAsset();" />
<!-- <apex:commandbutton value="my button" onclick="miseAJourAsset();"/> -->
</apex:pageBlockButtons> <apex:pageBlockTable value="{!thelist}" var="listUpdatable">
<!-- the all table -->
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

In the debug consol i don't have the "System.debug('IS THERE ANYONE HERE ??????')" message, and when i click on the button (or link, because i tried with apex:commandLink too) the page is just refresh (no redirection, no change, nothing)...
What did I miss ?
 
When I try to deploy some component (without any link to chatter) i have the error : 

"ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser(), Details: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [ProfileId]: [ProfileId] Class.ChatterAnswersAuthProviderRegTest.validateCreateUpdateUser: line 31, column 1"

the test class ask for a ProfileId, while i can't modify it.

Name                            Version       Nom d'espace       Type
API salesforce.com        33.0             API                     salesforce.com
____________________________________________________________________________________________________
@isTest
private class ChatterAnswersAuthProviderRegTest {
  static testMethod void validateCreateUpdateUser() {
    User thisUser = [ select Id from User where Id = :UserInfo.getUserId() ];
    System.runAs ( thisUser ) {
      Auth.UserData userData = new Auth.UserData('testId', 'testFirst', 'testLast',
      'testFirst testLast', 'no-reply@salesforce.com', null, 'testuserlong', 'en_US', 'facebook',
      null, new Map<String, String>{'language' => 'en_US'});
      ChatterAnswersAuthProviderRegistration reg = new ChatterAnswersAuthProviderRegistration();
      Profile[] p = [SELECT Id FROM Profile WHERE Name = 'System Administrator'];
      User[] adminUser = [SELECT Id, Firstname, Lastname FROM User WHERE IsActive = true and ProfileId =: p[0].Id LIMIT 1];
      reg.setSiteAdminUserId(adminUser[0].Id);
      User newUser = reg.createUser(null, userData);
      System.assert(newUser != null, 'A new user should have been created');
      System.assertEquals(newUser.Firstname, 'testFirst', 'First name should have been same');
      System.assertEquals(newUser.Lastname, 'testLast', 'Last name should have been same');
      System.assertEquals(newUser.Email, 'no-reply@salesforce.com', 'Email should have been same');
      
      Contact c = new Contact();
      c.AccountId = (newUser.Username.split('@'))[0];
      c.LastName = 'contactLast';
      insert(c);
      
      newUser.Alias = 'firstusr';
      newUser.TimeZoneSidKey = 'America/Los_Angeles';
      newUser.LocaleSidKey = 'en_US';
      newUser.EmailEncodingKey = 'UTF-8';
      newUser.LanguageLocaleKey = 'en_US';
      newUser.ContactId = c.Id;
      // newUser.ProfileId = [SELECT Id FROM Profile WHERE Name = 'Standard User' LIMIT 1].Id;  [try to add this but i can't save]

      insert(newUser); // <= this is where the error is located :
      
      Auth.UserData updateUserData = new Auth.UserData('testId', 'updatedFirst', 'updatedLast',
      'updatedFirst updatedLast', 'no-reply@new.salesforce.com', null, 'testuserlong', 'en_US', 'facebook',
      null, new Map<String, String>{'language' => 'en_US'});
      reg.updateUser(newUser.Id, null, updateUserData);
      
      User dbUser =  [SELECT Id, Firstname, Lastname, Email FROM User WHERE Id = :newUser.Id];
      System.assertEquals(dbUser.Firstname, 'updatedFirst', 'First name should have been updated');
      System.assertEquals(dbUser.Lastname, 'updatedLast', 'Last name should have been updated');
      System.assertEquals(dbUser.Email, 'no-reply@new.salesforce.com', 'Email should have been updated');
    }
  }
}
________________________________________________________________________________________________