• Gonapati Bhavitha 11
  • NEWBIE
  • 10 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 9
    Replies
How to deploy production to sandbox 
Please mention the step by steps navigation
whenever opportunity is closed won and At least one primary quote is there:


Check contracted Check box is in Opportunity AUtomatically In SAlesforce CPQ (USING FLows) ANd verify Contract is created or not
using Batch Apex:
When an Opportunity is Stuck In Prospecting or Qualification Stage For at least 30 days then it should be automatically "Closed Lost".
Also, a Notification email Should be sent to the Opportunity Creator and SalesRep(lookup-User)  5 days before it is "Closed Lost".
Before these ( 25,30 ) days If the User Updates the Stage From Qualification to Other Stages, Whatever the Above Schedule path Should Not Trigger
using Trigger:  Create Account object  automatically Update Contact Object 
We created a Custom Probability % field on the Opportunity. User would like it to pre-populate with a given value based on the Stage and also be able to edit the percentage as needed. I tried a formula below (which is probably not correct) and received "Error: Field StageName may not be used in this type of formula" 
  • IF(StageName=ISPICKVAL("5 - Contract in Process"),90,(IF(StageName=ISPICKVAL("4 - Negotiate Terms"),75,(IF(StageName=ISPICKVAL("3 - Obtaining Approval"),25,(IF(StageName=ISPICKVAL("2 - Expressed Interest"),10," ")))))))
Where do I go from here, please? 
  • March 23, 2022
  • Like
  • 0
Email template where Date:{!Case.Today_Date__c}  is used on case object.Once case is created from Email-to-case a autoresponse mail send to person who sent that mail. But in mail not gating date value of case today date..It print Date:{!Case.Today_Date__c} on mail also.
Can any one help me what can be root cause.
public class test{
 public static void method2(list<Opportunity>newlist,Map<id,opportunity>oldmap){
       try{
       // list<messaging.email>emaillist=new list<Messaging.email>();
        map<id,opportunity>oppmap=new map<id,opportunity>();
       
        for(opportunity opp:newlist){
            // Opportunity opp=new Opportunity();
          //  try{            
            if(oldmap!=null && opp.StageName!=oppmap.get(opp.id).stagename && opp.StageName=='Closed won'){
                oppmap.put(opp.ownerid,opp);
           // }catch(NullpointerException e){
               System.debug('error');
           // }
            }
        }
     list<User> userlist=[select id,Email,Name from User where id  in:oppmap.keyset()];
        list<Messaging.Email>emails=new list<Messaging.email>();
        Map<id,String>usermap=new map<id,String>();
            for(User u:userlist) {
               // if(oppmap.conatinskey(u.id){
                usermap.put(u.id,u.email);
                System.debug('mirza');
          //  }     
            }
       Messaging.SingleEmailMessage msg=new Messaging.SingleEmailMessage();
        for(User u : userList){
     list <String> toadd=new LIST<String>();
            String e1=usermap.get(u.id);
            toadd.add(e1);
            msg.setToAddresses(toadd);
        msg.setSubject('Test subject');
          //  msg.setToAddresses(List<String> param1)
            msg.setPlainTextBody('test body');
          //  messaging.email emaillist[]=new Messaging.email();
         emails.add(msg);
               
        }
        Messaging.sendEmail(emails);
    }
        catch(exception e){
            System.debug(e.getMessage());
        }
}
}

------------
trigger trigopp on Opportunity (after update) {
    if(Trigger.isUpdate && Trigger.isAfter){
        opp8.method2(Trigger.old,Trigger.oldMap);
    }
}
I have created a Custom field called “Number of Locations” on the Account Object (Data Type=Number)
Object : Account
Trigger: After Insert

This is my code:

trigger ContactsCreation on Account (after insert) {
list<contact> listContact = new list<contact>();
map<id,decimal> mapAcc = new map<id,decimal>();
  for(Account acc:trigger.new){
      mapAcc.put(acc.id,acc.NumberofLocations__c);
     }
        if(mapAcc.size()>0 && mapAcc!=null){
            for(Id accId:mapAcc.keyset()){
               for(integer i=0;i<mapAcc.get(accId);i++){
                 contact newContact=new contact();
                 newContact.accountid=accId;
                 newContact.lastname='contact'+i;
                 listContact.add(newContact);
                 }
              }
         }
if(listContact.size()>0 && listContact!=null)
insert listContact;

Can someone please explain the logic behind the no of creation of contact records based on location field.
Sample example: I have given account name,no of locations=2 in account object, then after two contacts record got created with lastname as contact0,contact1.
Why multiple contacts are creating as per the above logic?
 
  • March 25, 2021
  • Like
  • 0

Hi ,
Can anybody help me with the fromula field which will calulate the Age  from date of birth and display it in Years,Months & Days.?
All validations should be there.Including Leap Year Scenario.

 

BR,
Me

Hi all,

I'm trying to use Process Builder to change the Case Status upon a custom picklist field modification. I'd like to use the same status for multiple values of the picklist. Was trying to keep the assignment formula clean by using an OR inside the CASE statement but doesn't seem to work.

The formula would look like so:

CASE([Case].PicklistField__c,
    "Value1" OR "Value2", "Status1",
    "Value3" OR "Value4", "Status2",
    "Status3"
)

Thanks in advance!
Eno
  • February 08, 2017
  • Like
  • 2