• Nick Bosch 4
  • NEWBIE
  • 59 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 8
    Replies
I want to say if Task B on Contact X happens 60 days or more after Task A then set number field equal to 1 otherwise 0. This should continue as well, if Task C happens 60 days or more after Task B then 1 otherwise 0. Is this possible with a field update workflow or PB?
It seems like I can't edit the view my users see on the "Add Products" to an Opportunity view. I found on this forum that I should go to Opportunity Product > Page Layout > Edit Multi-Line Layout. I've gone there and the fields that appear there and the fields that my users see do not match. Can someone point me in the right direction?

Multi-line Layout Fields
Add products page
I created an Apex Trigger, a few custom fields, and a couple validation rules so that I can check that a contact role is assigned to an opportunity. It actually allows me to check that multiple contacts are assigned at different stages of the sales cycle. It works great in my sandbox but I can't deploy the Apex Before Trigger because it doesn't reach the code coverage thresholds. I'm a point-and-click admin that happened to pull this together based on articles I found. Can someone help me write the test so that I can pass the code coverage test and deploy this?

Here is the Apex before trigger:
trigger updatecontactrolecount on Opportunity (before insert, before update)
{

Boolean isPrimary;
Integer iCount;

Map<String, Opportunity> oppty_con = new Map<String, Opportunity>();//check if the contact role is needed and add it to the oppty_con map
for (Integer i = 0; i < Trigger.new.size(); i++)
{
    oppty_con.put(Trigger.new[i].id,
    Trigger.new[i]);
}
isPrimary = False;
for (List<OpportunityContactRole> oppcntctrle :[select OpportunityId from OpportunityContactRole where (OpportunityContactRole.IsPrimary = True and OpportunityContactRole.OpportunityId in :oppty_con.keySet())])
{
if (oppcntctrle .Size() >0)
{
isPrimary = True;
}
}
iCount = 0;
for (List<OpportunityContactRole> oppcntctrle2 : [select OpportunityId from OpportunityContactRole where (OpportunityContactRole.OpportunityId in :oppty_con.keySet())])//Query for Contact Roles
{
if (oppcntctrle2 .Size()>0)
{
iCount= oppcntctrle2 .Size();
}
}
for (Opportunity Oppty : system.trigger.new) //Check if roles exist in the map or contact role isn't required
{
Oppty.Number_of_Contacts_Roles_Assigned__c = iCount;
Oppty.Primary_Contact_Assigned__c =isPrimary;
}
}

Thank you!
Nick

I want to restrict all users, except admins, to our "Line of Sight - 10%" opportunity stage. Stated differently, "Line of Sight - 10%%" is the only opportunity stage a user should be able to set their opportunity to unless they're an admin. I've written the following rule. It allows admins to set to any stage like it should. However, it prevents everyone else from setting any opportunity stage. Meaning, users can't set the opportunity stage to "Line of Sight - 10%" like they should be able to. They also can't set it to any other stage but that is correct. Any idea what I'm missing?
 

AND(
	OR(
	ISNEW()
	ISCHANGED(StageName)),
	NOT(ISPICKVAL(StageName, "Line of Sight - 10%")),
	$Profile.Name <> "Admin")
Thank you,
Nick
I'm trying to create a validation rule that prevents reps from moving an opportunity forward until it has been approved by our ops team. I've tried a number of versions of formulas on the forum but I can't seem to get it quite right.

The formula should say that if the opportunity - is a Change Request and the stage has changed or if its new and the stage is either Closed/Won, Closed/Won - Pending, or Closing - 90%, and the Approval Status is either New, Pending, or Rejected - then show the validation rule error that says it must be approved before advancing.

Can someone please highlight where I am going wrong here? I would greatly appreciate any help I can get.
 
AND (RecordType.Name = "Change Request", 
OR( 
ISCHANGED(StageName), 
ISNEW()), 
OR( 
ISPICKVAL(StageName, "Closed/Won"), 
ISPICKVAL(StageName, "Closed/Won - Pending"), 
ISPICKVAL(StageName, "Closing - 90%")), 
OR( 
ISPICKVAL(Approval_Status__c, "New"), 
ISPICKVAL(Approval_Status__c, "Pending"), 
ISPICKVAL(Approval_Status__c, "Rejected") 
) 
)

 

I want to restrict all users, except admins, to our "Line of Sight - 10%" opportunity stage. Stated differently, "Line of Sight - 10%%" is the only opportunity stage a user should be able to set their opportunity to unless they're an admin. I've written the following rule. It allows admins to set to any stage like it should. However, it prevents everyone else from setting any opportunity stage. Meaning, users can't set the opportunity stage to "Line of Sight - 10%" like they should be able to. They also can't set it to any other stage but that is correct. Any idea what I'm missing?
 

AND(
	OR(
	ISNEW()
	ISCHANGED(StageName)),
	NOT(ISPICKVAL(StageName, "Line of Sight - 10%")),
	$Profile.Name <> "Admin")
Thank you,
Nick
It seems like I can't edit the view my users see on the "Add Products" to an Opportunity view. I found on this forum that I should go to Opportunity Product > Page Layout > Edit Multi-Line Layout. I've gone there and the fields that appear there and the fields that my users see do not match. Can someone point me in the right direction?

Multi-line Layout Fields
Add products page
I created an Apex Trigger, a few custom fields, and a couple validation rules so that I can check that a contact role is assigned to an opportunity. It actually allows me to check that multiple contacts are assigned at different stages of the sales cycle. It works great in my sandbox but I can't deploy the Apex Before Trigger because it doesn't reach the code coverage thresholds. I'm a point-and-click admin that happened to pull this together based on articles I found. Can someone help me write the test so that I can pass the code coverage test and deploy this?

Here is the Apex before trigger:
trigger updatecontactrolecount on Opportunity (before insert, before update)
{

Boolean isPrimary;
Integer iCount;

Map<String, Opportunity> oppty_con = new Map<String, Opportunity>();//check if the contact role is needed and add it to the oppty_con map
for (Integer i = 0; i < Trigger.new.size(); i++)
{
    oppty_con.put(Trigger.new[i].id,
    Trigger.new[i]);
}
isPrimary = False;
for (List<OpportunityContactRole> oppcntctrle :[select OpportunityId from OpportunityContactRole where (OpportunityContactRole.IsPrimary = True and OpportunityContactRole.OpportunityId in :oppty_con.keySet())])
{
if (oppcntctrle .Size() >0)
{
isPrimary = True;
}
}
iCount = 0;
for (List<OpportunityContactRole> oppcntctrle2 : [select OpportunityId from OpportunityContactRole where (OpportunityContactRole.OpportunityId in :oppty_con.keySet())])//Query for Contact Roles
{
if (oppcntctrle2 .Size()>0)
{
iCount= oppcntctrle2 .Size();
}
}
for (Opportunity Oppty : system.trigger.new) //Check if roles exist in the map or contact role isn't required
{
Oppty.Number_of_Contacts_Roles_Assigned__c = iCount;
Oppty.Primary_Contact_Assigned__c =isPrimary;
}
}

Thank you!
Nick

I want to restrict all users, except admins, to our "Line of Sight - 10%" opportunity stage. Stated differently, "Line of Sight - 10%%" is the only opportunity stage a user should be able to set their opportunity to unless they're an admin. I've written the following rule. It allows admins to set to any stage like it should. However, it prevents everyone else from setting any opportunity stage. Meaning, users can't set the opportunity stage to "Line of Sight - 10%" like they should be able to. They also can't set it to any other stage but that is correct. Any idea what I'm missing?
 

AND(
	OR(
	ISNEW()
	ISCHANGED(StageName)),
	NOT(ISPICKVAL(StageName, "Line of Sight - 10%")),
	$Profile.Name <> "Admin")
Thank you,
Nick
I'm trying to create a validation rule that prevents reps from moving an opportunity forward until it has been approved by our ops team. I've tried a number of versions of formulas on the forum but I can't seem to get it quite right.

The formula should say that if the opportunity - is a Change Request and the stage has changed or if its new and the stage is either Closed/Won, Closed/Won - Pending, or Closing - 90%, and the Approval Status is either New, Pending, or Rejected - then show the validation rule error that says it must be approved before advancing.

Can someone please highlight where I am going wrong here? I would greatly appreciate any help I can get.
 
AND (RecordType.Name = "Change Request", 
OR( 
ISCHANGED(StageName), 
ISNEW()), 
OR( 
ISPICKVAL(StageName, "Closed/Won"), 
ISPICKVAL(StageName, "Closed/Won - Pending"), 
ISPICKVAL(StageName, "Closing - 90%")), 
OR( 
ISPICKVAL(Approval_Status__c, "New"), 
ISPICKVAL(Approval_Status__c, "Pending"), 
ISPICKVAL(Approval_Status__c, "Rejected") 
) 
)