• amrit
  • NEWBIE
  • 115 Points
  • Member since 2010

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 93
    Questions
  • 123
    Replies

Hello all,

 

I have a Lead validation rule using an IF statement that works as follows:

 

IF(AND(ISPICKVAL(Status, "Junk") , ISPICKVAL(junk_reason__c , "") ),TRUE, FALSE)

 

This IF statement works fine for checking 2 picklist values of 2 different lead picklist fields. However, I want to add another IF condition such as:

 

IF(AND(ISPICKVAL(Status, "Junk") , ISPICKVAL(junk_reason__c , "Bad Email") ),TRUE, FALSE)

 

How would I combine these 2 IF statements or merge into a Case function? The idea is if either of these 2 IF statements evaluate to True then the Lead Validation rule error message will display.

 

Thanks.

I have 2 objects Scholarship and Award.

 

The 2 objects are the exactly the same except that Scholarship has has a Master-Detail relationship and Award has 3 extra fields. I want to display them in a list of Awards & Scholarships only showing the common fields they share. I also want them to be clickable to view the Award or Scholarship.

Hi,

I have two trigger on one object RFP__c.
First trigger which will update values on picklist.Second Trigger will execute based on updated picklist value.
These two trigger works independently.Any idea how to execute together.


Thanks
Amritha
  • December 23, 2013
  • Like
  • 0

Hi,

 

Is it possible to get the count of date field in report. In this  report im not able to get no:of days spent in HeadQuarter,Ex-Station,Out-Station.It shows record count and no:of days spent as 68 . I wanted to know out of those 30 days how many days he worked in Head quarters, Ex-station and outstation.  

 

Thanks

  • November 08, 2013
  • Like
  • 0

Hi,

 

Im not able to get coverage for formula field.there is a formula field named stage in RFP__c  which is taking value form Opportunity stage.Imgetting 0 coverage if i used opportunity in test class otherwise it is 65%

This is the test class

@isTest
private class TestRFPupdatevaluesTrigger{
 
  static testmethod void testTriggerMethod(){
        try{
            
            Account a= new Account(Name='AccTest1');
             Test.starttest();
            insert a;
           
               Account_Region_c__c ar = new Account_Region_c__c(Name='APAC',Origin_Parent__c=a.id);
                insert ar;
            
               Account_Entity__c ae=new Account_Entity__c(Name='Test12',Account_Region__c=ar.id);
                insert ae;
            
                Contact c=new Contact(LastName='Test1',Account_Region__c=ar.id,Accounts_Entity__c=ae.id);
                insert c;
                                CPI__c cpi=new CPI__c(Completes_Required__c=100,Name='General',Incidence_Rate__c=0.01,Bid_LOI_in_minutes__c=5,Audience__c='Gen Pop',Market__c='India',Actual_CPIchanged__c=3);
                insert cpi;
                CPI__c cpi1=new CPI__c(Completes_Required__c=0,Name='General',Incidence_Rate__c=0.01,Bid_LOI_in_minutes__c=0,Audience__c='Gen Pop',Market__c='India',Actual_CPIchanged__c=0);
                insert cpi1;
                List<RFP__c > rfplist= new List<RFP__c >();
                RFP__c rf=new RFP__c(Name='a',Rate_Card__c='General',Completes_Required__c=100,Incidence_Rate__c=0.01,Bid_LOI_in_minutes__c=5,Audience__c='Gen Pop',Market__c='India');
                insert rf;

               RFP__c rf1=new RFP__c(Name='b',Rate_Card__c='General',Completes_Required__c=0,Incidence_Rate__c=0.0,Bid_LOI_in_minutes__c=0,Audience__c='B2B',Market__c='India');
                insert rf1;
                
                
                 rf=cpi.Actual_CPIchanged__c;
                 rf=cpi.Actual_CPIchanged__c;
                 
                 rf1.Actual_CPI__c=cpi1.Actual_CPIchanged__c;
                 rf1.Proposed_CPI__c=cpi1.Actual_CPIchanged__c;
                System.assertEquals(3, rf.Actual_CPI__c);
                System.assertEquals(0, rf1.Actual_CPI__c);
                update rf;
                update rf1;
                rfplist.add(rf);
                rfplist.add(rf1);


              

Below code is not getting coverage:

 for(RFP__c r : trigger.new){

 

    if((r.Audience__c == 'B2B' || r.Audience__c == 'Gen Pop') && r.Stage__c == 'RFP_Received')
    {    
        aud.add(r.Audience__c);
    }
   
   
}



//If audience is B2B or Genpop
try{
if(aud.size()>0){
    Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();
 
    for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Incidence_Rate__c,Actual_CPIchanged__c,Audience__c,Stage__c, Completes_Required__c,Name,Market__c  FROM CPI__c WHERE    (Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market)]){
        cpi1.put(obj1.Completes_Required__c , obj1);
        system.debug('CPI'+cpi1);
    }
 
 
    if(cpi1.size()>0){
    
         
        
           for(RFP__c r2 :trigger.new){
                
                        r2.Actual_CPI__c = cpi1.get(r2.Completes_Required__c).Actual_CPIchanged__c;
                        if(r2.Proposed_CPI__c == 0.00 )
                    {
                        r2.Proposed_CPI__c= cpi1.get(r2.Completes_Required__c).Actual_CPIchanged__c;
                                         }
                               
    
    }
   }
    else{
        
           for(RFP__c  r2 : trigger.new){
             
               r2.Actual_CPI__c =0.00;
            }
             
    }
}    
}

catch(exception e){
}


}
           
                           
     

 

 

  • October 19, 2013
  • Like
  • 0

