• nidhi arya
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Hi All,

We have implemented the As-is Live agent Functionality which is provided byy Salesforce.

Currently when no agent is available to chat,message whcih shows up is"You are disconnected from the change as currently no agents are available" we need to change it to "You have been disconnected. As all our agents are currently busy. ".

If anyone has implemented it, would need your special advice on the same.

Thanks,
Nidhi Arya
Hi All,

Our business have a requirement wherein they want to customize certain standard functtionality of Live chat.
I have tried hard to find out but could not find solution to below problem. 

1)After Clicking Live Agent Icon Chat window should be displayed on right hand side bottom corner of the VF page only ,currently it gets opened in left hand side top corner automatically.
2) New window which opens should have following URL "XYZ Live Chat" instead of standard URL.
3)On Minimizing Chat window should be placed in right hand side corner of the page as a bar only.
4)If the Chat window is in minimized at user's machine and if the execuive replies , live agent bar should blink indifferent color.

looking forward for your help as soon as possible. thanks!!
5)
Hi All,

I have written down a trigger(Trigger which sents out an email alert when the different fields are updated from the backend without editing the record) which is working fine in sandbox .But when I have deployed it to Production Its not working at the first go. But second time when AI go and update the record manually only then my code runs.

Also for referenece there is one other code which is running after update but that is running successfully.

Code of My Trigger-
trigger send_notification on Lead (after update) {
system.debug('send notification trigger active');
  Lead Ld = trigger.new[0];
  system.debug('mailid'+Ld.Mail_To_Vista_First__c);
  Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

  //mail.setTargetObjectId('Ld.OwnerID');
    system.debug('ownerID'+Ld.OwnerID);
  mail.setSenderDisplayName('do-not-reply@snapdeal.com');
  mail.setUseSignature(false);
  mail.setBccSender(false);
  mail.setSaveAsActivity(false);

if (Trigger.isUpdate) {
  system.debug('condition value'+Ld.Stage__c);
    if(Ld.Stage__c == 'Pre On-boarding' && Ld.Seller_Code_Generated__c == true && Ld.Pincode_Mapping_Completed__c == False &&( Ld.Mail_To_Vista_First__c !=null || Ld.Mail_To_Vista_First__c !='') ){
       
      // create email content
         system.debug('Lead Name : '+Ld.Name);
        String subject = 'Hi Partner';
        mail.setSubject(subject);
       
     //Message with line break tag
        mail.setHtmlBody('<html><body>Your  '+ Ld.Seller_Code__c+' an unique id with Snapdeal.com has been emailed to you.Please refer this code for any communication with us.<br>Best Regards<br>Snapdeal Team');   
     


     // add recipients
      String toAddresses =  Ld.Mail_To_Vista_First__c;
      system.debug('mail value +++'+ toAddresses);
      if( string.isNotBlank(toAddresses))
    {
  system.debug('value of toaddress'+string.isNotBlank(toAddresses));
     //Set your too addresses here based on task criteria
     String[] addresses = new String[] {toAddresses};
        mail.setToAddresses(addresses);
     
      }
      system.debug('mail value'+mail);
     if(toAddresses != null)
     {
        Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
   
        system.debug('sendemail'+r);  
     }
      }  
   }
}

Awaiting for your reply.
 Hi,

I have a requirement with my client wherein we are required to generate a unique random number on creation of a record in the system.

To cater to which I have written a below line of code-

integer max=6;
string password=EncodingUtil.ConvertToHex(crypto.generateAesKey(128)).substring(1,max);
recordToUpdate.put('Seller_Code__c'),'S'+password);

this code works fine.But not sure whether this code will generate a unique random number everytime.Can anyone help me with this?

In case if this code does not generates a unique random number how can I handle through same code?

 Hi,

I have a requirement with my client wherein we are required to generate a unique random number on creation of a record in the system.

To cater to which I have written a below line of code-

integer max=6;
string password=EncodingUtil.ConvertToHex(crypto.generateAesKey(128)).substring(1,max);
recordToUpdate.put('Seller_Code__c'),'S'+password);

this code works fine.But not sure whether this code will generate a unique random number everytime.Can anyone help me with this?

In case if this code does not generates a unique random number how can I handle through same code?

Hi,   I came across the following functuon for generating a random password.  I require that the password is alphanumeric.

 

I note the function does seem to return alphanumeric characters.  Does this seem correct or is it just a coincidence in the passwords I've generated so far?   I need to confirm if alphanumeric will always be returned. If so, what is the logic (explanation) for it?

 

public String generator(Integer len){
Blob blobKey = crypto.generateAesKey(128);
String key = EncodingUtil.convertToHex(blobKey);
return key.substring(0,len);
}

 

Thanks in advance for any help!