• SalesIntel
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

The following code creates a pop up message each time a support engineer accesses a Case record. My issue is that the pop-up message displays each time a support engineer changes screen within the same case. Can you tell me how I would modify the code to display the pop up message only once? In other words, only the first time the Case record is accessed?

 

<html> 
<head> 
<script type="text/javascript"> 
var s = ""; 
function checkAlert() 
{ 
// Look for account message 
try { 
a = "{!JSENCODE(Account.rrpu__Alert_Message__c)}"; 
if (a.length > 0) { 
s += "Account Alert: " + a + "\n"; 
} 
} 
catch(err) { } 

// Look for contact message 
try { 
c = "{!JSENCODE(Contact.rrpu__Alert_Message__c)}"; 
if (c.length > 0) { 
s += "Contact Alert: " + c + "\n"; 
} 
} 
catch(err) { } 

// Look for lead message 
try { 
l = "{!JSENCODE(Lead.rrpu__Alert_Message__c)}"; 
if (l.length > 0) { 
s += "Lead Alert: " + l + "\n"; 
} 
} 
catch(err) { } 

// Look for opportunity message 
try { 
o = "{!JSENCODE(Opportunity.rrpu__Alert_Message__c)}"; 
if (o.length > 0) { 
s += "Opportunity Alert: " + o + "\n"; 
} 
} 
catch(err) { } 

// Look for case message 
try { 
ca = "{!JSENCODE(Case.rrpu__Alert_Message__c)}"; 
if (ca.length > 0) { 
s += "Case Alert: " + ca + "\n"; 
} 
} 
catch(err) { } 

// Pop-up message if any alerts found 
if (s.length > 0) 
{ 
window.alert(s); 
} 
} 

</script> 
</head> 
<body onload="checkAlert()"> 
</body> 
</html>

 

 

Stuck again!

 

I am using the following code to produce an error message when the Quantity for specific product numbers (listed below) is up to 499 users AND when the discount exceeds 40%. What I'd like to do is expand this code to include a number of quantity ranges, say 500-999, 1000-1500 etc, where the discount  (against the same product codes) should not exceed 45%, 50%, 60%, respectively.

 

Is there a way to do this in one code string rather than create unique validation rules? Here's what I am using...it works  for up to 499 users, and up to 40% discount:

 

AND(
OR
(Product2.ProductCode= "EN-P-MPS-100",
Product2.ProductCode= "EN-P-PC-100",Product2.ProductCode= "EN-P-CP-100",Product2.ProductCode= "EN-P-IP-100",Product2.ProductCode= "EN-P-AW-100",Product2.ProductCode= "EN-P-AWS-100",Product2.ProductCode= "EN-P-CCE-110",Product2.ProductCode= "EN-P-OC-100",Product2.ProductCode= "GE-P-MPS-100",Product2.ProductCode= "GE-P-PC-100",Product2.ProductCode= "GE-P-OC-100",Product2.ProductCode= "EN-P-ICM-200",Product2.ProductCode= "EN-P-SPPM-200",Product2.ProductCode= "EN-P-MISCA-300",Product2.ProductCode= "EN-P-MIBCA-310",Product2.ProductCode= "EN-P-MISCIT-320"),
AND(
(Quantity<= 499)),  Discount  > 0.40)

 

Put another way, how do I introduce quantity ranges, each with a unique discount % against the same product codes in the same validation rule?

 

Thanks in advance for the help!

Excited to join the group! First posting.

 

I am trying to create a validation rule that states, essentially, if product code = x or y or z...... then the discount should not exceed, say 40%. I am using all standard fields as you can see below.

 

Here's what I have come up with: Passes syntax test, but does not work (allows me to save even if discount exceeds my limit, in this case, 40%):

 

IF(OR(Product2.ProductCode= "EN-P-AW-100"),
(Product2.ProductCode= "EN-P-CCE-110"),
Discount > 0.40)

 

What am I doing wrong?

 

Thanks! :-)

Excited to join the group! First posting.

 

I am trying to create a validation rule that states, essentially, if product code = x or y or z...... then the discount should not exceed, say 40%. I am using all standard fields as you can see below.

 

Here's what I have come up with: Passes syntax test, but does not work (allows me to save even if discount exceeds my limit, in this case, 40%):

 

IF(OR(Product2.ProductCode= "EN-P-AW-100"),
(Product2.ProductCode= "EN-P-CCE-110"),
Discount > 0.40)

 

What am I doing wrong?

 

Thanks! :-)