• Bhu'1 salesforce
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 6
    Replies
Hi All,

I need to convert the base64 Json string which is passed from webservice as an input, here in sfdc i need to display the base64 string and display it as an image formate.

Please shut some light and let me know what are all the possible ways to achieve this and display it in sfdc custom object.

Thanks & Regards,
Bhuvan 
Hi All,

I have created a trigger to create a community user direct from contact. Facing some issue ? Please review the code and let me know..
Code :
trigger UserFromContact on Contact (after insert) {
set<ID> conids = new set<ID>();
    for(Contact c : trigger.new){
        if(c.accountid != Null && c.recordtype ='Customer_Contact'){
            conids.add(c.id);           
    }  
}
List<contact> conlist = [select id,email,firstName,lastname,accountId from Contact where Id IN : conids];
List<user> usr = new List<user>();
    for(Contact con : conlist){
     string nick = con.email!=null?con.email.substring(0, con.email.indexOf('@')):''; nick += Datetime.now().getTime();       
    User newUser = new User(
                    alias = ('con.firstName'),
                    email = con.email,
                    emailencodingkey = 'UTF-8',
                    firstname = con.firstName,
                    lastname = con.lastname,
                    languagelocalekey = 'en_US',
                    localesidkey = 'en_US',
                    contactId = con.Id,
                    timezonesidkey = 'America/Los_Angeles',
                    username = con.email,
                    CommunityNickname = nick,
                    ProfileId = '00e1a000000V5BU',
                    IsActive = true);
                    usr.add(newUser);        
    }    
     Insert usr;
}

error : while creating an contact :
System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Alias: data value too large: con.firstName (max length=8): [Alias]: