Topic
  • No replies
SystemAdmin
SystemAdmin
24948 Posts

Pinned topic Having trouble getting this hook to fire

‏2012-11-21T18:20:02Z |
Hi,
Having trouble getting this hook to fire, can someone take a look and tell me what is the issue:

sub hp_resulting_days_DefaultValue {
my($fieldname) = @_;
# $fieldname as a string scalar
# record type name is ChangeRequest
# field name is HP_Resulting_Days
# Set the initial value of the field here. Example:
# $entity->SetFieldValue($fieldname, "12345");
#

# Created by: Royal Jackson

# Contact Info: rjackso4@moog.com or bluemako3@yahoo.com
# work number: 801-974-7334 cell number: 720-364-7676
#
# Date: November 20, 2012

# Purpose: Calculating sum of values in integer fields
#

# $session->OutputDebugString(debugString);
$HP_Root_Cause_Det = $entity->GetFieldValue("HP_Root_Cause_Det")->GetValue();
$HP_Corr_Action_Det = $entity->GetFieldValue("HP_Corr_Action_Det")->GetValue();
$HP_DRWG = $entity->GetFieldValue("HP_DRWG")->GetValue();
$HP_Manuf_Procure = $entity->GetFieldValue("HP_Manuf_Procure")->GetValue();
$HP_Regression_Test = $entity->GetFieldValue("HP_Regression_Test")->GetValue();
$Total_Result_Days = $HP_Root_Cause_Det + $HP_Corr_Action_Det + $HP_DRWG + $HP_Manuf_Procure + $HP_Regression_Test;

$entity->SetFieldValue("HP_Resulting_Days",$Total_Result_Days);
}