Hi,

 

Here Im trying to create a trigger where there is master object (Custom object-Opportunity) and child object(RFP).

Im mapping values from other object (Ratecard) when i entered some parameters in RFP.

In RFP there are some parameters(CompletesRequired,BID,Incidence rate,Market,Audience,Ratecard).We have same fields in Ratecard object with Actual CPI (currency) which we are uploading through dataloader.

When i entered these parameters in RFP the ActualCpi will populate automatically in RFP Object.

this scenario is working for one RFP entry.How can i use lists in this case for multiple rfp entry.

 

trigger RFPupdate on RFP__c (before insert, before update) {
 
 
Set<Decimal> comp = new Set<Decimal>();
Set<Decimal> bid  = new Set<Decimal>();
Set<Decimal> inc  = new Set<Decimal>();
List<String> aud  = new List<String>();
List<String> stage = new List<String>();
List<String> stage2 = new List<String>();
List<String> market=new List<String>();
List<String> ratecard =new List<String>();
List<Id> opp=new List<Id>();
 
for(RFP__c r : trigger.new){
 
 
    if(r.Completes_Required__c != null){
        comp.add(r.Completes_Required__c);
       } 
    if(r.Bid_LOI_in_minutes__c != null){ 
        bid.add(r.Bid_LOI_in_minutes__c);
        }
    if(r.Incidence_Rate__c != null)
    {
        inc.add(r.Incidence_Rate__c);
     }
    if((r.Audience__c == 'B2B' || r.Audience__c == 'Gen Pop') && r.Stage__c == 'RFP_Received')
    {    
        aud.add(r.Audience__c);
    }
    if(r.Market__c != null)
    {
        market.add(r.Market__c);
    }
   if(r.Rate_Card__c != null)
   {
     ratecard.add(r.Rate_Card__c);
   }
   if(r.Opportunity__c!=null)
   {
      opp.add(r.Opportunity__c);
      system.debug('Opp*****'+opp);
   }
}
 
//If audience is B2B or Genpop
try{
if(aud.size()> 0){
    Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();
 
    for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Incidence_Rate__c,Actual_CPIchanged__c,Audience__c,Stage__c, Completes_Required__c,Name,Market__c  FROM CPI__c WHERE    (Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market  )]){
        cpi1.put(obj1.Completes_Required__c , obj1);
        system.debug('CPI'+cpi1);
    }
 
    // We have all the reference data we need, last loop on the each Opportunity
 
    if(cpi1.size()>0){
    
       system.debug('CPISize@@@@@@@'+cpi1.size());
        for(RFP__c rf1: trigger.new){
         
                system.debug('^^^^^^^^^^^^^^^RFP'+rf1);
                rf1.Actual_CPI__c = cpi1.get(rf1.Completes_Required__c).Actual_CPIchanged__c;
                   system.debug('ActualCPI################'+rf1.Actual_CPI__c);
                    if(rf1.Proposed_CPI__c == 0.00 ){
                        rf1.Proposed_CPI__c= cpi1.get(rf1.Completes_Required__c).Actual_CPIchanged__c;
                        system.debug('ProposedCPI##############'+rf1.Proposed_CPI__c);
                    }
                               
       
        
        }
    
   } 
    else{
        for(RFP__c  rf1 : trigger.new){
            
               rf1.Actual_CPI__c =0.00;
            
        }      
    }
}    
}
 
catch(exception e){
}
 
}
  • October 16, 2013
  • Like
  • 0

Hi,

 

How can we track user information when anyone downloaded the visualforce page pdf .I cannot use controller since im using PE .Is it possible through workflow uisng javascript.Is there any app in salesforce.

 

Thanks

  • October 09, 2013
  • Like
  • 0

HI,

 

Im using this javascript code in visualforce page to add functionality save and new. 'Save and new' functionality is not working in any of the browsers (Chrome,Firefox).Save functionality is working fine.How can i solve this issue

 

<apex:page standardcontroller="Promotion_Members__c" showheader="false">
<head>
<script type="text/javascript">
 var returnURL;
        
        window.onload =  function(){
        returnURL = gup("https://c.na1.visual.force.com/apex/CallResponse");
      //  alert('Record Saved ' + returnURL);
        };
        
        function gup( name ){  //this function just grabs HTTP params by name
        name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 
        var regexS = "[\\?&]"+name+"=([^&#]*)"; 
        var regex = new RegExp( regexS ); 
        var results = regex.exec( window.location.href );
        
        if( results == null )    return ""; 
        else    return results[0];}
        
        function redirectBack(){
       // alert('Record Saved and Sending you back');
        
        window.location.href =returnURL;
        }
</script>
</head>
<apex:form >
    
    <apex:actionFunction name="saveActionFunc" action="{!Save}" oncomplete="redirectBack();return false" rerender="theBlock"/>
    <apex:pageBlock title="Promotion-Member Edit" id="theBlock">
        <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!Save}"/>
            <apex:commandButton value="Save and new" onClick="saveActionFunc();"/>
            <apex:commandButton value="Cancel" action="{!Cancel}"/>
        </apex:pageBlockButtons>        
    <apex:pageBlockSection title="Information">
        <apex:inputfield value="{!Promotion_Members__c.Promotions__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Contacts__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Remarks__c}"/>
    </apex:pageBlockSection> 
    <apex:pageBlockSection title="Call Response" rendered="{!($User.HO__c == TRUE || $UserRole.Name =='Director')}">
        <apex:inputfield value="{!Promotion_Members__c.Raised_Complaint__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Complaints__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Promotion_Status__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Complaint_Remarks__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.How_was_the_Promotion__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Did_you_get_any_gifts__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Will_you_recommend__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Suggestion__c}"/>
        <apex:inputfield value="{!Promotion_Members__c.Suggestion_Remarks__c}"/>
    </apex:pageBlockSection>
    <!--<apex:pageBlockSection id="id18" title="Call Response" rendered="{!($User.HO__c != TRUE && $UserRole.Name != 'Director')}">
        <apex:outputfield value="{!Promotion_Members__c.Raised_Complaint__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Complaints__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Promotion_Status__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Complaint_Remarks__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.How_was_the_Promotion__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Did_you_get_any_gifts__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Will_you_recommend__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Suggestion__c}"/>
        <apex:outputfield value="{!Promotion_Members__c.Suggestion_Remarks__c}"/>
    </apex:pageBlockSection>-->
  </apex:pageBlock>
  </apex:form>
</apex:page>

 

  • September 12, 2013
  • Like
  • 0

Hi,

 

I have created a time dependent workflow .

The rule criteria is NOT(ISBLANK(Closed_Date__c)) && (TODAY() <= Closed_Date__c) && OR(NOT(ISPICKVAL(Stage__c , 'RFP_Status_Won')),NOT(ISPICKVAL(Stage__c , 'RFP_Status_Lost')))

 

Closed date is date field which is updating through other workflow.it will calculate as Bid date+60

 

Here time dependent workflow will only work when deactivate other workflow.But i cannot deactivate the other workflow on closed date .Is there any solution for this

 

  • September 11, 2013
  • Like
  • 0

Hi,

 

 Im using dupecatcher to avoid duplicate leads. I have issues in lead page there are three email field ie
Email1, Email2, Email3. I have entered 'test@gmail.com' in Email1 field in first lead. If I enter same email id in Email2  field in second lead alert is not throwing. Dupecatcher will only throw exception if i enter email id in corresponding field ie Email1 field.I checked with dupecatcher support team ,this was their reply
If the Filter checks Leads, then it’s not possible to cross match rules.
The only way to cross match rules in DupeCatcher is
if you have a multi-object filter (Lead against Contact or Account).
Hence it is not possibel through Dupe catcher .Is there any other way to solve this issue

 

Thanks

  • September 10, 2013
  • Like
  • 0

Hi,

 

I have a trigger in opportunity where im updating a currency fields (Proposed value, Actual value) when stage is 'Received'. 

Proposed value is an editable field.I can update the value in Proposed Value .But When i changed the Proposed value and update stage as 'Submitted' .The value is not getting updated. It s showing old value.

 

trigger CPIupdatevalues on Opportunity__c (before insert, before update) {


Set<Decimal> comp = new Set<Decimal>();
Set<Decimal> bid  = new Set<Decimal>();
Set<Decimal> inc  = new Set<Decimal>();
List<String> aud  = new List<String>();
List<String> stage = new List<String>();

List<String> market=new List<String>();
List<String> ratecard =new List<String>();

for(Opportunity__c l : trigger.new){

   if(l.Stage__c == 'Received'){
    if(l.Stage__c == 'Received'){
        stage.add(l.Stage__c);
    }
 
    if(l.Completes_Required__c != null){
        comp.add(l.Completes_Required__c);
       } 
    if(l.Bid_LOI_in_minutes__c != null){ 
        bid.add(l.Bid_LOI_in_minutes__c);
        }
    if(l.Incidence_Rate__c != null)
    {
        inc.add(l.Incidence_Rate__c);
     }
    if(l.Audience_B2B_B2C__c == 'B2B' || l.Audience_B2B_B2C__c == 'Gen Pop' &&l.Audience_B2B_B2C__c != 'Niche' )
    {    
        aud.add(l.Audience_B2B_B2C__c);
    }
    if(l.Market__c != null)
    {
        market.add(l.Market__c);
    }
   if(l.Rate_Card__c != null)
   {
     ratecard.add(l.Rate_Card__c);
   }
}
}

//If audience is B2B or Genpop
try{
if(aud.size()> 0){
    Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();


    for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Actual_CPIchanged__c,Audience__c,Stage__c, Completes_Required__c,Name,Market__c FROM CPI__c WHERE    Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market AND Stage__c IN:stage ]){
        cpi1.put(obj1.Completes_Required__c , obj1);
        system.debug('CPI'+cpi1);
    }
    system.debug('@@@@@@@@@@@@@@<@@@cpi @@@@@@@@'+'cpi1 ');

    // We have all the reference data we need, last loop on the each Opportunity


    if(cpi1.size()>0){
        for(Opportunity__c l1 : trigger.new){
             
                l1.ActualValue__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;
                    if(l1.ProposedValue__c == 0 ){
                        l1.ProposedValue__c= cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;//Updating Proposed value    
                    
                    }
            
        }  
        
    }
    else{
        for(Opportunity__c l1 : trigger.new){
            
                l1.Actual_CPI__c =0;
            
        }      
    }
    
}
}
catch(exception e){
}
}

 

Anyidea why it was not updating

  • September 07, 2013
  • Like
  • 0

Hi

 

I have created a workflow in Opportunity.

If Opportunity stage doesn’t close (won or lost) on or before Expected date of closure__c. Stage should automatically update as RFP_Unknown.An email alert should sent to Accunt manager.

Expected Date of closure__c is date field in opportunity which is calculating thrugh workflow field update (Bidsentdate__c(date field)+60=Expected date of closure__c  if Bidsentdate__c is filled).

I set criteria as

AND(Opportunity(C): Stagenot equal toRFP_Status_Won,RFP_Status_Lost (Expected Dateof closure < today OR Expected Dateof closure = today))
Always stage is updating as RFP_Unknown.Is this bcz of other workflow
 
Can anyne help on this issue
 
 
  • September 06, 2013
  • Like
  • 0

Hi,

 

 Im trying to send email template to three email ids in lead page  using javascript

.I have created a custom button named'Send email'

.There are three email fields in lead page 1)Email 2)Email_Other__c 3) Email__c.

 

Email should be displayed in 'to' field  ,Email_Other__c in cc ,Email__c in bcc field.

If the three email fields are filled then email id will display in corresponding fields.If first email field (Email)is ony filled and other two fields are blank ,Then Email field is displaying  to and bcc field. I want to display the first email id in 'to' field if Email_Other__c and Email__care blank.

 

{!REQUIRESCRIPT("/soap/ajax/16.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/16.0/apex.js")} 
var v=new sforce.SObject("Lead"); 
v.id = "{!Lead.Id}"; 
var e='{!Lead.Email}';
var e1='{!Lead.Email_Other__c}'; 
var e2='{!Lead.Email__c}'; 

if(e1.value== '' && e2.value== '' && e.value!='' ){ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4=&p5=','_self',false) 
} 
else if(e1.value!= '' && e2.value== ''){ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4={!Lead.Email_Other__c}&p5=','_self',false) 
} 
else if(e2.value!= '' && e1.value== ''){ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4=&p5={!Lead.Email__c}','_self',false) 
} 
else{ 
window.open ('https://na1.salesforce.com/_ui/core/email/author/EmailAuthor?p2_lkid={!Lead.Id}&rtype=00Q&retURL=%2F00Q30000013NwyU&p4={!Lead.Email_Other__c}&p5={!Lead.Email__c}','_self',false) 
}

 Please help me to resove the issue

 

Thanks

  • September 04, 2013
  • Like
  • 0

Hi,

 

I have a trigger which updating values in two fields ActualCPI and Proposed CPI.Here im able to insert the values in both field. Proposed CPI is an editable field.I want to change the value in Proposed CPI.But Im not able to update the value in Proposed CPI.

How can we make a field editable in trigger.

 

trigger CPIupdatevalues on Opportunity__c (before insert, before update) {


Set<Decimal> comp = new Set<Decimal>();
Set<Decimal> bid = new Set<Decimal>();
Set<Decimal> inc=new Set<Decimal>();
List<String> aud=new List<String>();

List<String> market=new List<String>();
List<String> ratecard =new List<String>();

for(Opportunity__c l : trigger.new){
    if(l.Completes_Required__c != null){
        comp.add(l.Completes_Required__c);
       } 
    if(l.Bid_LOI_in_minutes__c != null){ 
        bid.add(l.Bid_LOI_in_minutes__c);
        }
    if(l.Incidence_Rate__c != null)
    {
        inc.add(l.Incidence_Rate__c);
     }
    if(l.Audience_B2B_B2C__c == 'B2B' || l.Audience_B2B_B2C__c == 'Gen Pop' &&l.Audience_B2B_B2C__c != 'Niche' )
    {    
        aud.add(l.Audience_B2B_B2C__c);
    }
    if(l.Market__c != null)
    {
        market.add(l.Market__c);
    }
   if(l.Rate_Card__c != null)
   {
     ratecard.add(l.Rate_Card__c);
   }
}


if(aud.size()> 0)
{
Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();


for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Actual_CPIchanged__c,Audience__c, Completes_Required__c,Name,Market__c FROM CPI__c WHERE    Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market  ]){
    cpi1.put(obj1.Completes_Required__c , obj1);
    system.debug('CPI'+cpi1);
}
system.debug('@@@@@@@@@@@@@@<@@@cpi @@@@@@@@'+'cpi1 ');



if(cpi1.size()>0 ){

for(Opportunity__c l1 : trigger.new){

  
     
        l1.Actual_CPI__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;
        l1.CPI_in__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c ;//Here Im updating Proposed CPI
       
       
    
}

}


else
{
for(Opportunity__c l1 : trigger.new){
    l1.Actual_CPI__c =0;
    
    }
}

}
if(aud.size()== 0)
{

// Now we have a set of unique bid names we want to verify, time to look them up.


for(Opportunity__c l : trigger.new){
    l.Actual_CPI__c =0;
    
    }


}



}

 

if(cpi1.size()>0 ){

for(Opportunity__c l1 : trigger.new){

  
     
        l1.Actual_CPI__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;
        l1.CPI_in__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c ;//Proposed CPI
       
        system.debug('ActualCPI'+ l1.Actual_CPI__c);
        
    
}

}

 

 

  • August 22, 2013
  • Like
  • 0

Hi,

 

I have created a trigger in a custom object to update a currency field Actual CPi .I want Same field to update in another field Proposed CPi which is editable.Hence i used workflow to update Actual CPI in Proposed CPI.When i create a new record the Actaul CPI will update the value.But Proposed CPi doesnt update the Actual CPI. 

Based on execution order trigger will run first .How can i update the workflow when i create the record.

 

I used this formula for workflow :

ISCHANGED(ActualCPI)

criteria:Evaluate the rule when a record is created, and every time it’s edited

Thanks

 

 

  • August 21, 2013
  • Like
  • 0

Hi,

 

Can anyone help me to find this error. I have installed Salesfroce for outlook recently.Outlook crashes when it is started,

 

The error shows something like this

 

This error report includes; information regarding the condition of Salesforce for Outlook when the
ma problem occurred; the operating system version and computer hardware in  your Digital Product
ID, which could be used to identify your license; and the Internet Protocol [IP] address of your computer.

Thanks

  • August 08, 2013
  • Like
  • 0

Hi,

 

I need to send a attachment of size 5 MB with html template to the customers. The customers are getting mail with html link.They are not able to view the file.So i tried to send as html link of pdf document in the mail.Now they can view the file.

 Is there any setting in salesforce to send attchemnts with html template without a link.

 

Thanks

  • July 17, 2013
  • Like
  • 0

Hi,

 

Im not able to pull the formula field(currency) in email template.It is showing me blank value.Im using Force.com Ente
rprise edition.

I created a checkbox in opportunity .When it is checked an email template will be send to salesperson and it will show some field value in opportunity .All the values except formula fieldare showing in email template.I tried in my developer instance there it is showing me the formula field.I tried to use workflow update field. Im getting blank value.

 

Please suggest me solution for this

 

 

 

 

 

  • July 02, 2013
  • Like
  • 0

Hi,

 

Im facing some issues while updating a field through workflow.

I have created a currency "Actual value" field  which is updating  through trigger.There is an another currency field "Proposed value" which will update "Actual value" through workflow.Through workflow im copying Actual value and update in Proposed value and making "Proposed value" editable.When i tried to edit new value in "Proposed value"  it is not saving .Showing same "Actual value".

 

 

How can i save new value in "proposed value" field

  • June 29, 2013
  • Like
  • 0

Hi,

 

Can anyone suggest me app for sending mass email to lead or contacts which should be applicable for Force.com Enterprise editions.I tried to install campaign monitor since we dont have campaign in editions it is not possible.

 

 

Thanks

  • June 10, 2013
  • Like
  • 0

Hi,

 

I want to populate the current user's language field in one custom field in object.For that I'm querying the languagelocalekey from user object and assign the value to custom field

 

Eg:Cuobject__c cu=new Cuobject__c;
cu.Language__c=currentusr.Languagelocalekey;

 

But still I'm getting the locale(en_US) instead of English.any idea to convert locale to language value.

 

Can anyone suggest me solution for this

 

Thanks

  • June 06, 2013
  • Like
  • 0

Hi,

I have installed Campaign monitor for one of our client.Recently they have upgraded from Professional edition to Force.com.Since we don't have access to the standard object - Campaign, campaign monitor will not work for this customer inside Salesforce.This causes some errors while editing in the instance.

 

I have raised a case in Campaignmonitor.They replied they dont have Force.com version for this app.

They have suggested touninstall the application.But the uninstall button is freezed in the instance.I cannot

deactivate the trigger which causes the error also.

 

Can anyone suggest a solution for this

 

 

  • June 04, 2013
  • Like
  • 0
Hi,

I have two trigger on one object RFP__c.
First trigger which will update values on picklist.Second Trigger will execute based on updated picklist value.
These two trigger works independently.Any idea how to execute together.


Thanks
Amritha
  • December 23, 2013
  • Like
  • 0

Hi,

 

Is it possible to get the count of date field in report. In this  report im not able to get no:of days spent in HeadQuarter,Ex-Station,Out-Station.It shows record count and no:of days spent as 68 . I wanted to know out of those 30 days how many days he worked in Head quarters, Ex-station and outstation.  

 

Thanks

  • November 08, 2013
  • Like
  • 0

Hi,

 

Im not able to get coverage for formula field.there is a formula field named stage in RFP__c  which is taking value form Opportunity stage.Imgetting 0 coverage if i used opportunity in test class otherwise it is 65%

This is the test class

@isTest
private class TestRFPupdatevaluesTrigger{
 
