Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with dw_1.update(true,false) code

Status
Not open for further replies.

pbr123

Programmer
Jul 31, 2003
1
IN
Hi ,
We r using pb 6.5 and oracle 8i for our application .
For 1 of the module the save event for which window function is written is dependent on the saving of 4 windows . I face a very stange prblm :-
For which the code is ...
---------------- code -----------------------
iw_parentwindow.SetMicrohelp ("Updating Purchase Document Header...")
DW_1.setitem(dw_1.getrow(),"last_upd_date",gd_sysdate)
dw_1.setitem(dw_1.getrow(),"pur_doc_hdr_user_id",gs_user_id) //

IF dw_1.Update( True, False) <> 1 THEN
Return False
dw_1.SetFocus()
END IF

//*2 Update the despatch detais window
iw_parentwindow.SetMicrohelp (&quot;Updating Despatch Details...&quot;)
// only if despatch window open
if Isvalid (w_ver_supdocs_pb_desp_details ) then
// trigger save event in the Despatch Details window which will update the DW
w_ver_supdocs_pb_desp_details.TriggerEvent (&quot;ue_save&quot;)
// check the MessageObject for Successful update
// messagebox (&quot;Message.StringParm &quot;,Message.StringParm )
if Message.StringParm <> &quot;1&quot; then
MessageBox ( this.title, &quot;Error updating Despatch Details Window.&quot;)
cb_despatch.PostEvent (Clicked!)
return false
end if
end if
----- end of code --------------------------
if there is any error or some data missing in the 2nd window &quot;w_ver_supdocs_pb_desp_details&quot; then in some pcs the data doesnt get updated in the ist window and prompts proper error where as in some pvs the data gets updated in the header file . The autocommit = false .
I am not able to understand why it gives diff .behavior on diff machines . Can anyone give a soltn to this ??????
 
Are you running the executable for this on all the machines or is it just that it works in development but not on the executable? If it's not this, can u see anything common to the machines it works on vs. the ones it doesn't work on? (ie. OS version)
 
try changing this bit from

if Isvalid (w_ver_supdocs_pb_desp_details ) then
w_ver_supdocs_pb_desp_details.TriggerEvent (&quot;ue_save&quot;)
// check the MessageObject for Successful update
// messagebox (&quot;Message.StringParm &quot;,Message.StringParm )
if Message.StringParm <> &quot;1&quot; then
to

if Isvalid (w_ver_supdocs_pb_desp_details ) then
if w_ver_supdocs_pb_desp_details.of_save()>0 then
.....

where of_save() method simply calls the ue_save event
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top