cancel
Showing results for 
Search instead for 
Did you mean: 

Custom OVS with SADL: Script, unable to delete records based on TodayDateTime

Former Member
0 Kudos

Hi All,

I have a custom OVS based on SADL. After the query is executed and the Items are populated, to validate the records I am checking Today's DateTime in between StartDateTime and EndDateTime.

I have written the following code in the Script of EventHandler "GetValueHelpHandler":

for i in 0..($data.Items.RowCount-1)
$data.Items.Get(i).TodayDateTime = $controller.DateTimeUtils.DateNow() 
$controller.DateTimeUtils.DateSub($data.Items.Get(i).EndDateTime, $controller.DateTimeUtils.DateNow(), EndResult ) 
if ( EndResult < 0 ) 
$data.Items.Delete(i) 
end 
end 
for i in 0..($data.Items.RowCount-1) 
$data.Items.Get(i).TodayDateTime = $controller.DateTimeUtils.DateNow() 
$controller.DateTimeUtils.DateSub($controller.DateTimeUtils.DateNow(), $data.Items.Get(i).StartDateTime, StartResult ) 
if ( StartResult < 0 ) 
$data.Items.Delete(i) 
end 
end 

As a cross verification, I have put a field in the OVS which is displaying the dateTime in UTC format as for StartDateTime and EndDateTime

And I am facing the issue here. Currently the comparison is not happening or the record is not being deleted from the Items. I need the record to be deleted.

Please suggest.

Thanks,

Srihari.

Accepted Solutions (0)

Answers (0)