• Shiva Venu
  • NEWBIE
  • 70 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 9
    Replies
We have lead with New and New Response status. Lead assignment rule only triggers when a new lead is created. We need to rerun the Lead assignment rule when the Lead status changes to New Response from any other lead status. 
How can we built this the solution for this?
We have this lead status on Lead object

Lead Status Pick values : New, New Response, In Progress, Rejected, Qualified

We wanted to restict users from switching status and editing records

1) When New or New Response status, user should not be able to edit any record/field on Lead until the status changes to Inprogress

2)  When the status is Inprogress, user can only change it to rejected or qualified. But can edit record with Inprogress status

I got some help and added the below validation rule.
The problem is with InProgress status, its does not allow users to update any other field/record value. It only allows user to update and save with rejected or qualified status. 

Can someone pls help, on how can we allow user to edit record/fields in Inprogess with the same validation rule below.
 
AND(
 ($Profile.Name = 'System Administrator'),
 IF(
 AND(
 OR(ISPICKVAL(PRIORVALUE( Status ),"New"),
    (ISPICKVAL(PRIORVALUE( Status ),"New Response"))),
    NOT(ISPICKVAL( Status ,"In Progress"))),
	true,
	IF(
	AND(
	(ISPICKVAL(PRIORVALUE( Status ),"In Progress")),
	AND(NOT(ISPICKVAL(Status ,"Qualified")),
NOT(ISPICKVAL(Status ,"Rejected"))
)),true,false)	
	)
   )

 
Need help with test class for the below trigger
 
trigger updateCampaignTypeonLead on CampaignMember (after insert) {
 set<Id> leadIds = new set<Id>();
              
        list<Lead> leadList = new list<Lead>();
        set<Id> campIds = new set<Id>();
        
        map<Id, CampaignMember> leadCampaign = new map<Id, CampaignMember>();  
    
        for (CampaignMember camMember : System.Trigger.New)
        {
            leadIds.add(camMember.LeadId);
            
            campIds.add(camMember.CampaignId);
            
            leadCampaign.put(camMember.LeadId, camMember);
        
        }

 map<Id,Campaign> campmap = new map <Id,Campaign>([select Id, Type from Campaign where id in: campIds]);
 
 for(Lead thisLead : [Select Id, Campaign_Type__c from Lead where Id in : leadIds and isConverted=false])
        {
          
          Campaign camp = campmap.get(leadCampaign.get(thisLead.Id).CampaignId);    

            thisLead.Campaign_Type__c = camp.Type;
            Update thisLead;
            
                       }

}

 
Trying to write a trigger for below need.
- Have a custom pick field on Lead - (Campaign_Type__c. ----- values - Webinar, Tradeshow, Events). This custom field is replica of Type field on Campagin. 
- Campaign - Standard pick Field - Type (Values - Webinar, Tradeshow, Events)

Whenever a lead is created a its gets associated to a campaign, i need the Type pickvalue from Campaign to be copied to Campaign_Type__c field on Lead for the associated Campagin. 
There can be cases where the campaign is assoicated to multiple campaigns, in such cases the lastest associated campaign Type should be updated on Campaign_Type__C on Lead. 

Here is something i am trying, any help is much appreciated!

```
trigger UpdateCampaignTypeonLead on CampaignMember (after insert) {

for(CampaignMember camMember : Trigger.New){
        campaignMemberIdSet.add(camMember.id);
    }

{
        set<Id> leadIds = new set<Id>();        
       list<Lead> leadList = new list<Lead>();
        set<Id> campIds = new set<Id>();
        map<Id, CampaignMember> leadCampaign = new map<Id, CampaignMember>();   
        
        // Iterate through the list of new Campaign Members
        for (CampaignMember camMember : System.Trigger.New)
        {
            // Add Lead to set to be queried
            leadIds.add(camMember.LeadId);
            
            //Add Campaign Ids to the campIds set
            campIds.add(camMember.CampaignId);
            
            // Add Lead and CampaignMember to map
            leadCampaign.put(camMember.LeadId, camMember);
        
        }
{
map<Id,Campaign> campmap = new map <Id,Campaign>([select Id, Type from Campaign where id in: campIds]);
for(Lead thisLead : [Select Id, Campaign_Type__c from Lead where Id in : leadIds and isConverted=false])

Campaign camp = campmap.get(leadCampaign.get(thisLead.Id).CampaignId); 
 thisLead.Campagin_Type__c = camp.Type

}
}

```
We have a campaign type pickvalue field added on Lead which is the replica or Type in Campaign object. 
When a lead is created and associated to campaign, we need the Campaign Type field to add the Type value of associated campaign on lead. 
Also, when lead receive new campaign response, the campaign type should get updated according to the new campaign associated. 
We need a email notification to be sent when a new lead is created for specific campaign.
I could not build a workflow on lead object as there is no campaign field, also campaign history is a related field. Please suggest
The Lead is created from third party application. All the lead created from this system should be added to a campaign. I have created a campaign, but how do i update the campaign history with this campaign whenever a lead is created from this third party system.

I tried creating a campaign lookup field on Lead but that will create as a separate related list and will not get added to Campaign history on lead. Please suggest.


I have created a new lightening button on Lead list view - page. When i click on this button, two fields values should per set, one being pick field and another is Checkbox.
Below is what i tried and it did not work

/lightning/o/Lead/new?defaultFieldValues= Lead_Type__c = (!URLENCODE(‘Qualified’)) Accepted_Checkbox__c = 'True'

Please suggest!

Need help with a validation rule.

Lead Status Pick values : New, New Response, In Progress, Rejected, Qualified

We have an Accept button on lead page which will change the lead status to In Progress from New or New Response.

Requirement

1. ISR Profile should not be able to change any record data until the status goes to In Progress(Only option to set status to in progress is click accept button)
2. ISR Profile can only change the status to Rejected or Qualified from In Progress.
Can we utilize standard button on Lead in Lightening to pass prevalidation and stamp some default values?

If its custom how can i build the below requirement

- Accept Button
Should be only visible to Business Rep Profile.
Button should check if the profile is Business Rep or Not once clicked.
Should check if the lead status is New, if yes set it to In progress, else in case already accepted throw and exception.
Once accepted - Business Rep Accepted button show get checked and accepted date and time should get added.

Thank you!!
How to copy custom and few standard field values from Lead (like Lead id, Email address, Source) to both Opportunity and Contact when the lead gets converted

Thanks!
All the leads should only get created from marketing automation system and users should not be allowed to import via data loader/import wizard or even manual create the leads.
What are the options available to achieve this?
Thanks!!
My requirement is to send an email notification to specific Campaign owners when campaign end date is nearing which they own. This is not for all but specific owner's(10 users) for the campaign which they own, 5 days before the campaign end date.
 
I want to concatenate 5 picklist fields values in a new custom field on the Lead object. All are single pick text fields. The new field can be a formula (read-only) or text field.

Output format: Picklist1_Picklist2_Picklist3_Picklist4_Picklist5
condition :
1. underscore should skip if any value is null or blank.
2. For picklist 1 it should only add selected values (Eg: Pick values: a, b, c, d, e, f: it should only add to the formula when a or b or c is selected else it should be blank)

Can someone help with the formula or workflow for this requirement?
I want to concatenate 5 picklist fields values on the Lead object. All are single pick fields. I am creating a formula field to do so (let me know if there is any other best approach, but wanted to achieve through configuration not code). 
Output format : Picklist1_Picklist2_Picklist3_Picklist4_Picklist5
condition :
1. underscore should skip if any value is null or blank.
2. For picklist 1 it should only add selected values (Eg : Pickvalues : a, b, c, d, e, f : it should only add to the formula when a or b or c is selected else it should be blank)

Can you someone help on this request?
Hi All,

Is it possible through configuration to default owner field values to another custom look up user field if the custom field is blank.

Please let me know if there is any way through configuration

Thanks
Shiva
 
Hi All,

I have a default standard owner field on the campaign page, now added a new campaign requester field (lookup user) and renaming standard owner field to a campaign created by. Whenever I click new campaign I want to copy the owner to campaign requester by default and then the user can go to requester lookup field and change if required. Please suggest if this can be done. I need it when clicked new not after saving the record.

Thanks
Shiva
Hi All,

The requirement is to Activate or Deactivate(greyed out) pick field based on checkbox value - true/False. 
Eg: I have 2 Pick fields A and B, and a checkbox C. Pick field 'A' has values - ab, bc, ca, and pick field B has values - zx, xv, vw. When I select Pick value "ab" from A then the checkbox should become true and Pick B should be made required but if I select any other value apart from ab from A, Pick field B should be deactivated and should not allow picking any value.  can someone help with configuration 
Need help with test class for the below trigger
 
trigger updateCampaignTypeonLead on CampaignMember (after insert) {
 set<Id> leadIds = new set<Id>();
              
        list<Lead> leadList = new list<Lead>();
        set<Id> campIds = new set<Id>();
        
        map<Id, CampaignMember> leadCampaign = new map<Id, CampaignMember>();  
    
        for (CampaignMember camMember : System.Trigger.New)
        {
            leadIds.add(camMember.LeadId);
            
            campIds.add(camMember.CampaignId);
            
            leadCampaign.put(camMember.LeadId, camMember);
        
        }

 map<Id,Campaign> campmap = new map <Id,Campaign>([select Id, Type from Campaign where id in: campIds]);
 
 for(Lead thisLead : [Select Id, Campaign_Type__c from Lead where Id in : leadIds and isConverted=false])
        {
          
          Campaign camp = campmap.get(leadCampaign.get(thisLead.Id).CampaignId);    

            thisLead.Campaign_Type__c = camp.Type;
            Update thisLead;
            
                       }

}

 
I want to concatenate 5 picklist fields values on the Lead object. All are single pick fields. I am creating a formula field to do so (let me know if there is any other best approach, but wanted to achieve through configuration not code). 
Output format : Picklist1_Picklist2_Picklist3_Picklist4_Picklist5
condition :
1. underscore should skip if any value is null or blank.
2. For picklist 1 it should only add selected values (Eg : Pickvalues : a, b, c, d, e, f : it should only add to the formula when a or b or c is selected else it should be blank)

Can you someone help on this request?
We have this lead status on Lead object

Lead Status Pick values : New, New Response, In Progress, Rejected, Qualified

We wanted to restict users from switching status and editing records

1) When New or New Response status, user should not be able to edit any record/field on Lead until the status changes to Inprogress

2)  When the status is Inprogress, user can only change it to rejected or qualified. But can edit record with Inprogress status

I got some help and added the below validation rule.
The problem is with InProgress status, its does not allow users to update any other field/record value. It only allows user to update and save with rejected or qualified status. 

Can someone pls help, on how can we allow user to edit record/fields in Inprogess with the same validation rule below.
 
AND(
 ($Profile.Name = 'System Administrator'),
 IF(
 AND(
 OR(ISPICKVAL(PRIORVALUE( Status ),"New"),
    (ISPICKVAL(PRIORVALUE( Status ),"New Response"))),
    NOT(ISPICKVAL( Status ,"In Progress"))),
	true,
	IF(
	AND(
	(ISPICKVAL(PRIORVALUE( Status ),"In Progress")),
	AND(NOT(ISPICKVAL(Status ,"Qualified")),
NOT(ISPICKVAL(Status ,"Rejected"))
)),true,false)	
	)
   )

 
Trying to write a trigger for below need.
- Have a custom pick field on Lead - (Campaign_Type__c. ----- values - Webinar, Tradeshow, Events). This custom field is replica of Type field on Campagin. 
- Campaign - Standard pick Field - Type (Values - Webinar, Tradeshow, Events)

