• 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,

Can anyone of you please send me few screenshots of the Lightning Components that are developed.

Thanks & Regards,
Bhuvan
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,

Need to bulkify in such a way that points to be added for the list of custom settings.
User-added image
Thanks
Bhuvan
Please help me in bulkifying this code.
Thanks in advance..

Code :
global with sharing class LOYMemberServcies
{
   
    //-----------------------------------------------------------------
    //---- Member Enrollment
    //-----------------------------------------------------------------
     
    //Services that needs to be invoked after the member enrollment.
    //This method will be called from the member trigger.
    //Modified to exclude the DML operation inside loop
    public Map<Membership_card__C,Member__c> postMemberEnrollmentActivities(Map<String,Member__C> newMem)
    {
        //Get the base tier
        system.debug('%%%'+newMem);
      Map<Membership_card__C,Member__c> mapCardMember = new Map<Membership_card__C,Member__c>();
      for(String ss : newMem.keyset()){
        //create new membership card
        Member__c updateMem = new Member__c();
        updateMem = newMem.get(ss);
              system.debug('%%%'+updateMem );
        Membership_card__C mc = new Membership_Card__C();
        mc.member__c = updateMem.Id;
        List<String> tierClass = ss.split(',');
        mc.card_type__C = tierClass[0];
               
        //udpate hte member record
          updateMem.tier__C = tierClass[1];
          //updateMem.membership_card__C = mc.id;
          mapCardMember.put(mc,updateMem);
          
      }
      return mapCardMember;
    }
     
    //Enroll the contact into a given program.
    //If the contact id is present, then duplicate check will be done to ensure one contact is part of one program only once.
        
    global static List<String> EnrollTheContactIntoProgram(List<Contact> con,String programName)
    {
        List<String> result = new List<String>();
        Program__c program=[select id,Name from Program__c where name=:programName limit 1];
        List<Contact> newCon = new List<Contact>();
        Map<Id,Contact> existCon = new Map<Id,Contact>();
        List<Id> conId = new List<Id>();
        for(contact c : con){
          String contactId = c.Id;
        
        system.debug('***'+c);
        
        //check if contact id is null (new contact)
        if(contactId == null)
        {
            //create the new contact
            newCon.add(c);
            // then create a new member..   
            }
        else
        {
               conId.add(c.Id); //check the duplicate of hte contact.
               existCon.put(c.Id,c);
               system.debug('im in else'+existCon);
        }       
        }
        if(newCon.size()>0)
        {
        insert newCon;
}        
        
         List<Member__C> membersWithSameContact = [select id,Contact__c from Member__C where Contact__C IN :conId and Program__C = :program.ID LIMIT 1];
                //check if htere is atlest one membership for the contact in the same program
        system.debug('******'+membersWithSameContact);
     
     for(id i : existCon.keyset())
     {
        if(membersWithSameContact.size()>0)
        {
        for(Member__c m : membersWithSameContact)
          {
            
          if(existCon.get(m.Contact__c) != null )
                {
                    result.add( ' The contact is already part of the same Program'+m.Id);
                }
                else
                {
                    //create the new member for the existing contact.
                    newCon.add(existCon.get(m.Contact__c) );
                   }   
        
        
          }  
          }
          else
          {
           newCon.add(existCon.get(i) );
          }
          }   
        
        
  system.debug('****'+newCon);
        List<Member__c> newMem = new List<Member__c>();
        for(Contact cs : newCon){
        Member__c newMember = new Member__C();
        newMember.program__C = program.Id;
        newMember.Contact__C = cs.Id;
        newMember.Name = cs.Name;
        newMem.add(newMember);
        }                  
        insert newMem;
        for(Member__c m : newMem)
        {
            result.add('Contact Id '+m.Contact__C+' has been enrolled into the program. Member Number: '+m.Id);
        }        
            
            
        
        return result;
    }
}
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]:
Hi All,

Please help me out in letting me know - whether it is possible to create to Custom Setting from REST API ?

Thanks & Regards,
Bhuvan
Hi All,

Am working on salesforce Lightning, I just wanted to show Full Calander jquery plugin in salesforce Lightning Component. Can someone please help in this regard.

Thanks & Regards,
Bhuvan 
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]: