Re: Xdialog, Xbasic for Data Entry
Thank you Keith, I'm confused dialog box or xdialog for one to many data entry?
Thank you Keith, I'm confused dialog box or xdialog for one to many data entry?
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
'dialog field variables ' generate dialog dim vfind_text as C dim vLNM as C="" dim vLitem_show as C="" dim vLitem_f as C="" dim vresult as C dim dlg_title as C="Search" dim dlg_body as C dim dlg_code as C dlg_body=<<%dlg% {background=#180,185,185}{font=arial,8,ib}{frame=1,0:Search Term}{font=arial,10,b} {xmargin=3,3}{ymargin=1,1}{justify=center}{startup=init} {region} {lf}; [.50vfind_text!evft_*]; {endregion}; {region} {lf}; {font=courier,10}[.75,25vChoice^#vLitem_f]; {lf}; {endregion}; {font=arial,8,ib}{frame=1,0:Selection}{font=arial,10,b} {region3} {lf}; [.75vChoice!evch_*]; {endregion}; {lf}; <15OK> <15Cancel> %dlg% dlg_code=<<%code% IF a_dlg_button = "init" then a_dlg_button = "" dim vLitem as C vLitem=table.external_record_content_get("customer","customer_id+'^^'+alltrim(Lastname)+'^^'+alltrim(firstname)","lastname") for i=1 to w_count(vLitem,crlf()) dim vname as C vname=alltrim(word(word(vLitem,i,crlf()),2,"^^"))+", "+alltrim(word(word(vLitem,i,crlf()),3,"^^")) vLitem_show=vLitem_show+vname+crlf() next vLitem_f=vLitem_show END IF IF left( a_dlg_button, 5 ) = "evft_" IF a_dlg_button = "evft_change" vchoice="" if len(vfind_text)<=1 'comment out for first letter action vLitem_f=vLitem_show 'comment out for first letter action else 'comment out for first letter action insearch="*"+alltrim(vFind_text)+"*" vLitem_f=filter_string_smatch(vLitem_show,insearch,crlf()) end if 'comment out for first letter action END IF a_dlg_button = "" END IF IF left( a_dlg_button, 5 ) = "evch_" if a_dlg_button = "evch_setfocus" sys_send_keys("{Enter}") end if a_dlg_button="" END IF %code% vresult=ui_dlg_box(dlg_title,dlg_body,dlg_code) if vresult="cancel" end end if if vchoice = "" end end if 'get each name part dim vfm as C dim vlm as C vfm=alltrim(word(vchoice,2,", ")) vlm=alltrim(word(vchoice,1,", ")) 'get the customer id from the original list dim vcid as C vcid=word(filter_string_smatch(vLitem,"*"+vlm+"^^"+vfm+"*",crlf()),1,"^^") 'msgbox("CUSTOMER id", vcid) dim vfilter as C vfilter="customer_id="+quote(Vcid) topparent:tables:customer.filter_expression = vfilter topparent:tables:customer.order_expression = "" topparent:tables:customer.query()
'dialog field variables ' generate dialog dim vfind_text as C dim vLNM as C="" dim vLitem_show as C="" dim vLitem_f as C="" dim vresult as C dim dlg_title as C="Search" dim dlg_body as C dim dlg_code as C dlg_body=<<%dlg% {background=#180,185,185}{font=arial,8,ib}{frame=1,0:Search Term}{font=arial,10,b} {xmargin=3,3}{ymargin=1,1}{justify=center}{startup=init} {region} {lf}; [.50vfind_text!evft_*]; {endregion}; {region} {lf}; {font=courier,10}[.75,25vChoice^#vLitem_f]; {lf}; {endregion}; {font=arial,8,ib}{frame=1,0:Selection}{font=arial,10,b} {region3} {lf}; [.75vChoice!evch_*]; {endregion}; {lf}; <15OK> <15Cancel> %dlg% dlg_code=<<%code% IF a_dlg_button = "init" then a_dlg_button = "" dim vLitem as C vLitem=table.external_record_content_get("customer","customer_id+'^^'+alltrim(Lastname)+'^^'+alltrim(firstname)","lastname") for i=1 to w_count(vLitem,crlf()) dim vname as C vname=alltrim(word(word(vLitem,i,crlf()),2,"^^"))+", "+alltrim(word(word(vLitem,i,crlf()),3,"^^")) vLitem_show=vLitem_show+vname+crlf() next vLitem_f=vLitem_show END IF IF left( a_dlg_button, 5 ) = "evft_" IF a_dlg_button = "evft_change" vchoice="" if len(vfind_text)<=1 'comment out for first letter action vLitem_f=vLitem_show 'comment out for first letter action else 'comment out for first letter action insearch="*"+alltrim(vFind_text)+"*" vLitem_f=filter_string_smatch(vLitem_show,insearch,crlf()) end if 'comment out for first letter action END IF a_dlg_button = "" END IF IF left( a_dlg_button, 5 ) = "evch_" if a_dlg_button = "evch_setfocus" sys_send_keys("{Enter}") end if a_dlg_button="" END IF %code% vresult=ui_dlg_box(dlg_title,dlg_body,dlg_code) if vresult="cancel" end end if if vchoice = "" end end if 'get each name part dim vfm as C dim vlm as C vfm=alltrim(word(vchoice,2,", ")) vlm=alltrim(word(vchoice,1,", ")) 'get the customer id from the original list dim vcid as C vcid=word(filter_string_smatch(vLitem,"*"+vlm+"^^"+vfm+"*",crlf()),1,"^^") 'msgbox("CUSTOMER id", vcid) dim vfilter as C vfilter="customer_id="+quote(Vcid) topparent:tables:customer.filter_expression = vfilter topparent:tables:customer.order_expression = "" topparent:tables:customer.query()
Comment