• moffet
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 6
    Replies

 I had a formula field in contact of text return type which returns text in the format "salesforce.com" i am getting the result with hyperlink , i want to remove the hyperlink , can any one help?

my formula is 

Account.Domain__c 

Hi,

 

I  have a trigger that generates the password based on a picklist value I had some problem with the test class can any one help.

 

Trigger

 

trigger Sendpassword on Contact (before update, before insert) {

   if(!Validator_cls.hasAlreadyDone()){
   string tokenM;
   
   if(trigger.isInsert){
   
   List<Contact> con =Trigger.new;
   Integer len = 8;
    Blob blobkey = crypto.generateAesKey(128);
    String key = EncodingUtil.convertToHex(blobKey);
    tokenM = key.substring(0,len).toUpperCase();
   
   for (Contact tpwd : con) {
   
   if(tpwd.Temporary_KL_Login__c=='Enable and Send Password'  )
   tpwd.Temporary_KL_Login_Password__c =tokenM;
 
   }
   }
      
   if(trigger.isUpdate){
 
   Contact conn= Trigger.old[0];
   List<Contact> con =Trigger.new;
   Integer len = 8;
    Blob blobkey = crypto.generateAesKey(128);
    String key = EncodingUtil.convertToHex(blobKey);
    tokenM = key.substring(0,len).toUpperCase();
   
   for (Contact tpwd : con) {
   
   if(tpwd.Temporary_KL_Login__c=='Enable and Send Password' && conn.Temporary_KL_Login__c != tpwd.Temporary_KL_Login__c )
   tpwd.Temporary_KL_Login_Password__c =tokenM;
 
   }
   }
   Validator_cls.setAlreadyDone();
}
}

 

 

 

Test class

 

@isTest

Public class Sendpassword
{
static testMethod void Sendpassword()
{
Contact con = new Contact(LastName='Test', Title = 'testt' ,
                           Phone = '4561230789' , Email = 'qwwervvsv@gmail.com' ,Temporary_KL_Login_Password__c='78B910FC' );

insert con;

con.Phone ='4561230789';

update con;

Validator_cls.hasAlreadyDone();
}
}

 

 

 

i am getting  54% code coverage unable to cover the things inside the "trigger.isUpdate"

 

 

I used another class "Validator_cls" to make the trigger fire only once

 

Validator_cls

 

global class Validator_cls{

    private static boolean blnAlreadyDone = false;
    
    public static boolean hasAlreadyDone(){
        return blnAlreadyDone;
    }
         public static void setAlreadyDone() {       
            blnAlreadyDone = true;
    }
    

}

hi,

  i need to write trigger on position object

  the position object contains check box (Travel Required)

  and  Job Application object contains status field

  when i checked the Travel Required check box the trigger should be fired so that status field in Job Application should be changed to Rejected

         there is a lookup relation between those two objects

           whenever the checkbox of one position is checked the related Job Applications status field muct be changed to "Rejected"

 

 

               can anyone help me pls

  • August 06, 2012
  • Like
  • 0

hi,

  i need to write trigger on position object

  the position object contains check box Travel Required

  and  Job Application object contains status field

  when i checked the Travel Required check box the trigger should be fired so that status field in Job Application should be changed to Rejected

          

 

 

               can anyone help me pls

  • August 06, 2012
  • Like
  • 0

i need to integrate zoho with salesforce for that i generated an apex class through the wsdl file of zoho after that what should i do

i need some assistance to integrate salesforce with zoho can anyone help pls

how can  i integrate salesforce with zoho

i need to write a workflow rule on Campaign Members sothat whenever  Campaign Members opens an html email

the user should get a notification that the mail has opened

can anyone help

I have a two record types in contacts one is child and another is sponsor .the sponsor should be able to see only the childs that are related to him how can i do this

 

 I had a formula field in contact of text return type which returns text in the format "salesforce.com" i am getting the result with hyperlink , i want to remove the hyperlink , can any one help?

my formula is 

Account.Domain__c 

Hi,

 

I  have a trigger that generates the password based on a picklist value I had some problem with the test class can any one help.

 

Trigger

 

trigger Sendpassword on Contact (before update, before insert) {

   if(!Validator_cls.hasAlreadyDone()){
   string tokenM;
   
   if(trigger.isInsert){
   
   List<Contact> con =Trigger.new;
   Integer len = 8;
    Blob blobkey = crypto.generateAesKey(128);
    String key = EncodingUtil.convertToHex(blobKey);
    tokenM = key.substring(0,len).toUpperCase();
   
   for (Contact tpwd : con) {
   
   if(tpwd.Temporary_KL_Login__c=='Enable and Send Password'  )
   tpwd.Temporary_KL_Login_Password__c =tokenM;
 
   }
   }
      
   if(trigger.isUpdate){
 
   Contact conn= Trigger.old[0];
   List<Contact> con =Trigger.new;
   Integer len = 8;
    Blob blobkey = crypto.generateAesKey(128);
    String key = EncodingUtil.convertToHex(blobKey);
    tokenM = key.substring(0,len).toUpperCase();
   
   for (Contact tpwd : con) {
   
   if(tpwd.Temporary_KL_Login__c=='Enable and Send Password' && conn.Temporary_KL_Login__c != tpwd.Temporary_KL_Login__c )
   tpwd.Temporary_KL_Login_Password__c =tokenM;
 
   }
   }
   Validator_cls.setAlreadyDone();
}
}

 

 

 

Test class

 

@isTest

Public class Sendpassword
{
static testMethod void Sendpassword()
{
Contact con = new Contact(LastName='Test', Title = 'testt' ,
                           Phone = '4561230789' , Email = 'qwwervvsv@gmail.com' ,Temporary_KL_Login_Password__c='78B910FC' );

insert con;

con.Phone ='4561230789';

update con;

Validator_cls.hasAlreadyDone();
}
}

 

 

 

i am getting  54% code coverage unable to cover the things inside the "trigger.isUpdate"

 

 

I used another class "Validator_cls" to make the trigger fire only once

 

Validator_cls

 

global class Validator_cls{

    private static boolean blnAlreadyDone = false;
    
    public static boolean hasAlreadyDone(){
        return blnAlreadyDone;
    }
         public static void setAlreadyDone() {       
            blnAlreadyDone = true;
    }
    

}

hi,

  i need to write trigger on position object

  the position object contains check box (Travel Required)

  and  Job Application object contains status field

  when i checked the Travel Required check box the trigger should be fired so that status field in Job Application should be changed to Rejected

         there is a lookup relation between those two objects

           whenever the checkbox of one position is checked the related Job Applications status field muct be changed to "Rejected"

 

 

               can anyone help me pls

  • August 06, 2012
  • Like
  • 0

I have a two record types in contacts one is child and another is sponsor .the sponsor should be able to see only the childs that are related to him how can i do this

 

Hi,

 

As part of a Project, we are in the process of identifying the

1. Number of ways to connect to an External System from Salesforce(As we need to connect to the external system, get required data from the external system and use that data in the Salesforce application) and

2. Finalizing the feasible/suitable approach of the above.

 

Can anyone please provide the different approaches of connecting Salesforce to External Systems and their feasibility in usage.

If you can give me a sample code for each of the approaches that would be of really great help for me.

 

Thanks in advance,

Sush.