HI,
I just did a quick test and my calculation worked fine.
That's what I tested with:
import System static def GetAttributeValue(Activity): Hide = false if Activity.Category != null: Hide = true return String.Format(":SetHidden(HrTitle,{0});",Hide) return String.Format(":SetHidden(HrTitle,{0});",Hide)
I thing you are missing the String.Format Syntax at the latest return value.
Try this:
import System static def GetAttributeValue(Activity): Value = '' NoticeFlag = false TermDateMand = false LastDayMand = fals RehireMand = false NoticeGivenMand = false NoticeLengthMand = false TermDateRead = false LastDayRead = true RehireRead = true NoticeGivenRead = true NoticeLengthRead = true TermDateHide = false LastDayHide = false RehireHide = false NoticeGivenHide = true NoticeLengthHide = true if Activity.Category != null: TermDateMand = true if Activity.Category != null: if Activity.Category.FullName == 'Warning Written': TermDateMand = true LastDayMand = false RehireMand = false TermDateRead = false LastDayRead = true RehireRead = true TermDateHide = false LastDayHide = true RehireHide = true if Activity.Category != null: if Activity.Category.FullName == 'Warning Verbal': TermDateMand = true LastDayMand = false RehireMand = false TermDateRead = false LastDayRead = true RehireRead = true TermDateHide = false LastDayHide = true RehireHide = true if Activity.Category != null: if Activity.Category.FullName == 'Termination Voluntary': NoticeFlag = true TermDateMand = true LastDayMand = true RehireMand = true TermDateRead = false LastDayRead = false RehireRead = false TermDateHide = false LastDayHide = false RehireHide = false if Activity.Category != null: if Activity.Category.FullName == 'Termination Involuntary': TermDateMand = true LastDayMand = true RehireMand = true TermDateRead = false LastDayRead = false RehireRead = false TermDateHide = false LastDayHide = false RehireHide = false if Activity.Category != null: if Activity.Category.FullName == 'Suspension': TermDateMand = true LastDayMand = false RehireMand = false TermDateRead = false LastDayRead = false RehireRead = true TermDateHide = false LastDayHide = false RehireHide = true if NoticeFlag == true: NoticeGivenMand = true NoticeGivenRead = false NoticeGivenHide = false NoticeLengthMand = false NoticeLengthRead = true NoticeLengthHide = false if Activity._EmpNoticeGiven != null: if Activity._EmpNoticeGiven == true: NoticeLengthMand = true NoticeLengthRead = false Value = Value + ":SetMandatory(_DateEmpNotified, TermDateMand);" Value = Value + ":SetMandatory(_DateEmpLastWork, LastDayMand);" Value = Value + ":SetMandatory(_RehireEligible, RehireMand);" Value = Value + ":SetMandatory(_EmpNoticeGiven, NoticeGivenMand);" Value = Value + ":SetMandatory(_EmpNoticeLength, NoticeLengthMand);" Value = Value + ":SetReadOnly(_DateEmpNotified, TermDateRead);" Value = Value + ":SetReadOnly(_DateEmpLastWork, LastDayRead);" Value = Value + ":SetReadOnly(_RehireEligible, RehireRead);" Value = Value + ":SetReadOnly(_EmpNoticeGiven, NoticeGivenRead);" Value = Value + ":SetReadOnly(_EmpNoticeLength, NoticeLengthRead);" Value = Value + ":SetHidden(_DateEmpNotified, TermDateHide);" Value = Value + ":SetHidden(_DateEmpLastWork, LastDayHide);" Value = Value + ":SetHidden(_RehireEligible, RehireHide);" Value = Value + ":SetHidden(_EmpNoticeGiven, NoticeGivenHide);" Value = Value + ":SetHidden(_EmpNoticeLength, NoticeLengthHide);" return String.Format(Value)
Regards
Fabian