PrJlndni
Member
Hello,
Good day Masters!
I really need help regarding my ongoing project.
My task is to create a browser that can search something then will display its information on the same browser. at first, the browser should be empty, then the searched account numbers and it's info will be stored in the temp table and displayed in the browser accordingly.
What I currently did is that, I made a temp-table where I can store all the data that's being searched. Using the browser, I enabled one of its fields and use it as my searching area.
My problem is how to get the inputted value in the browser so that I could start searching. Below is my work. It's really a mess. Please Help. Thank you very much
Good day Masters!
I really need help regarding my ongoing project.
My task is to create a browser that can search something then will display its information on the same browser. at first, the browser should be empty, then the searched account numbers and it's info will be stored in the temp table and displayed in the browser accordingly.
What I currently did is that, I made a temp-table where I can store all the data that's being searched. Using the browser, I enabled one of its fields and use it as my searching area.
My problem is how to get the inputted value in the browser so that I could start searching. Below is my work. It's really a mess. Please Help. Thank you very much
Code:
DEFINE VARIABLE t_AcctNo AS CHARACTER LABEL " Account No" FORMAT "XX-XXXXXX-X".
DEFINE VARIABLE t_OldFTaxFlagValue AS CHARACTER FORMAT "X".
DEFINE VARIABLE t_FTaxFlagChangeValue AS LOGICAL FORMAT "YES/NO" INIT NO.
DEFINE VARIABLE t_NewFTaxFlagValue AS CHARACTER FORMAT "X".
DEFINE VARIABLE t_exit AS LOGICAL INIT TRUE.
DEFINE VARIABLE l_maint01 AS LOGICAL INIT YES.
DEFINE VARIABLE t_ChkRowID AS ROWID.
DEFINE VAR t_new AS LOGICAL.
DEFINE VAR t_sort AS INTEGER INIT 0.
DEFINE VAR t_ChkRecID AS RECID.
DEFINE VAR temp_recaddrs AS CHARACTER.
DEFINE TEMP-TABLE temp-Customer
FIELD t_sort AS INTEGER
FIELD recaddrs AS CHARACTER
FIELD NAME AS CHARACTER FORMAT "X(20)"
FIELD Address AS CHARACTER FORMAT "X(20)"
FIELD FTaxFlag AS INT
FIELD Changes AS LOGICAL INIT NO
INDEX t_sort t_sort.
/*DEFINE TEMP-TABLE temp-Customer2 LIKE CustService.Customer.*/
DEFINE QUERY t_ChkBrw00 FOR temp-Customer SCROLLING.
DEFINE BROWSE t_ChkBrw00 QUERY t_ChkBrw00 NO-LOCK
DISP temp-Customer.recaddrs FORMAT "XX-XXXXXX-X"
temp-Customer.NAME FORMAT "X(20)"
temp-Customer.Address FORMAT "X(20)"
IF temp-Customer.FTaxFlag = 1 THEN "Enrolled" ELSE "NOT Enrolled" FORMAT "X(12)"
ENABLE
temp-Customer.recaddrs
WITH SIZE 98 BY 08 CENTERED NO-BOX NO-LABELS.
DEFINE FRAME f_MainProc WITH KEEP-TAB-ORDER.
DEFINE FRAME f_ChkBrw00
" Account No. Name Address Status Change " VIEW-AS TEXT AT ROW 1 COL 1
" ----------- -------------------- -------------------- ------------ ------ " VIEW-AS TEXT AT ROW 2 COL 1
t_ChkBrw00 AT ROW 3 COL 01 HELP " [F7] To CHECK Account No."
WITH VIEW-AS DIALOG-BOX OVERLAY NO-LABELS NO-UNDERLINE SCROLLABLE ROW 05 CENTERED TITLE "[ Franchise Browser ]".
FIND FIRST temp-Customer NO-ERROR.
IF NOT AVAILABLE (temp-Customer) THEN do:
CREATE temp-Customer.
ASSIGN temp-Customer.t_sort = 0 temp-Customer.NAME = "-" temp-Customer.Address = "-" t_ChkRowID = ROWID(temp-Customer).
END.
DISPLAY t_HeadTitle01 WITH FRAME f_MainProc.
HIDE b_Proceed b_Cancel FRAME f_MainProc.
RUN StartProc.
PROCEDURE StartProc.
DISP t_AcctNo AT ROW 3 COL 3 WITH FRAME f_ChkBrw00.
DO WHILE l_maint01.
ON END-ERROR, PF4 OF FRAME f_ChkBrw00 DO:
ASSIGN l_maint01 = FALSE.
HIDE FRAME f_ChkBrw00.
HIDE FRAME f_MainProc.
END.
ON VALUE-CHANGED OF t_AcctNo IN FRAME f_ChkBrw00 DO:
END.
ON RETURN OF t_ChkBrw00 OR RETURN OF t_AcctNo IN FRAME f_ChkBrw00 DO:
MESSAGE t_AcctNo.
FIND FIRST CustService.Customer WHERE CustService.Customer.recaddrs = SUBSTRING(t_AcctNo,3,6) NO-ERROR.
IF AVAIL(CustService.Customer) THEN do:
MESSAGE CustService.Customer.recaddrs VIEW-AS ALERT-BOX.
CREATE temp-Customer.
BUFFER-COPY CustService.Customer TO temp-Customer.
ASSIGN t_ChkRowID = ROWID(temp-Customer).
OPEN QUERY t_ChkBrw00 FOR EACH temp-Customer WHERE temp-Customer.recaddrs = Customer.recaddrs.
REPOSITION t_ChkBrw00 TO ROWID t_ChkRowID.
IF Customer.FTaxFlag = 0 THEN DO:
ASSIGN temp-Customer.FTaxFlag = 1.
END.
ELSE IF t_FTaxFlagChangeValue = YES AND temp-Customer.FTaxFlag = 1 THEN DO:
ASSIGN temp-Customer.FTaxFlag = 0.
END.
END.
ELSE do:
MESSAGE "NOT found" VIEW-AS ALERT-BOX.
END.
OPEN QUERY t_ChkBrw00 FOR EACH temp-Customer.
WAIT-FOR RETURN OF t_AcctNo or RETURN , PF4, F7 OF t_ChkBrw00 IN FRAME f_ChkBrw00 FOCUS t_ChkBrw00.
END.
ENABLE t_AcctNo WITH FRAME f_ChkBrw00.
OPEN QUERY t_ChkBrw00 FOR EACH temp-Customer.
WAIT-FOR PF4, RETURN OF /*t_ChkBrw00*/ t_AcctNo IN FRAME f_ChkBrw00 FOCUS t_ChkBrw00.
END.
END.
Last edited by a moderator: