KB Article 9668
2012/03/29

Close
X
Contact Tech Support

 Email Tech Support
 (250) 655-1766
 [7:30 - 5:00 PST]
Your Meeting ID will be Provided by a Rep.
Tech Support
Tech Support Home
Software Updates
Knowledge Base Search
Recent KB Articles
Product FAQs
Code Samples
Documentation
Tech Blog
System Requirements
Installation Instructions
Support Testimonials
Contact us to...
Create a Ticket
Request a Free Demo
Suggest a New Feature
Submit Feedback
Upload a Large File
Other Services
Software Training
Professional Services

I have some programs where I would like ProGen to skip the default validation that checks if a record has been changed by another user in the time when the first user had it open. How can I do this?

Product: ProGen Plus Type: Frequently Asked Question

Background:
In ProGen templates there is by default a validation that occurs to check whether a record that one user started editing was, in that same time, changed and saved by another user. This is handled by comparing a couple of data structures (the before and after image datastructures), and the presenting the original user with an option to either apply or abort their changes.
 
Question:
We had a customer who in some programs wanted to avoid this validation, and just apply the changes to the record in every case.
 
We may introduce an option to the tool to do this, but in the meantime you can do it as follows:

1) Start by creating a new program field from the ZWRKPGMFLD command. We created ours as follows:  
Program field number . . . . . . . .     196
Type information, press Enter.
 Field name used in Progen Plus . . .  *SKIPDBCHK
 Internal ILE RPG name  . . . . . . .  SKIPDBCHK_
 Internal RPG/400 name  . . . . . . .  SKPDBCH_
 Field text . . . . . . . . . Skip before/after database comparison
 Field length . . . . . . . . . . . .       1
 Field type . . . . . . . . . . . . .  A                A, P, or S
 Field decimals . . . . . . . . . . .                    0-9
 Description of length, type, #dec  .  1A               eg:  7P,2
 Edited length  . . . . . . . . . . .       1
 Edited field descriptn . . . . . . .
 Edit code  . . . . . . . . . . . . .
 OR Edit word . . . . . . . . . . . .
 Allow as Both I/O, or Output only. .   I

2) Define the program field.
For ILE type ZWRKSS. Select the file GN#GLES and the member GN#$PGMF for edit, and add the following line at the bottom of the D specs:
D SKIPDBCHK_       S               1A

3) Select the file GN#GLES and the member GN#$UPDBF for editing and put the bolded condition around the non bolded code shown below:
                IF         SKIPDBCHK_ <> 'Y'
IF (Current record image<> Before image) THEN
                IF        @@PFWKDS <> @@PFBFDS
                EVAL      UPIT## = False
Present CHGDRF@@ to ask if Add/Update should continue
                EVAL      @@PANELID = 'CHGDRF@@'
                EXSR       $$PANL
                ENDIF
                ENDIF


*NOTE: If you are using RPG400, step 1 and 2 are the same but the condition to update the before and after data structure are in the specific shell for each style in GN#FSRC(the member name will be GN#PGA, GN#PGB etc). The string BFDS## can be used to locate the condition.
 
Please let us know if you have any questions!

Rate This Article

Did this example help you to achieve your goal?
 Yes  No  Don't Know

Enter additional comments below.   If you want to hear back from us, include your contact information.

Email Address:
Comments:
Please enable JavaScript in order to rate this page.