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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accept Button doesnot work 1

Status
Not open for further replies.

soniabharat

Programmer
Aug 9, 2001
18
US
Hi,

There are certain problems I am getting in my project.
I want to update Attorney Record and when I click Apply button,it is not accepting the changes. It should update the record but it gives me the message that "An Error occured while updqting this attorney. Please Try again." I have written the code below. Your comments are highly appreciated.

Thanks
Sonia
sonias_s75@yahoo.com


Under the click event of the 'Apply' Button I have written this code......

PERFORM UPDATE-ATTORNEY-RECORD.
CALL WOWSETPROP USING WIN-RETURN APPLY-BTN-H
'ENABLED' WIN-FALSE.

where UPDATE-ATTORNEY-RECORD is a paragraph.....


UPDATE-ATTORNEY-RECORD Paragraph is having code:
UPDATE-ATTORNEY-RECORD.
PERFORM UNLOAD-ATTORNEY-FORM.
PERFORM VERIFY-ATTORNEY-DATA.
IF PASSED-VERIFY
PERFORM WRITE-ATTORNEY-RECORD.


Unload-attorney-form Paragraph has code......

UNLOAD-ATTORNEY-FORM.
MOVE WOWGETPROP TO LOAD-FUNC.
PERFORM LOAD-UNLOAD-ATTORNEY-FORM.


LOAD-UNLOAD-ATTORNEY-FORM paragraph has code....
LOAD-UNLOAD-ATTORNEY-FORM.

CALL LOAD-FUNC USING WIN-RETURN ENTER-MULATT-H
'TEXT' ATT-MUL-ATTORNEYS.
CALL LOAD-FUNC USING WIN-RETURN ENTER-LOC-H
'TEXT' ATT-MUL-LOCATIONS.
CALL LOAD-FUNC USING WIN-RETURN ENTER-NAME-H
'TEXT' ATT-NAME.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ADDR1-H
'TEXT' ATT-ADDRESS-1.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ADDR2-H
'TEXT' ATT-ADDRESS-2.
CALL LOAD-FUNC USING WIN-RETURN ENTER-CITY-H
'TEXT' ATT-CITY.
CALL LOAD-FUNC USING WIN-RETURN ENTER-STATE-H
'TEXT' ATT-STATE.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ZIP5-H
'TEXT' ATT-ZIP-5.
CALL LOAD-FUNC USING WIN-RETURN ENTER-ZIP4-H
'TEXT' ATT-ZIP-4.
CALL LOAD-FUNC USING WIN-RETURN ENTER-PHONE-H
'TEXT' ATT-PHONE-NUMBER.
CALL LOAD-FUNC USING WIN-RETURN ENTER-EMAIL-H
'TEXT' ATT-EMAIL.
CALL LOAD-FUNC USING WIN-RETURN ENTER-TYPE-H
'TEXT' ATT-TYPE-OF-ATTORNEY.
IF LOAD-FUNC = WOWSETPROP

