• hunkhere
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies

Hi,

 

I want to integrate Salesforce with the external Systems and get the external System data into salesforce and save that data in one of salesforce Object.

 

I have following with me

 

External Systems Credentials

Extrnal Systems JSON/XML

and Salesforce Credential.

 

Could you please let me know how do I start with it???

 

 

Hi ,

 

Generally LookUp Field will do search on Record Name, Will it do the search on EXTERNAL ID Field???

 

 

 

Hello Everyone,

 

  I have a requirement, when users fills the data in the VF Page and clicks save/submit button, after clciking the VF Page should be Read-only and should not be editable.

 

Please help me out

 

 

Thanks

 

I can't get the autocreatedreghandler to work for single sign-on (SSO) into our community. I want users to be able to register using their google accounts.  This is the Apex Class I'm using, which was autogenerated by Salesforce when I set up the Auth provider. The Account "Self-Registered Community Users" exists in my environment, and the Profile "Customer Community Login User" exists. Any help is appreciated!
 
//TODO:This autogenerated class includes the basics for a Registration
//Handler class. You will need to customize it to ensure it meets your needs and
//the data provided by the third party.

global class AutocreatedRegHandler1437665762204 implements Auth.RegistrationHandler{
global boolean canCreateUser(Auth.UserData data) {
  //TODO: Check whether we want to allow creation of a user with this data
  //Set<String> s = new Set<String>{'usernamea', 'usernameb', 'usernamec'};
  //if(s.contains(data.username)) {
    //return true;
  //}
  return false;
}

global User createUser(Id portalId, Auth.UserData data){
 // if(!canCreateUser(data)) {
    //Returning null or throwing an exception fails the SSO flow
   // User u = [Select Id , username from User where email =: data.email];
     //   return u;
  //}
  if(data.attributeMap.containsKey('sfdc_networkid')) {
    //We have a community id, so create a user with community access
    //TODO: Get an actual account
    Account a = [SELECT Id FROM account WHERE name='Self-Registered Community Users'];
    Contact c = new Contact();
    c.accountId = a.Id;
    c.email = data.email;
    c.firstName = data.firstName;
    c.lastName = data.lastName;
    insert(c);

    //TODO: Customize the username and profile. Also check that the username doesn't already exist and
    //possibly ensure there are enough org licenses to create a user. Must be 80 characters or less.
    User u = new User();
    Profile p = [SELECT Id FROM profile WHERE name='Customer Community Login User'];
    u.username = data.username;
    u.email = data.email;
    u.lastName = data.lastName;
    u.firstName = data.firstName;
    String alias = data.username;
    //Alias must be 8 characters or less
    if(alias.length() > 8) {
      alias = alias.substring(0, 8);
    }
    u.alias = alias;
    u.languagelocalekey = UserInfo.getLocale();
    u.localesidkey = UserInfo.getLocale();
    u.emailEncodingKey = 'UTF-8';
    u.timeZoneSidKey = 'America/Los_Angeles';
    u.profileId = p.Id;
    u.contactId = c.Id;
    return u;
  } else {
    //This is not a community, so create a regular standard user
    User u = new User();
    Profile p = [SELECT Id FROM profile WHERE name='Standard User'];
    //TODO: Customize the username. Also check that the username doesn't already exist and
    //possibly ensure there are enough org licenses to create a user. Must be 80 characters
    //or less.
    u.username = data.username + '@SRCU.com';
    u.email = data.email;
    u.lastName = data.lastName;
    u.firstName = data.firstName;
    String alias = data.username;
    //Alias must be 8 characters or less
    if(alias.length() > 8) {
      alias = alias.substring(0, 8);
    }
    u.alias = alias;
    u.languagelocalekey = UserInfo.getLocale();
    u.localesidkey = UserInfo.getLocale();
    u.emailEncodingKey = 'UTF-8';
    u.timeZoneSidKey = 'America/Los_Angeles';
    u.profileId = p.Id;
    return u;
  }
}

global void updateUser(Id userId, Id portalId, Auth.UserData data){
  User u = new User(id=userId);
  //TODO: Customize the username. Must be 80 characters or less.
  //u.username = data.username + '@myorg.com';
  u.email = data.email;
  u.lastName = data.lastName;
  u.firstName = data.firstName;
  //String alias = data.username;
  //Alias must be 8 characters or less
  //if(alias.length() > 8) {
    //alias = alias.substring(0, 8);
  //}
  //u.alias = alias;
  update(u);
}
}

 

Hi ,

 

Generally LookUp Field will do search on Record Name, Will it do the search on EXTERNAL ID Field???

 

 

 

Hello Everyone,

 

  I have a requirement, when users fills the data in the VF Page and clicks save/submit button, after clciking the VF Page should be Read-only and should not be editable.

 

Please help me out

 

 

Thanks