• admin aw
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 17
    Replies
Hi, We have integration with marketing software and SF. Task is auto create for lead/contact owner by the specific user "Marketing".
When a task is created by this user, I'd like an email notification to go out to the task owner.
But when I try to get this trigger working, system gives me syntax errors. Can somebody help please?

If
( Task.CreatedByID == '00520000001WZwB' && Task.Status = 'Started')
{

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String emailid = Task.Owner.Email;

String[] toAddresses = new String[] {emailid};

mail.setToAddresses(toAddresses);
mail.setSenderDisplayName('Marketing');

mail.saveAsActivity = false;
mail.setTargetObjectId(Task.ID);
mail.setTemplateId('00Xg0000000DnJl');
mail.setUseSignature(false);
mail.setSaveAsActivity(false);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}

Thank you

Hi,

 

I am not a developer and it's hard for me to create even a simple Apex code.

Can somebody post a simple APEX trigger to update lookup field based on the picklist value field.

What I am looking for is to update:

Campaign Source (custom lookup field on opportunity) to a specific campaign name "Marketing Campaign" if lead source field (picklist ) is "Marketing Lead".

Thank you

I need to create a VR for the following:

 

Ig opportunity stage is  and higher(picklist), then field Supplier (picklist) becomes required(can not be null), but for certain profiles and product preselection only (picklist).

Here is what I have:

 

AND (OR(ISPICKVAL( Product_Preselection__c ,"A"),(ISPICKVAL(Product_Preselection__c ,"Be")),OR( ISPICKVAL(StageName ,"7.2 Closed Lost"),ISPICKVAL(StageName ,"7.1 Closed Won"), ISPICKVAL(StageName ,"7.3 Qualified Out"), ISPICKVAL(StageName ,"6. Contract Sent"), ISPICKVAL(StageName ,"5. Contract Drafted")),
OR(
($User.ProfileId = "PrifileID 1"),($User.ProfileId ="PrifileID 2"),( $User.ProfileId = "PrifileID 3"),($User.ProfileId ="PrifileID 4")),
ISPICKVAL( Supplier__c , "")))

 

The formula passed syntax check, but when I activate it I have the following:

 

1. Instead of specified product preselections it works for ALL of them.

2. Even when  Supplier is selected, the same error message appears- "Please add Supplier".

3. As a result, opportunity can not be saved

 

"Supplier" field is a dependent field on Product Preselection and has picklist values only for two product preselections specified in the VR. Other Product Preselection values don't have any dependent picklist values in the Supplier field.

Not sure if it's relevant.

 

Thanks!

 

 

There is a field on user object -Sales Rep Quota Category.It's a pickiest.

I need to create a field on the opportunity object. Opportunity owner is a standard field and is assigned automatically to the user who created the record. I want new field Sales Rep Quota Category ( one opportunity object) automatically assign value based on the value assigned to the opportunity owner on user profile.

Example- User  John Doe has Sales Rep Quota Category assigned as Category 1 on users profile.

Opportunity Company ABC is created by user John Doe.

Fields: opportunity owner-John Doe( automatically populated)

              Sales Rep Quota Category  pops up as Category 1( automatically assigned based on user profile data).

 

Any ideas would be helpful.

 

Thanks!

 

I am not sure how to proceed here.

I have standard object Opportunity and custom object Competitors.

I need to create a validation rule for:

When Competitor field on the Opportunity object is not NULL ,then Comments field in the Competitor object must be updated.

The problem is here- Comments field is a large text field,where comments are left. One competitor maybe associated with multiple opportunities. For example : for  Opportunity 1 Competitor is ABC Company, for opportunity 2 competitor is ABC Company as well.  Comment field will serve as a knowledge library, where sales reps will add their comments about competitors  they learnt during closing their opps. All comments will be stored in that comment section and if somebody already added comments for opportunity 1 for this competitor, then  when the opportunity 2 comes along, comments field is not blank,I need to force sales reps to update the field each time Opportunity is closed won or closed lost and competitor is known( competitor field on the opportunity layout is not blank). NO ISNULL function won't work starting with opportunity 2, given than somebody already added comments when doing opportunity 1. '

I hope I didn't confuse anyone with my long explanation. I’ll be happy to clarify.

Thanks for helping me out.

 

 

Hi,

 

I am not a developer and it's hard for me to create even a simple Apex code.

Can somebody post a simple APEX trigger to update lookup field based on the picklist value field.

What I am looking for is to update:

Campaign Source (custom lookup field on opportunity) to a specific campaign name "Marketing Campaign" if lead source field (picklist ) is "Marketing Lead".

Thank you

I need to create a VR for the following:

 

Ig opportunity stage is  and higher(picklist), then field Supplier (picklist) becomes required(can not be null), but for certain profiles and product preselection only (picklist).

Here is what I have:

 

AND (OR(ISPICKVAL( Product_Preselection__c ,"A"),(ISPICKVAL(Product_Preselection__c ,"Be")),OR( ISPICKVAL(StageName ,"7.2 Closed Lost"),ISPICKVAL(StageName ,"7.1 Closed Won"), ISPICKVAL(StageName ,"7.3 Qualified Out"), ISPICKVAL(StageName ,"6. Contract Sent"), ISPICKVAL(StageName ,"5. Contract Drafted")),
OR(
($User.ProfileId = "PrifileID 1"),($User.ProfileId ="PrifileID 2"),( $User.ProfileId = "PrifileID 3"),($User.ProfileId ="PrifileID 4")),
ISPICKVAL( Supplier__c , "")))

 

The formula passed syntax check, but when I activate it I have the following:

 

1. Instead of specified product preselections it works for ALL of them.

2. Even when  Supplier is selected, the same error message appears- "Please add Supplier".

3. As a result, opportunity can not be saved

 

"Supplier" field is a dependent field on Product Preselection and has picklist values only for two product preselections specified in the VR. Other Product Preselection values don't have any dependent picklist values in the Supplier field.

Not sure if it's relevant.

 

Thanks!

 

 

 

I am not sure how to proceed here.

I have standard object Opportunity and custom object Competitors.

I need to create a validation rule for:

When Competitor field on the Opportunity object is not NULL ,then Comments field in the Competitor object must be updated.

The problem is here- Comments field is a large text field,where comments are left. One competitor maybe associated with multiple opportunities. For example : for  Opportunity 1 Competitor is ABC Company, for opportunity 2 competitor is ABC Company as well.  Comment field will serve as a knowledge library, where sales reps will add their comments about competitors  they learnt during closing their opps. All comments will be stored in that comment section and if somebody already added comments for opportunity 1 for this competitor, then  when the opportunity 2 comes along, comments field is not blank,I need to force sales reps to update the field each time Opportunity is closed won or closed lost and competitor is known( competitor field on the opportunity layout is not blank). NO ISNULL function won't work starting with opportunity 2, given than somebody already added comments when doing opportunity 1. '

I hope I didn't confuse anyone with my long explanation. I’ll be happy to clarify.

Thanks for helping me out.