Kbase P88189: How to create a customer update procedure for Detail web-object?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/15/2004 |
|
Status: Unverified
GOAL:
How to create a customer update procedure for Detail web-object?
GOAL:
When user submits data the application can be required to update more information than the HTML form can submit.
FACT(s) (Environment):
Webspeed 3.1x
FACT(s) (Environment):
OpenEdge 10.0A
FIX:
The detail webspeed web-object loads web2/wbdata.w as a super procedure.
This has all the procedures and functions which provide navigation and data maintenance.
The detail web-object itself has to have assignFields internal procedure
in order to do additional database updates.
Here is an example for customer table.
PROCEDURE assignFields:
/* this is required */
run super.
/* FIND the record to update */
find customer where rowid( customer ) =
to-rowid( get-field( "CurrentRowids" ) )
exclusive-lock no-wait no-error.
/* customer not available */
IF not available( customer ) THEN return. /* or handle this */
/* Update comments field in customer table */
assign customer.comment =
"Modified on " + string( today )
+ " "
+ string( time, "HH:MM:SS" ).
/* don't forget to release the record */
find current customer no-lock.
/* of course you can update other related information from different tables or take other actions if it is required */
/*
FIND salesrep OF customer EXCLUSIVE-LOCK NO-WAIT NO-ERROR.
IF AVAILABLE( salesrep ) THEN DO:
/* send email for example */
END.
FIND CURRENT salesrep NO-LOCK.
*/
END procedure.