Quantcast
Channel: Ivanti User Community: Message List
Viewing all articles
Browse latest Browse all 12704

Re: BeforeSave calculations don't fire when collection item is deleted

$
0
0

Thanks for the response. 

 

End Date is populated manually.  The user selects a date and time for the beginning and end, and also inputs a title.

 

After Read works perfectly, but that's because it's recalculating every time the page is refreshed.

 

If I change the calc to Before Save and delete a record, the field doesn't recalculate until I either create a appointment or modify an existing one, but Test Calculation works fine.  I'm just about convinced that LDSD is failing to trigger the Before Save calcs when an item from the collection is deleted.

 

Here's my latest test code.  It never returns "Error!" or "deleted."  Thanks for the suggestion to use the string variable.

 

import System
static def GetAttributeValue(_DayOff):  totalDayCount = 0.0  Value = "a"  if _DayOff.Appointments.Count> 0:    for instance in _DayOff.Appointments:      if instance.Deleted == null:        Value = "deleted"        return Value      else:        try:          localTimespan = instance.EndDatetime - instance.StartDatetime          localDayCount = 0.0          localDayCount = localTimespan.Days + localTimespan.Hours / 24.0 + localTimespan.Minutes / 24.0 / 60.0          totalDayCount += localDayCount        except e:          Value = "Error!"          return Value        Value = Math.Round(totalDayCount, 2).ToString()   return Value

Viewing all articles
Browse latest Browse all 12704

Trending Articles