Hi, I am using userobject structure to fill datawindow data. i want to know how can i trigger itemchanged event for validate some column data
My Code is Here
n_salememo lnv_salememo
lnv_salememo = create n_salememo
ib_retrivests = False
For ll_row = 1 To adw_memo.RowCount( ) Step 1
/*statementblock*/
ll_sel4pur = adw_memo.GetItemNumber( ll_row, "paperno")
If ll_sel4pur = 1 Then
i = i + 1
lnv_salememo.memno[i] = string(adw_memo.GetItemNumber( ll_row, "xtno"))
lnv_salememo.lotid[i] = adw_memo.GetItemNumber( ll_row, "lotid")
lnv_salememo.lotper[i] = adw_memo.GetItemString( ll_row, "lotper")
lnv_salememo.m2spcs[i] = adw_memo.GetItemNumber( ll_row, "m2spcs")
lnv_salememo.m2scts[i] = adw_memo.GetItemDecimal( ll_row, "m2scts")
lnv_salememo.m2sprc[i] = adw_memo.GetItemDecimal( ll_row, "m2sprc")
lnv_salememo.intper[i] = adw_memo.getitemdecimal( ll_row, "intper" )
lnv_salememo.uid[i] = gstr_cominfo.usrid
lnv_salememo.ustamp[i] = DateTime(Today(), Now())
End If
Next
dw_detail.object.lotid.primary.Current = lnv_salememo.lotid[]
dw_detail.object.lotper.primary.Current = lnv_salememo.lotper[]
dw_detail.object.lotpcs.primary.Current = lnv_salememo.m2spcs[]
dw_detail.object.lotcts.primary.Current = lnv_salememo.m2scts[]
dw_detail.object.lotprc.primary.Current = lnv_salememo.m2sprc[]
dw_detail.object.intper.primary.Current = lnv_salememo.intper[]
dw_detail.Sort( )
dw_detail.accepttext( )
ib_retrivests = True
Destroy lnv_salememo
Then you would use a SetColumn() + SetText() command in a loop for each DWO column. Then after that the AcceptText() would perform the last column validation from the KeyBoard buffer into the Primary buffer. Note that this validation also takes place on each Row/Column focus change. So you would need logic in the ItemError event to handle any data validation issues.
The other approach would be to loop through the DWO's primary buffer instead of the SetText route and check each column's update flag (via the GetItemStatus command). If changed, then validate the data under PowerScript control in the primary buffer.
Regards ... Chris