  static testmethod void testTriggerMethod(){
        try{
            
            Account a= new Account(Name='AccTest1');
             Test.starttest();
            insert a;
           
               Account_Region_c__c ar = new Account_Region_c__c(Name='APAC',Origin_Parent__c=a.id);
                insert ar;
            
               Account_Entity__c ae=new Account_Entity__c(Name='Test12',Account_Region__c=ar.id);
                insert ae;
            
                Contact c=new Contact(LastName='Test1',Account_Region__c=ar.id,Accounts_Entity__c=ae.id);
                insert c;
                                CPI__c cpi=new CPI__c(Completes_Required__c=100,Name='General',Incidence_Rate__c=0.01,Bid_LOI_in_minutes__c=5,Audience__c='Gen Pop',Market__c='India',Actual_CPIchanged__c=3);
                insert cpi;
                CPI__c cpi1=new CPI__c(Completes_Required__c=0,Name='General',Incidence_Rate__c=0.01,Bid_LOI_in_minutes__c=0,Audience__c='Gen Pop',Market__c='India',Actual_CPIchanged__c=0);
                insert cpi1;
                List<RFP__c > rfplist= new List<RFP__c >();
                RFP__c rf=new RFP__c(Name='a',Rate_Card__c='General',Completes_Required__c=100,Incidence_Rate__c=0.01,Bid_LOI_in_minutes__c=5,Audience__c='Gen Pop',Market__c='India');
                insert rf;

               RFP__c rf1=new RFP__c(Name='b',Rate_Card__c='General',Completes_Required__c=0,Incidence_Rate__c=0.0,Bid_LOI_in_minutes__c=0,Audience__c='B2B',Market__c='India');
                insert rf1;
                
                
                 rf=cpi.Actual_CPIchanged__c;
                 rf=cpi.Actual_CPIchanged__c;
                 
                 rf1.Actual_CPI__c=cpi1.Actual_CPIchanged__c;
                 rf1.Proposed_CPI__c=cpi1.Actual_CPIchanged__c;
                System.assertEquals(3, rf.Actual_CPI__c);
                System.assertEquals(0, rf1.Actual_CPI__c);
                update rf;
                update rf1;
                rfplist.add(rf);
                rfplist.add(rf1);


              

Below code is not getting coverage:

 for(RFP__c r : trigger.new){

 

    if((r.Audience__c == 'B2B' || r.Audience__c == 'Gen Pop') && r.Stage__c == 'RFP_Received')
    {    
        aud.add(r.Audience__c);
    }
   
   
}



//If audience is B2B or Genpop
try{
if(aud.size()>0){
    Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();
 
    for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Incidence_Rate__c,Actual_CPIchanged__c,Audience__c,Stage__c, Completes_Required__c,Name,Market__c  FROM CPI__c WHERE    (Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market)]){
        cpi1.put(obj1.Completes_Required__c , obj1);
        system.debug('CPI'+cpi1);
    }
 
 
    if(cpi1.size()>0){
    
         
        
           for(RFP__c r2 :trigger.new){
                
                        r2.Actual_CPI__c = cpi1.get(r2.Completes_Required__c).Actual_CPIchanged__c;
                        if(r2.Proposed_CPI__c == 0.00 )
                    {
                        r2.Proposed_CPI__c= cpi1.get(r2.Completes_Required__c).Actual_CPIchanged__c;
                                         }
                               
    
    }
   }
    else{
        
           for(RFP__c  r2 : trigger.new){
             
               r2.Actual_CPI__c =0.00;
            }
             
    }
}    
}

catch(exception e){
}


}
           
                           
     

 

 

  • October 19, 2013
  • Like
  • 0

Hi,

 

Here Im trying to create a trigger where there is master object (Custom object-Opportunity) and child object(RFP).

Im mapping values from other object (Ratecard) when i entered some parameters in RFP.

In RFP there are some parameters(CompletesRequired,BID,Incidence rate,Market,Audience,Ratecard).We have same fields in Ratecard object with Actual CPI (currency) which we are uploading through dataloader.

When i entered these parameters in RFP the ActualCpi will populate automatically in RFP Object.

this scenario is working for one RFP entry.How can i use lists in this case for multiple rfp entry.

 

