soniabharat
Programmer
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.
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.