Whenever a lead is created a its gets associated to a campaign, i need the Type pickvalue from Campaign to be copied to Campaign_Type__c field on Lead for the associated Campagin. 
There can be cases where the campaign is assoicated to multiple campaigns, in such cases the lastest associated campaign Type should be updated on Campaign_Type__C on Lead. 

Here is something i am trying, any help is much appreciated!

```
trigger UpdateCampaignTypeonLead on CampaignMember (after insert) {

for(CampaignMember camMember : Trigger.New){
        campaignMemberIdSet.add(camMember.id);
    }

{
        set<Id> leadIds = new set<Id>();        
       list<Lead> leadList = new list<Lead>();
        set<Id> campIds = new set<Id>();
        map<Id, CampaignMember> leadCampaign = new map<Id, CampaignMember>();   
        
        // Iterate through the list of new Campaign Members
        for (CampaignMember camMember : System.Trigger.New)
        {
            // Add Lead to set to be queried
            leadIds.add(camMember.LeadId);
            
            //Add Campaign Ids to the campIds set
            campIds.add(camMember.CampaignId);
            
            // Add Lead and CampaignMember to map
            leadCampaign.put(camMember.LeadId, camMember);
        
        }
{
map<Id,Campaign> campmap = new map <Id,Campaign>([select Id, Type from Campaign where id in: campIds]);
for(Lead thisLead : [Select Id, Campaign_Type__c from Lead where Id in : leadIds and isConverted=false])

Campaign camp = campmap.get(leadCampaign.get(thisLead.Id).CampaignId); 
 thisLead.Campagin_Type__c = camp.Type

}
}

```
We have a campaign type pickvalue field added on Lead which is the replica or Type in Campaign object. 
When a lead is created and associated to campaign, we need the Campaign Type field to add the Type value of associated campaign on lead. 
Also, when lead receive new campaign response, the campaign type should get updated according to the new campaign associated. 
Need help with a validation rule.

Lead Status Pick values : New, New Response, In Progress, Rejected, Qualified

We have an Accept button on lead page which will change the lead status to In Progress from New or New Response.

Requirement

1. ISR Profile should not be able to change any record data until the status goes to In Progress(Only option to set status to in progress is click accept button)
2. ISR Profile can only change the status to Rejected or Qualified from In Progress.
Can we utilize standard button on Lead in Lightening to pass prevalidation and stamp some default values?

If its custom how can i build the below requirement

- Accept Button
Should be only visible to Business Rep Profile.
Button should check if the profile is Business Rep or Not once clicked.
Should check if the lead status is New, if yes set it to In progress, else in case already accepted throw and exception.
Once accepted - Business Rep Accepted button show get checked and accepted date and time should get added.

Thank you!!
My requirement is to send an email notification to specific Campaign owners when campaign end date is nearing which they own. This is not for all but specific owner's(10 users) for the campaign which they own, 5 days before the campaign end date.
 
I want to concatenate 5 picklist fields values in a new custom field on the Lead object. All are single pick text fields. The new field can be a formula (read-only) or text field.

Output format: Picklist1_Picklist2_Picklist3_Picklist4_Picklist5
condition :
1. underscore should skip if any value is null or blank.
2. For picklist 1 it should only add selected values (Eg: Pick values: a, b, c, d, e, f: it should only add to the formula when a or b or c is selected else it should be blank)

Can someone help with the formula or workflow for this requirement?
Hi All,

The requirement is to Activate or Deactivate(greyed out) pick field based on checkbox value - true/False. 
Eg: I have 2 Pick fields A and B, and a checkbox C. Pick field 'A' has values - ab, bc, ca, and pick field B has values - zx, xv, vw. When I select Pick value "ab" from A then the checkbox should become true and Pick B should be made required but if I select any other value apart from ab from A, Pick field B should be deactivated and should not allow picking any value.  can someone help with configuration