trigger RFPupdate on RFP__c (before insert, before update) {
 
 
Set<Decimal> comp = new Set<Decimal>();
Set<Decimal> bid  = new Set<Decimal>();
Set<Decimal> inc  = new Set<Decimal>();
List<String> aud  = new List<String>();
List<String> stage = new List<String>();
List<String> stage2 = new List<String>();
List<String> market=new List<String>();
List<String> ratecard =new List<String>();
List<Id> opp=new List<Id>();
 
for(RFP__c r : trigger.new){
 
 
    if(r.Completes_Required__c != null){
        comp.add(r.Completes_Required__c);
       } 
    if(r.Bid_LOI_in_minutes__c != null){ 
        bid.add(r.Bid_LOI_in_minutes__c);
        }
    if(r.Incidence_Rate__c != null)
    {
        inc.add(r.Incidence_Rate__c);
     }
    if((r.Audience__c == 'B2B' || r.Audience__c == 'Gen Pop') && r.Stage__c == 'RFP_Received')
    {    
        aud.add(r.Audience__c);
    }
    if(r.Market__c != null)
    {
        market.add(r.Market__c);
    }
   if(r.Rate_Card__c != null)
   {
     ratecard.add(r.Rate_Card__c);
   }
   if(r.Opportunity__c!=null)
   {
      opp.add(r.Opportunity__c);
      system.debug('Opp*****'+opp);
   }
}
 
//If audience is B2B or Genpop
try{
if(aud.size()> 0){
    Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();
 
    for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Incidence_Rate__c,Actual_CPIchanged__c,Audience__c,Stage__c, Completes_Required__c,Name,Market__c  FROM CPI__c WHERE    (Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market  )]){
        cpi1.put(obj1.Completes_Required__c , obj1);
        system.debug('CPI'+cpi1);
    }
 
    // We have all the reference data we need, last loop on the each Opportunity
 
    if(cpi1.size()>0){
    
       system.debug('CPISize@@@@@@@'+cpi1.size());
        for(RFP__c rf1: trigger.new){
         
                system.debug('^^^^^^^^^^^^^^^RFP'+rf1);
                rf1.Actual_CPI__c = cpi1.get(rf1.Completes_Required__c).Actual_CPIchanged__c;
                   system.debug('ActualCPI################'+rf1.Actual_CPI__c);
                    if(rf1.Proposed_CPI__c == 0.00 ){
                        rf1.Proposed_CPI__c= cpi1.get(rf1.Completes_Required__c).Actual_CPIchanged__c;
                        system.debug('ProposedCPI##############'+rf1.Proposed_CPI__c);
                    }
                               
       
        
        }
    
   } 
    else{
        for(RFP__c  rf1 : trigger.new){
            
               rf1.Actual_CPI__c =0.00;
            
        }      
    }
}    
}
 
catch(exception e){
}
 
}
  • October 16, 2013
  • Like
  • 0

Hi,

 

I have created a time dependent workflow .

The rule criteria is NOT(ISBLANK(Closed_Date__c)) && (TODAY() <= Closed_Date__c) && OR(NOT(ISPICKVAL(Stage__c , 'RFP_Status_Won')),NOT(ISPICKVAL(Stage__c , 'RFP_Status_Lost')))

 

Closed date is date field which is updating through other workflow.it will calculate as Bid date+60

 

Here time dependent workflow will only work when deactivate other workflow.But i cannot deactivate the other workflow on closed date .Is there any solution for this

 

  • September 11, 2013
  • Like
  • 0

Hi,

 

 Im using dupecatcher to avoid duplicate leads. I have issues in lead page there are three email field ie
Email1, Email2, Email3. I have entered 'test@gmail.com' in Email1 field in first lead. If I enter same email id in Email2  field in second lead alert is not throwing. Dupecatcher will only throw exception if i enter email id in corresponding field ie Email1 field.I checked with dupecatcher support team ,this was their reply
If the Filter checks Leads, then it’s not possible to cross match rules.
The only way to cross match rules in DupeCatcher is
if you have a multi-object filter (Lead against Contact or Account).
Hence it is not possibel through Dupe catcher .Is there any other way to solve this issue

 

Thanks

  • September 10, 2013
  • Like
  • 0

Hi,

 

I have a trigger in opportunity where im updating a currency fields (Proposed value, Actual value) when stage is 'Received'. 

Proposed value is an editable field.I can update the value in Proposed Value .But When i changed the Proposed value and update stage as 'Submitted' .The value is not getting updated. It s showing old value.

 

trigger CPIupdatevalues on Opportunity__c (before insert, before update) {


Set<Decimal> comp = new Set<Decimal>();
Set<Decimal> bid  = new Set<Decimal>();
Set<Decimal> inc  = new Set<Decimal>();
List<String> aud  = new List<String>();
List<String> stage = new List<String>();

List<String> market=new List<String>();
List<String> ratecard =new List<String>();

for(Opportunity__c l : trigger.new){

   if(l.Stage__c == 'Received'){
    if(l.Stage__c == 'Received'){
        stage.add(l.Stage__c);
    }
 
    if(l.Completes_Required__c != null){
        comp.add(l.Completes_Required__c);
       } 
    if(l.Bid_LOI_in_minutes__c != null){ 
        bid.add(l.Bid_LOI_in_minutes__c);
        }
    if(l.Incidence_Rate__c != null)
    {
        inc.add(l.Incidence_Rate__c);
     }
    if(l.Audience_B2B_B2C__c == 'B2B' || l.Audience_B2B_B2C__c == 'Gen Pop' &&l.Audience_B2B_B2C__c != 'Niche' )
    {    
        aud.add(l.Audience_B2B_B2C__c);
    }
    if(l.Market__c != null)
    {
        market.add(l.Market__c);
    }
   if(l.Rate_Card__c != null)
   {
     ratecard.add(l.Rate_Card__c);
   }
}
}

//If audience is B2B or Genpop
try{
if(aud.size()> 0){
    Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();


    for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Actual_CPIchanged__c,Audience__c,Stage__c, Completes_Required__c,Name,Market__c FROM CPI__c WHERE    Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market AND Stage__c IN:stage ]){
        cpi1.put(obj1.Completes_Required__c , obj1);
        system.debug('CPI'+cpi1);
    }
    system.debug('@@@@@@@@@@@@@@<@@@cpi @@@@@@@@'+'cpi1 ');

    // We have all the reference data we need, last loop on the each Opportunity


    if(cpi1.size()>0){
        for(Opportunity__c l1 : trigger.new){
             
                l1.ActualValue__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;
                    if(l1.ProposedValue__c == 0 ){
                        l1.ProposedValue__c= cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;//Updating Proposed value    
                    
                    }
            
        }  
        
    }
    else{
        for(Opportunity__c l1 : trigger.new){
            
                l1.Actual_CPI__c =0;
            
        }      
    }
    
}
}
catch(exception e){
}
}

 

