I have application whose Line of Code is around 4.5 million times.
There is one column named as office_id whose value is getting changed to random value randomly. I am not able to find the exact sequence of the same.
I have tried putting logs in the code everywhere, but still not able to find the root cause.
I think it might be due to type conversion from long to double or decimal etc..
One thing which I am sure is that it is not being entered from the frontend by the user.
It is happening due to some code like setitem written in some function or passing of datawindow reference to other non visual objects. *Reproduce Steps: Can you provide me a quick way to deduce this? I am looking for a event/function which will be called automatically each time a setitem occurs,
So that I can backtrack it from there. Previously I used Messagebox as function_object to create a global function which will be invoked each time
a messagebox is called & there I had wrote custom logic. Now Is there any way I can customly code the setitem event/function?
I don't know main root cause yet. (i.e. from where the value is being set, one thing I am sure about is that it is not being done from frontend.), I have a base object of type u_dw & from there I have inherited datawindows. For now value is being set anonymously & randomly thorugh code behaviour. I need a way such that whenever anywhere setitem is called, my custom function should also be called. Previously I have done the same for messagebox.
For Example: consider below code block
Decimal le_temp
dw_data.SetItem(row, 'office_id', le_temp)
I need a way that whenever such type of setitem is invoked there shall also be a custom function/event which should be triggered and from there I can decide whether to execute this call or not.
Previous example of Messagebox;
global type messagebox from function_object
end type
forward prototypes
global function integer messagebox (string as_title, string as_msg)
end prototypes
global function integer messagebox (string as_title, string as_msg);//supress message for silent mode
If gnv_app.ib_silent Then
gnv_app.of_set_errorlog(as_msg)
Else
Return MessageBox(as_title, as_msg, Information!, OK!, 1)
End If
end function
Whenever I write messagebox the above function gets called and from there the execution of the messagebox is defined. I need same way for setitem if possible
super::setitem(<here you should pass arguments depending on variant>)
You can get the return value from parent with:
return ancestorreturnvalue
Andreas.
The primary buffer column could also be modified via a DOT Notation, Row Copy, Data share, etc mechanism as well as a SetItem(). The cause of the data change could be very hard to track down as all of the above do not trigger an event.
The only way that might work in narrowing down the timing of the column change might be to use a "Timing" object that runs a timer on the DC/DS for that holds the column in question & checks it's value - say on a 1 second time interval - until the corrupt value is found. Then at least that might give you an idea "when" the value gets corrupted. From there, correlate that to the process being performed at that time. Hopefully, narrowing down "where" in the App to look for the offending code
The caveate though could be an inline SQL command operating on that column operating in the DB directly.
HTH
Regards ... Chris