IF ATT-LAST-CHG-DATE > ZEROES
MOVE SPACES TO CHANGE-DESC
IF ATTORNEY-ADDED
STRING 'Added on: ' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(5:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(7:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(1:4) DELIMITED BY SIZE
' BY: ' DELIMITED BY SIZE
ATT-LAST-CHG-OPERATOR DELIMITED BY SIZE
INTO CHANGE-DESC
END-STRING
ELSE
STRING 'LAST MODIFIED ON: ' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(5:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(7:2) DELIMITED BY SIZE
'/' DELIMITED BY SIZE
ATT-LAST-CHG-DATE(1:4) DELIMITED BY SIZE
' BY: ' DELIMITED BY SIZE
ATT-LAST-CHG-OPERATOR DELIMITED BY SIZE
INTO CHANGE-DESC
END-STRING
END-IF
CALL LOAD-FUNC USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 1
'SECTIONSTATUS'
CHANGE-DESC
ELSE
CALL LOAD-FUNC USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' ' '
END-IF.


VERIFY-ATTORNEY-DATA paragraph has code


VERIFY-ATTORNEY-DATA.
MOVE 1 TO VERIFY-FLAG.

IF ATT-NAME <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Attorney Name' TO ERROR-TITLE
MOVE 'You cannot leave attorney name blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.


IF ATT-ADDRESS-1 <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Address' TO ERROR-TITLE
MOVE 'You cannot leave address blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-CITY <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank City' TO ERROR-TITLE
MOVE 'You cannot leave city blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-STATE <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank State' TO ERROR-TITLE
MOVE 'You cannot leave state blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-ZIP-5 <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Zip Code' TO ERROR-TITLE
MOVE 'You cannot leave zip code blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.

IF ATT-TYPE-OF-ATTORNEY <= SPACES
MOVE 0 TO VERIFY-FLAG
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
MOVE 'ERROR: Blank Attorney Type' TO ERROR-TITLE
MOVE 'You cannot leave attorney type blank.Please
- ' try again.' TO ERROR-MESSAGE
PERFORM DISPLAY-ERROR.




WRITE-ATTORNEY-RECORD paragraph has the code

WRITE-ATTORNEY-RECORD.
ACCEPT ATT-LAST-CHG-DATE (3:6) FROM DATE.
CALL 'C$CENTURY' USING ATT-LAST-CHG-DATE (1:2).
CALL 'C$GETENV' USING 'LOGNAME' ATT-LAST-CHG-OPERATOR.

IF ADD-ATTORNEY
MOVE 'A' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
WRITE-CODE
ELSE
MOVE 'C' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
REWRITE-CODE.
IF ATT-OK
IF ADD-ATTORNEY
MOVE 'C' TO ACTION-FLAG
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Added'
ELSE
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Updated'
END-IF
ELSE
MOVE SPACES TO ERROR-TITLE, ERROR-MESSAGE
IF ADD-ATTORNEY
MOVE 'ERROR: Adding Attorney' TO ERROR-TITLE
MOVE 'An error occured while adding this attorney.Please
- ' try again.' TO ERROR-MESSAGE
ELSE
MOVE 'ERROR: Updating Attorney' TO ERROR-TITLE
MOVE 'An error occured while updating this attorney.Please
- ' try again.' TO ERROR-MESSAGE
END-IF
PERFORM DISPLAY-ERROR.



I need to complete it urgently.


 
Read my reply in your other thread. I outlined some code to help you set the values so that you don't get error messages.

Nina Too
 
Hi,

Thx Neena,I made the changes u told. The program now adds the new records. After narrowing the search, I found that the following code just displays the message Attorney updated'
CALL WOWSETPROP USING WIN-RETURN DETAIL-STATUS-H
'CURSECTION' 0
'SECTIONSTATUS' 'Attorney Updated'

This code is executing fine. In real, nothing is being saved
The code that updates the fields in the files is

DISPLAY &quot;ELSE ADD-ATTORNEY&quot;
MOVE 'C' TO ATT-LAST-CHG-ACT
CALL 'ATTIO' USING ATTORNEY-RECORD
ATT-IO-WS
REWRITE-CODE

The above code should update the changes but is not updating the data.


Any help
Sonia
 
Well, you are calling a program called 'ATTIO'. I gather that this program is involved with doing the actual update. And there seems to be a problem here.

Assuming that this is some sort of reusable utility program, it should give you some sort of return code, which should be passed back to you when 'ATTIO' finished processing and control is returned to the calling program. YOu need to check for this return code.

If the update doesn't take place, there should be a return code from 'ATTIO' which indicates this. In this case, you do need an error message. Your 88 switch should not indicate ATT-OK but should indicate an error condition which will cause the error message to display.

Then you have to look at what is happening with 'ATTIO.' There are a number of reasons why an update doesn't take place. the parameters passed to 'ATTIO' could be incorrect i.e. wrong file length, wrong key length, etc. Or you are not passing the correct file name -- I had this problem with a file not updating, and it turned out that I was passing the wrong file name.

Or you could be passing a wrong &quot;action code&quot; to 'ATTIO.' Perhaps you aren't passing the code which would tell it to add a new record (or update an existing record).

At any rate, you have to see why it's not updating. And solve that problem. Then 'ATTIO' will pass back a return code which will indicate that everything proceeded normally. Then you set your 88 switch to ATT-OK and the rest of the processing takes place.

Hope this helps, Nina Too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top