Anyidea why it was not updating

  • September 07, 2013
  • Like
  • 0

Hi

 

I have created a workflow in Opportunity.

If Opportunity stage doesn’t close (won or lost) on or before Expected date of closure__c. Stage should automatically update as RFP_Unknown.An email alert should sent to Accunt manager.

Expected Date of closure__c is date field in opportunity which is calculating thrugh workflow field update (Bidsentdate__c(date field)+60=Expected date of closure__c  if Bidsentdate__c is filled).

I set criteria as

AND(Opportunity(C): Stagenot equal toRFP_Status_Won,RFP_Status_Lost (Expected Dateof closure < today OR Expected Dateof closure = today))
Always stage is updating as RFP_Unknown.Is this bcz of other workflow
 
Can anyne help on this issue
 
 
  • September 06, 2013
  • Like
  • 0

Hi,

 

I have a trigger which updating values in two fields ActualCPI and Proposed CPI.Here im able to insert the values in both field. Proposed CPI is an editable field.I want to change the value in Proposed CPI.But Im not able to update the value in Proposed CPI.

How can we make a field editable in trigger.

 

trigger CPIupdatevalues on Opportunity__c (before insert, before update) {


Set<Decimal> comp = new Set<Decimal>();
Set<Decimal> bid = new Set<Decimal>();
Set<Decimal> inc=new Set<Decimal>();
List<String> aud=new List<String>();

List<String> market=new List<String>();
List<String> ratecard =new List<String>();

for(Opportunity__c l : trigger.new){
    if(l.Completes_Required__c != null){
        comp.add(l.Completes_Required__c);
       } 
    if(l.Bid_LOI_in_minutes__c != null){ 
        bid.add(l.Bid_LOI_in_minutes__c);
        }
    if(l.Incidence_Rate__c != null)
    {
        inc.add(l.Incidence_Rate__c);
     }
    if(l.Audience_B2B_B2C__c == 'B2B' || l.Audience_B2B_B2C__c == 'Gen Pop' &&l.Audience_B2B_B2C__c != 'Niche' )
    {    
        aud.add(l.Audience_B2B_B2C__c);
    }
    if(l.Market__c != null)
    {
        market.add(l.Market__c);
    }
   if(l.Rate_Card__c != null)
   {
     ratecard.add(l.Rate_Card__c);
   }
}


if(aud.size()> 0)
{
Map<Decimal, CPI__c> cpi1 = new Map<Decimal, CPI__c>();


for(CPI__c obj1 : [SELECT Id, Bid_LOI_in_minutes__c,Actual_CPI__c,Actual_CPIchanged__c,Audience__c, Completes_Required__c,Name,Market__c FROM CPI__c WHERE    Bid_LOI_in_minutes__c IN :bid
                               AND  Completes_Required__c IN: comp AND Incidence_Rate__c IN:inc AND Audience__c IN:aud AND Name IN:ratecard AND Market__c IN:market  ]){
    cpi1.put(obj1.Completes_Required__c , obj1);
    system.debug('CPI'+cpi1);
}
system.debug('@@@@@@@@@@@@@@<@@@cpi @@@@@@@@'+'cpi1 ');



if(cpi1.size()>0 ){

for(Opportunity__c l1 : trigger.new){

  
     
        l1.Actual_CPI__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;
        l1.CPI_in__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c ;//Here Im updating Proposed CPI
       
       
    
}

}


else
{
for(Opportunity__c l1 : trigger.new){
    l1.Actual_CPI__c =0;
    
    }
}

}
if(aud.size()== 0)
{

// Now we have a set of unique bid names we want to verify, time to look them up.


for(Opportunity__c l : trigger.new){
    l.Actual_CPI__c =0;
    
    }


}



}

 

if(cpi1.size()>0 ){

for(Opportunity__c l1 : trigger.new){

  
     
        l1.Actual_CPI__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c;
        l1.CPI_in__c = cpi1.get(l1.Completes_Required__c).Actual_CPIchanged__c ;//Proposed CPI
       
        system.debug('ActualCPI'+ l1.Actual_CPI__c);
        
    
}

}

 

 

  • August 22, 2013
  • Like
  • 0

Hi,

 

I have created a trigger in a custom object to update a currency field Actual CPi .I want Same field to update in another field Proposed CPi which is editable.Hence i used workflow to update Actual CPI in Proposed CPI.When i create a new record the Actaul CPI will update the value.But Proposed CPi doesnt update the Actual CPI. 

Based on execution order trigger will run first .How can i update the workflow when i create the record.

 

I used this formula for workflow :

ISCHANGED(ActualCPI)

criteria:Evaluate the rule when a record is created, and every time it’s edited

Thanks

 

 

  • August 21, 2013
  • Like
  • 0