• jmck
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 6
    Replies

Can you use logical functions in combination with a custom URL  in a custom button?  I would like for the formula to evaluate whether or not a field is blank and utilize one custom URL if it is and another if not.  The URLs work by themselves, but fail when I try to combine them with the logical functions.

 

{!

IF(ISBLANK(Account.Parent),

 

"/001/e?acc3={!Account.Name}&CF00N40000002GuGT={!Account.Name}&
RecordType=01240000000M4W4&ent=Account",

 

"/001/e?acc3={!Account.Name}&CF00N40000002GuGT={!Account.Parent}&
RecordType=01240000000M4W4&ent=Account")

}

  • June 28, 2012
  • Like
  • 0

I have a need to calculate a rolling anniversary date using a number field called Renewal_Term.

Example Scenario:

Contract Date 1/12/2010 (Date field)
Inital Term (in Months): 12 (Number field)
Anniversary Date: 1/12/2011 (Date field)
Renwal Term (in Months): 12 (Number field)
Next Anniversary Date: 1/12/2013  (Formula field below)

Current Formula:
IF(TODAY() > Anniversary_Date__c, 
(DATE( 
YEAR ( Anniversary_Date__c ) + (FLOOR((TODAY() - Anniversary_Date__c) / 365.2425) + (Renewal_Term__c / 12)), 
MONTH(Anniversary_Date__c), 
DAY(Anniversary_Date__c))), 
(DATE( 
YEAR ( Anniversary_Date__c ) + (Renewal_Term__c / 12), 
MONTH(Anniversary_Date__c), 
DAY(Anniversary_Date__c))))

This formula works perfectly for any term that is greater than 12 months, but obviously does not for any term less than 12 months.  I would like to use the same concept, but be able to use any number of months to do the same thing.

Any suggestions?

  • June 19, 2012
  • Like
  • 0

I have a need to calculate a rolling anniversary date using a number field called Renewal_Term.

Example Scenario:

Contract Date 1/12/2010 (Date field)
Inital Term (in Months): 12 (Number field)
Anniversary Date: 1/12/2011 (Date field)
Renwal Term (in Months): 12 (Number field)
Next Anniversary Date: 1/12/2013  (Formula field below)

Current Formula:
IF(TODAY() > Anniversary_Date__c, 
(DATE( 
YEAR ( Anniversary_Date__c ) + (FLOOR((TODAY() - Anniversary_Date__c) / 365.2425) + (Renewal_Term__c / 12)), 
MONTH(Anniversary_Date__c), 
DAY(Anniversary_Date__c))), 
(DATE( 
YEAR ( Anniversary_Date__c ) + (Renewal_Term__c / 12), 
MONTH(Anniversary_Date__c), 
DAY(Anniversary_Date__c))))

This formula works perfectly for any term that is greater than 12 months, but obviously does not for any term less than 12 months.  I would like to use the same concept, but be able to use any number of months to do the same thing.

Any suggestions?

  • June 19, 2012
  • Like
  • 0

Validation Rule:

Account.Not_Eligible_for_Support__c =TRUE

The purpose of the rule is to keep a new support case from being opened if an account has this box checked.  It successfully evaluates as "True" with an administrator profile, but "Null" with other profiles.  However, once the case is created, a non-admin profile successfully evaluates the rule as "True" and will not let them save anything to the case.

 

Example of Rule Success:
 
12:27:27.155|CODE_UNIT_FINISHED|CalculateBusinessHoursAges on Case trigger event BeforeInsert for [new]
 12:27:27.160|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Case:new
 12:27:27.160|VALIDATION_RULE|03d40000000GrEy|Not_Eligible_for_Support
 12:27:27.160|VALIDATION_FORMULA|Account.Not_Eligible_for_Support__c = TRUE|Account.Not_Eligible_for_Support__c=1
 12:27:27.160|VALIDATION_FAIL
 12:27:27.160|CODE_UNIT_FINISHED|Validation:Case:new
 12:27:27.218|CODE_UNIT_FINISHED|TRIGGERS
 12:27:27.218|EXECUTION_FINISHED
 
Example of Rule Failing:
 
14:12:20.174|CODE_UNIT_FINISHED|CalculateBusinessHoursAges on Case trigger event BeforeInsert for [new]
 14:12:20.180|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Case:new
 14:12:20.180|VALIDATION_RULE|03d40000000GrEy|Not_Eligible_for_Support
 14:12:20.180|VALIDATION_FORMULA|Account.Not_Eligible_for_Support__c = TRUE|Account.Not_Eligible_for_Support__c=null
 14:12:20.180|VALIDATION_PASS
 14:12:20.180|CODE_UNIT_FINISHED|Validation:Case:new
 14:12:20.343|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Case
 14:12:20.374|WF_RULE_EVAL_BEGIN|Assignment
 
The differnence for the one failing is the field is being evaluated as "null" instead of "1" or "true", but the same profile gets this when trying to save the case with a different status:
 
2:30:24.176|CODE_UNIT_FINISHED|CalculateBusinessHoursAges on Case trigger event BeforeUpdate for [5004000000FRa3c]
 12:30:24.179|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Case:5004000000FRa3c
 12:30:24.179|VALIDATION_RULE|03d40000000GrEy|Not_Eligible_for_Support
 12:30:24.180|VALIDATION_FORMULA|Account.Not_Eligible_for_Support__c = TRUE|Account.Not_Eligible_for_Support__c=1
 12:30:24.180|VALIDATION_FAIL
 12:30:24.180|CODE_UNIT_FINISHED|Validation:Case:5004000000FRa3c
 12:30:24.208|CODE_UNIT_FINISHED|TRIGGERS
 
Everyone has rights to view this field and this particular profile in the example above even has read/write rights to the Account.Not_Eligible_for_Support field.
 
Where else should I check?

  • June 14, 2011
  • Like
  • 0

Validation Rule:

Account.Not_Eligible_for_Support__c =TRUE

The purpose of the rule is to keep a new support case from being opened if an account has this box checked.  It successfully evaluates as "True" with an administrator profile, but "Null" with other profiles.  However, once the case is created, a non-admin profile successfully evaluates the rule as "True" and will not let them save anything to the case.

 

Example of Rule Success:
 
12:27:27.155|CODE_UNIT_FINISHED|CalculateBusinessHoursAges on Case trigger event BeforeInsert for [new]
 12:27:27.160|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Case:new
 12:27:27.160|VALIDATION_RULE|03d40000000GrEy|Not_Eligible_for_Support
 12:27:27.160|VALIDATION_FORMULA|Account.Not_Eligible_for_Support__c = TRUE|Account.Not_Eligible_for_Support__c=1
 12:27:27.160|VALIDATION_FAIL
 12:27:27.160|CODE_UNIT_FINISHED|Validation:Case:new
 12:27:27.218|CODE_UNIT_FINISHED|TRIGGERS
 12:27:27.218|EXECUTION_FINISHED
 
Example of Rule Failing:
 
14:12:20.174|CODE_UNIT_FINISHED|CalculateBusinessHoursAges on Case trigger event BeforeInsert for [new]
 14:12:20.180|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Case:new
 14:12:20.180|VALIDATION_RULE|03d40000000GrEy|Not_Eligible_for_Support
 14:12:20.180|VALIDATION_FORMULA|Account.Not_Eligible_for_Support__c = TRUE|Account.Not_Eligible_for_Support__c=null
 14:12:20.180|VALIDATION_PASS
 14:12:20.180|CODE_UNIT_FINISHED|Validation:Case:new
 14:12:20.343|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Case
 14:12:20.374|WF_RULE_EVAL_BEGIN|Assignment
 
The differnence for the one failing is the field is being evaluated as "null" instead of "1" or "true", but the same profile gets this when trying to save the case with a different status:
 
2:30:24.176|CODE_UNIT_FINISHED|CalculateBusinessHoursAges on Case trigger event BeforeUpdate for [5004000000FRa3c]
 12:30:24.179|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Case:5004000000FRa3c
 12:30:24.179|VALIDATION_RULE|03d40000000GrEy|Not_Eligible_for_Support
 12:30:24.180|VALIDATION_FORMULA|Account.Not_Eligible_for_Support__c = TRUE|Account.Not_Eligible_for_Support__c=1
 12:30:24.180|VALIDATION_FAIL
 12:30:24.180|CODE_UNIT_FINISHED|Validation:Case:5004000000FRa3c
 12:30:24.208|CODE_UNIT_FINISHED|TRIGGERS
 
Everyone has rights to view this field and this particular profile in the example above even has read/write rights to the Account.Not_Eligible_for_Support field.
 
Where else should I check?

  • June 14, 2011
  • Like
  • 0