• Dheeraj_Upadhyay
  • NEWBIE
  • 83 Points
  • Member since 2015


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

I have to implement 2 validation rule on a text field
1st one to check the required. (make field mandatory)
2nd one will be fired if 1st is OK. It will check if the field has 14 characters.

I also need a custom error messages.

Thank you for suggestions
  • November 30, 2015
  • Like
  • 0
Hi there,

I have a knowledge Article, which I want to translate to another langauge from english.
When I submit this article for translation. Then Translation_Status__c should be changed to 'Requested To Translate'
as soon as the new record is created.
I've write a workflow for this. but workflow is not firing when the record is created. It's only working when the record is edited.


 
Hi there,

I have a knowledge Article, which I want to translate to another langauge from english.
When I submit this article for translation. Then Translation_Status__c should be changed to 'Requested To Translate'
as soon as the new record is created.
I've write a workflow for this. but workflow is not firing when the record is created. It's only working when the record is edited.


 
Hi there,

I have hit a wall. There are two objects, Gift History (GH), and Fund-Gift Association (FGA) that I am working with. FGA has a field that I want to see on GH, Associated Fund. FGA has a lookup relationship to GH to pull the Gift ID, and GH has a master-detail relationship with Accounts. I first tried to create a formula field for GH to pull in the Associated Fund, but I was unable to move acces FGA for fields, only Accounts (I guess due to the relationship type?). Thinking that I would need to have a lookup field on GH to access fields on FGA, I created a lookup field that would have the Fund-Gift ID on GH, and then I would be able to use a formula field to capture the Associated Fund. The lookup field does not auto populate, at which point I am working with the process builder to get that to work.

I though tmy logic was right, that once the GH object was created or edited, if the Associated Fund field on GH is null then to update the lookup field Fund-Gift Association with FGA ID (then triggering the population of Associated Fund). No go.

Am I making this way to complicated? When two objects each have a lookup relationship referring to each other does it cause complications?

Thanks so much!
Katie
Hi all,

I am trying to login into Salesforce Customer Community using Facebook as Auth Provider. 

Issue faced: I am able to sign in to Salesforce community using facebook authentication, however I am not able to fetch the facebook user details such as firstname,lastname,email dynamically using the Registration Handler Class by  using data.firstname,data.lastname,data.email . Currently i am using static values for the fields like firstname,lastname,email 

Expected : Getting dynamic values from facebook in the code below where static values are provided.

Code for Registration Handler that i am using as below.

global class FacebookHandler implements Auth.RegistrationHandler{ 
    global User createUser(Id portalId, Auth.UserData data){
    system.debug('hahahahaha' +portalId);
      User result;
      try {
        //default account to collect Community Members
        Account a = [ SELECT Id
                      FROM Account
                      WHERE name='MyAllergy'
                      LIMIT 1
                  ];
      
       //default profile
      Profile p = [ SELECT Id
                     FROM Profile
                    WHERE name='Custom Customer Community Plus Login User'
                     LIMIT 1
                   ];
       //contact
       Contact c   = new Contact(
        accountId = a.Id,
         email     = 'prateek.sharma@salesforce.com',
         firstName = data.firstName,
         lastName = data.lastname

     //    lastName  = 'testr'
       );     
       insert c;
      //get the alias as username
      String alias = this.getAlias(data.username);
       //user
       User u = new User(
         username          = alias + '@community.com',                                    
         email             = 'prateek.sharma@salesforce.com',
        lastName          = 'testtr',
         firstName         = data.firstName,
        alias             = alias,
         languagelocalekey = 'en_US',
         localesidkey      = 'en_GB',
         emailEncodingKey  = 'UTF-8',
         timeZoneSidKey    = 'GMT',
        profileId         = p.Id,
         contactId         = c.Id
       );
       //binding
       result = u;
     }
     catch(Exception pEx) {
      //re-throwing exception to allow tracing the error from URL
      throw new HandlerException(
         pEx.getStackTraceString()
       );
     }
    return result;           
   }
   //custom exception
   global class HandlerException extends Exception{}
   global void updateUser(Id userId, Id portalId, Auth.UserData data){
        User u = new User(
       id        = userId,
      email     = 'prateek.sharma@salesforce.com',
       lastName  = 'tata',
     firstName = data.firstName,
     alias     = this.getAlias(data.username)
    );
    
     update u;
   }
   global String getAlias(String pUsername) {
     //generate random string (8)
     Blob blobKey           = crypto.generateAesKey(128);
     String key             = EncodingUtil.convertToHex(blobKey);
     String random_username = key.substring(0,8);
     //if not defined, create a random one
     String alias = pUsername != null ?
                     pUsername :
                     random_username;
     //check alias.length() > 8 and chop it
     alias = alias.length() > 8 ?
               alias.substring(0,8) :
               alias;
     return alias;
   }
}

Any help would be appreciated,

Thanks
Hi Friends,
I have some issue how to hide "New Note" & "Attach file" of Releated list in Standard object & Custom Object.?
I want a quick solution for this issue, anybody help me..
It's very urgent.
User-added image

.. 
Hello,

I have to implement 2 validation rule on a text field
1st one to check the required. (make field mandatory)
2nd one will be fired if 1st is OK. It will check if the field has 14 characters.

I also need a custom error messages.

Thank you for suggestions
  • November 30, 2015
  • Like
  • 0
Hi,

While calling the Transfer to Agent function within Chatbot/Live Agent, I want to have a check to see if any agents are online prior to transferring (currently, it just displays a msg "no agents available", which is not very desirable). If no one is online, either display the Web-to-case form or just a link to the form.

The "Offline Support" feature does not work, with Chatbot.

Any suggestions welcomed. I'm thinking custom APex code is the only way to go. 
 
Hi all,

I am trying to login into Salesforce Customer Community using Facebook as Auth Provider. 

Issue faced: I am able to sign in to Salesforce community using facebook authentication, however I am not able to fetch the facebook user details such as firstname,lastname,email dynamically using the Registration Handler Class by  using data.firstname,data.lastname,data.email . Currently i am using static values for the fields like firstname,lastname,email 

Expected : Getting dynamic values from facebook in the code below where static values are provided.

Code for Registration Handler that i am using as below.

global class FacebookHandler implements Auth.RegistrationHandler{ 
    global User createUser(Id portalId, Auth.UserData data){
    system.debug('hahahahaha' +portalId);
      User result;
      try {
        //default account to collect Community Members
        Account a = [ SELECT Id
                      FROM Account
                      WHERE name='MyAllergy'
                      LIMIT 1
                  ];
      
       //default profile
      Profile p = [ SELECT Id
                     FROM Profile
                    WHERE name='Custom Customer Community Plus Login User'
                     LIMIT 1
                   ];
       //contact
       Contact c   = new Contact(
        accountId = a.Id,
         email     = 'prateek.sharma@salesforce.com',
         firstName = data.firstName,
         lastName = data.lastname

     //    lastName  = 'testr'
       );     
       insert c;
      //get the alias as username
      String alias = this.getAlias(data.username);
       //user
       User u = new User(
         username          = alias + '@community.com',                                    
         email             = 'prateek.sharma@salesforce.com',
        lastName          = 'testtr',
         firstName         = data.firstName,
        alias             = alias,
         languagelocalekey = 'en_US',
         localesidkey      = 'en_GB',
         emailEncodingKey  = 'UTF-8',
         timeZoneSidKey    = 'GMT',
        profileId         = p.Id,
         contactId         = c.Id
       );
       //binding
       result = u;
     }
     catch(Exception pEx) {
      //re-throwing exception to allow tracing the error from URL
      throw new HandlerException(
         pEx.getStackTraceString()
       );
     }
    return result;           
   }
   //custom exception
   global class HandlerException extends Exception{}
   global void updateUser(Id userId, Id portalId, Auth.UserData data){
        User u = new User(
       id        = userId,
      email     = 'prateek.sharma@salesforce.com',
       lastName  = 'tata',
     firstName = data.firstName,
     alias     = this.getAlias(data.username)
    );
    
     update u;
   }
   global String getAlias(String pUsername) {
     //generate random string (8)
     Blob blobKey           = crypto.generateAesKey(128);
     String key             = EncodingUtil.convertToHex(blobKey);
     String random_username = key.substring(0,8);
     //if not defined, create a random one
     String alias = pUsername != null ?
                     pUsername :
                     random_username;
     //check alias.length() > 8 and chop it
     alias = alias.length() > 8 ?
               alias.substring(0,8) :
               alias;
     return alias;
   }
}

Any help would be appreciated,

Thanks