Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

xDialog Box

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • xDialog Box

    Hi All,

    I attached this script for help. I used the Action Script and modified. I used the "Ui_msg_box" for checking my UDF whcih works fine.
    My problems are
    (1) Too slow to open it
    (2) The calculation scripts are not working at all.
    I can get the sized through UDF "Get_prdct_dimension"
    (2-a) The vFieldQty, vBaseStrQty and vBullStrQty values are not recognized.
    (2-b) The calculation result came out as "0" value.

    Code:
    FUNCTION EstCriteria_New_Manual AS C ( )
    'Step 1 -- Get 'Value' property of multiple objects in Form 'Estimate' .
    
    	DIM vEsthdId AS c
    	Dim vEstCritId as c
    	DIM vProjectId AS c
    	DIM vEstDate AS d
    	DIM vSection AS c
    	DIM vEstTotal AS n
    	dim vEstFixUom as c
    	
    	vEsthdId = parentform:Esthd_id.value
    	'vEstCritId = varP_Object:EstCriteria_id.value 'I do not have this item on screen
    	vProjectId = parentform:Project_id.value
    	vEstDate = parentform:Modify_date.value
    	vSection = alltrim(parentform:Section.value)
    	vEstTotal = parentform:Total_qty.value
    	
    'Step 2 -- Create an XDialog dialog box to prompt for parameters.
    'Area 
    DIM vFieldCode as C =""
    DIM vFieldVendor as C
    DIM vFieldQty as N
    
    'Fixtures
    DIM vFixtCode as C
    DIM vFixtVndr as C
    dim vFixtQty as n
    dim vFixtUom as c
    
    'Base 
    dim vBaseType as c
    dim vRtbCode as c
    dim vFtbcode as c
    DIM vBaseCode as C
    dim vBaseVendor as c
    DIM vBaseStretch as C
    DIM vBaseOut as C
    DIM vBaseInside as C
    dim vBaseBfId as c
    
    dim vBaseStrQty as n
    dim vBaseOcQty as n
    dim vBaseIcQty as n
    dim vBaseBfQty as n
    dim vBaseConvQty as n
    
    'Bullnose
    dim vBullType as c
    DIM vBullCode as C
    DIM vBullStretch as C
    DIM vBullOut as C
    DIM vBullInside as C
    dim vBullBfId as c
    
    dim vBullStrQty as n
    dim vBullOcQty as n
    dim vBullIcQty as n
    dim vBullBfQty as n
    dim vBullConvQty as n
    
    'Converted Qty
    DIM vCheckBase as L
    dim vCheckBlns as L
    DIM vConvertQty as N
    DIM vSumofArea as N
    DIM vSumofTrim as N
    DIM vSumofConv as N
    DIM vApplyQty as N
    dim vDeductTrims as L
    Dim vRevisedAreaQty as n
    
    DIM varC_result_direct as C
    
    DELETE a_vTrimType
    DIM a_vTrimType[5] as c
    dim temp_list as c 
    temp_list = <<%list%
    Round Top Base
    Flat Top Base
    Flat Tile
    Bullnose
    Mud Cap
    Bead
    Counter Trim
    %list%
    
    a_vTrimType.initialize(temp_list)
    
    Calculate_button_label ="Calcula&te"
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    
    'copied from new xdlg
    DIM vFieldCode_def as C
    DIM vFieldVndr_orig as C 
      if vSection ="floor" then 
         vFloorCode_orig = "k=rmfinish,{keylist_build(\"H=.05,1:10[Plan], 2:25[Series name], 3:20[Shape]\",''+Floor_plan,left(''+lookup(\"materialscheme\",\"Materialsch_id=\"+quote(Floor_Plan),\"Plancode\"),10),left(''+lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(Floor_Plan),\"Series_id\")),\"series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Floor_Plan),\"Shape_id\"),15))}{lookup(\"Rmtables\",\"Rmtable_id=\"+quote(Rmtable_Id),\"Project_id\") = [varC->vProjectID].and. unique_key_value()}"
    		vFieldCode_def = replace_parameters(vFloorCode_orig,local_variables())
    	else 'for Wall case
            vWallCode_orig = "k=rmfinish,{keylist_build(\"H=.05,1:10[Plan Code],2:25[Series Name],3:20[Size]\",''+Wall_plan,left(''+lookup(\"materialscheme\",\"Materialsch_id=\"+quote(wall_Plan),\"Plancode\"),10),left(''+lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(wall_Plan),\"Series_id\")),\"series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Wall_Plan),\"Shape_id\"),20))}{lookup(\"Rmtables\",\"Rmtable_id=\"+quote(Rmtable_Id),\"Project_id\") = [varC->vProjectID].and. unique_key_value()}"
    	    vFieldCode_def = replace_parameters(vWallCode_orig,local_variables())   
    	end if
    
    'Field Vendor list
    dim vFieldVndr_orig as c
    dim vFieldVndr_def as c
       vFieldVndr_orig = "k=prdctvndrs,{keylist_build(\"H=.05,1:15[Vendor Name]\",''+Seriesvndr_id,left(''+lookup(\"Seriesvndrs\",\"seriesvndr_id=\"+quote(Seriesvndr_Id),\"vendor_name\"),15))}{lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vFieldCode]),\"Prdctgroup_id\")=Prdctgroup_Id}"
    	vFieldVndr_def = replace_parameters(vFieldVndr_orig,local_variables())
    
    'Accessories List
    DIM vFixtCode_orig as C
    DIM vFixtCode_def as C
    if vSection="floor" then
       vThrhldCode_orig = "k=rmfinish,{keylist_build(\"H=.05,1:15[Plan Code],2:25[Series Name], 3:15[Shape]\",''+Thrhld_plan,left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Thrhld_Plan),\"Plancode\"),15),left(''+Lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(thrhld_Plan),\"series_id\")),\"Series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Thrhld_Plan),\"Shape_id\"),15))}{lookup(\"Rmtables\",\"Rmtable_id=\"+quote(Rmtable_Id),\"Project_id\") = [varC->vProjectID].and. unique_key_value()}"
        vFixtCode_def = replace_parameters(vThrHldCode_orig,local_variables())
    else 
    	vFixtCode_orig = "k=rmfinish,{keylist_build(\"H=.05,1:15[Plan Code],2:25[Series Name],3:15[Shape]\",''+fixture_plan,left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Fixture_Plan),\"Plancode\"),15),left(''+Lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(fixture_Plan),\"series_id\")),\"Series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(fixture_Plan),\"Shape_id\"),15))}{lookup(\"Rmtables\",\"Rmtable_id=\"+quote(Rmtable_Id),\"Project_id\") = [varC->vProjectID].and. unique_key_value()}"
        vFixtCode_def = replace_parameters(vFixtCode_orig,local_variables())
    end if
    DIM vFixtVndr_orig as C
    DIM vFixtVndr_def as C 
      vFixtVndr_orig = "k=prdctvndrs,{keylist_build(\"H=.05,1:15[Vendor name]\",''+Seriesvndr_id, left(''+lookup(\"seriesVndrs\",\"seriesVndr_id=\"+quote(Seriesvndr_Id),\"Vendor_name\"),15))}{lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vFixtCode]),\"Prdctgroup_id\")=Prdctgroup_Id}"
      vFixtVndr_def = replace_parameters(vFixtVndr_orig,local_variables())
    DIM vFixtUom_rl_def as C 
        vFixtUom_rl_def = "k=ctg_uom,{keylist_build(\"H=.05,1:10[Uom]\",''+Uom_id,left(''+Uom_id,10))}{}"
    
    
    'Base -- Revised Testing because the above code are not working
    Dim vRtbCode_list as c ' as Rtb test only  
    Dim vFtbCode_list as c ' as Ftb test only  
    Dim vBasecode_def as c
    if vSection="floor" then 
    	vRtbCode_List = "k=rmfinish,{keylist_build(\"H=.05,1:15[Plancode],2:25[Series Name],3:15[Shape]\",''+Rtb_plan,left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Rtb_Plan),\"Plancode\"),15),left(''+Lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(Rtb_Plan),\"series_id\")),\"Series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Rtb_Plan),\"Shape_id\"),15))}{left(''+Rmfinish_id,7) = [varC->vProjectID].and. unique_key_value()}"
        vBasecode_def = replace_parameters(vRtbCode_list,local_variables())
    Else 
        vFtbCode_List = "k=rmfinish,{keylist_build(\"H=.05,1:15[Plancode],2:25[Series Name],3:15[Shape]\",''+ftb_plan,left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Ftb_Plan),\"Plancode\"),15),left(''+Lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(Ftb_Plan),\"series_id\")),\"Series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Ftb_Plan),\"Shape_id\"),15))}{left(''+Rmfinish_id,7) = [varC->vProjectID].and. unique_key_value()}"
        vBasecode_def = replace_parameters(vFtbCode_list,local_variables())    
    end if
    
    Dim vBaseStretch_list as c 
    dim vBaseStretch_def as c
        vBaseStretch_List = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vBaseCode]),\"Series_id\").AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"Surface_id\")=Surface_id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"price_group\")=Group .AND. [varC->vBaseType]$Xdescription}" 'Original "+chr(13)+chr(10)+".and. [varC->vBaseType] $ Xdescription}"
        vBaseStretch_def = replace_parameters(vBaseStretch_List,local_variables())
    DIM vBaseOut_List as C 
    DIM vBaseOut_def as C
        vBaseOut_list = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vBaseCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"Surface_id\")=Surface_id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"price_group\")=Group .AND. [varC->vBaseType]$Xdescription .and. \"outside\" $ Xdescription}" 'Original "+chr(13)+chr(10)+".and. \"outside\" $ Xdescription}"
        vBaseOut_def = replace_parameters(vBaseOut_List,local_variables())
    DIM vBaseInside_List as C 
    DIM vBaseInside_def as C
        vBaseInside_list = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vBaseCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"Surface_id\")=Surface_id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"price_group\")=Group .AND. [varC->vBaseType]$Xdescription .and. \"inside\" $ Xdescription}" 'Original "+chr(13)+chr(10)+".and. \"inside\" $ Xdescription}"
        vBaseInside_def = replace_parameters(vBaseInside_list,local_variables())
    DIM vBaseButt_List as C 
    DIM vBaseButt_def as C
        vBaseButt_list = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vBaseCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"Surface_id\")=Surface_id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBaseCode]),\"price_group\")=Group .AND. [varC->vBaseType]$Xdescription .and. \"Butt\" $ Xdescription}" 'Original "+chr(13)+chr(10)+".and. \"inside\" $ Xdescription}"
        vBaseButt_def = replace_parameters(vBaseButt_list,local_variables())    
    
    'Bullnose
    Dim vBullCode_list as c
    Dim vBullcode_def as c
        vBullCode_List = "k=rmfinish,{keylist_build(\"H=.05,1:15[Plancode],2:25[Series Name],3:15[Shape]\",''+Blns_plan,left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Blns_Plan),\"Plancode\"),15),left(''+Lookup(\"series\",\"series_id=\"+quote( lookup(\"materialscheme\",\"materialsch_id=\"+quote(Blns_Plan),\"series_id\")),\"Series_name\"),25),left(''+lookup(\"materialscheme\",\"materialsch_id=\"+quote(Blns_Plan),\"Shape_id\"),15))}{left(''+Rmfinish_id,7) = [varC->vProjectID].and. unique_key_value()}"
        vBullcode_def = replace_parameters(vBullCode_list,local_variables())
    Dim vBullStretch_list as c
    dim vBullStretch_def as c
        vBullStretch_List = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id], 2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vBullCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"Surface_id\")=Surface_Id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"price_group\")=Group .AND. [varC->vBullType] $ Xdescription}"'original "+chr(13)+chr(10)+".and. [varC->vBullType] $ Xdescription}"
        vBullStretch_def = replace_parameters(vBullStretch_List,local_variables())
    DIM vBullOut_List as C
    DIM vBullOut_def as C 
        vBullOut_list = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vBullCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"Surface_id\")=Surface_Id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"price_group\")=Group .AND. [varC->vBullType]$ Xdescription .and. \"outside\" $ Xdescription}" 'Original "+chr(13)+chr(10)+".and. \"outside\" $ Xdescription}"
        vBullOut_def = replace_parameters(vBullOut_List,local_variables())
    DIM vBullInside_List as C 
    DIM vBullInside_def as C
        vBullInside_list = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vbullCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"Surface_id\")=Surface_Id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"price_group\")=Group .AND. [varC->vBullType]$ Xdescription .and.\"inside\" $ Xdescription}" 'Original "+chr(13)+chr(10)+".and. \"inside\" $ Xdescription}"
        vBullInside_def = replace_parameters(vBullInside_list,local_variables())
    DIM vBullButt_List as C 
    DIM vBullButt_def as C
        vBullButt_list = "k=prdctgrp_queue,{keylist_build(\"H=.05,1:20[Shape Id],2:10[Group],3:10[Surface],4:60[Description]\",''+Prdctgroup_id,left(''+Shape_id,20),left(''+Group,10),left(''+Surface_id,10),left(''+xdescription,50))}{Series_id = lookup(\"materialscheme\",\"Materialsch_id=\"+quote([varC->vbullCode]),\"Series_id\") .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"Surface_id\")=Surface_Id .AND. lookup(\"materialscheme\",\"materialsch_id=\"+quote([varC->vBullCode]),\"price_group\")=Group .AND. [varC->vBullType]$ Xdescription .and. \"Butt\" $ Xdescription}" 'Original "+chr(13)+chr(10)+".and. \"inside\" $ Xdescription}"
        vBullButt_def = replace_parameters(vBullButt_list,local_variables())    
    
    'Some of Default Calcilation
    dim shared vWidth as n
    dim shared vLength as n  
    		
    'Start the xDialog box here
    
    varC_result_direct = ui_dlg_box("New Direct Materials",<<%dlg%
    {on_key=enter}
    {region1}
    Estimate ID:| [.25vEsthdid];
    {endregion1}|{sp}
    {region12}
    Bid Section:| [.10vSection];
    {endregion12};
    {lf};
    {frame=1:  Field}
    {region2}
    {image=$$generic.orb.blue};
    Plan Code:|{initial_focus} [%@vFieldCode_def%.20vFieldCode!vFieldCode_changed]| [.10vFieldQty];
    Vendor:| [%@vFieldVndr_def%.20vFieldVendor];
    {lf};
    {endregion2}|{sp}
    
    {frame=1:  Fixture}
    {region5}
    {image=$$generic.orb.orange};
    Plan Code:| [%@vFixtCode_def%.20vFixtCode!vFixtCode_changed]| [.10vfixtQty];
    Vendor:| [%@vFixtVndr_def%.20vFixtVndr]| UOM: [%@vFixtUom_rl_def%.12vFixtUom];
    {endregion5};
    {lf};
    {frame=1:  Base}
    {region3}
    {image=$$generic.orb.red};
    Type of Shape:| [%v%.20vBaseType^=a_vTrimType!vBaseType_changed];
    Plan Code:| [%@vBaseCode_def%.20vBaseCode!vBaseCode_changed];
    Stretch:| [%@vBaseStretch_def%.20vBaseStretch!vBaseStretch_changed]|[.10vBaseStrQty];
    Outside:| [%@vBaseOut_def%.20vBaseOut!vBaseOut_changed]|[.10vBaseOcQty];
    Inside:| [%@vBaseInside_def%.20vBaseInside!vBaseInside_changed]|[.10vBaseIcQty];
    Butterfry:| [%@vBaseButt_def%.20vBaseBfId!vBaseButt_changed]|[.10vBaseBfQty];
    {lf};
    {endregion3}|{sp}
    {frame=1:  Bullnose}
    {region4}
    {image=$$generic.orb.red};
    Type of Shape:| [%v%.20vBullType^=a_vTrimType!vBullType_changed];
    Plan Code:| [%@vBullCode_def%.20vBullCode!vBullCode_changed];
    Bullnose:| [%@vBullStretch_def%.20vBullStretch!vBullStretch_changed]|[.10vBullStrQty];
    Outside:| [%@vBullOut_def%.20vBullOut!vBullOut_changed]|[.10vBullOcQty];
    Inside:| [%@vBullInside_def%.20vBullInside!vBullInside_changed]|[.10vBullIcQty];
    Butterfry:| [%@vBullButt_def%.20vBullBfId!vBullButt_changed]|[.10vBullBfQty];
    {lf};
    {endregion4};
    {lf};
    {frame=1:  Converted Trims}
    {region6}
    {lf};
    Deduct Base?:|(vCheckBase!vcheckBase_changed){sp=4}Base: [.10vBaseConvQty];
    Deduct Blns?:|(vCheckBlns!vcheckBlns_changed){sp} Bullnose: [.10vBullConvQty];
    |Sum of Deduction:| [.10vSumofConv];
    {lf};
    {endregion6}|{sp}
    {lf};
    {frame=1:  Deduction}
    {region7}
    {lf};
    Apply Deduct?:| (vDeductTrims!vDeductTrims_changed){sp}Deduction: [.10vApplyQty!vApplyQty_changed];
    |Revised Area Qty:| [.10vRevisedAreaQty];
    {lf};
    {endregion7};
    {lf};
    {region9}
    {line=3,0};
    {justify=center}
    {sp=10}<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion9};
    %dlg%,<<%code%
    
    If a_dlg_button = "vFieldCode_changed" then 
    	if vSection ="floor" then
           vFieldCode_def = replace_parameters(vFloorCode_orig,local_variables())
        else
           vFieldCode_def = replace_parameters(vWallCode_orig,local_variables()) 
        end if
        a_dlg_button = ""
        vFieldVndr_def = replace_parameters(vFieldVndr_orig,local_variables())
    end if
    	
    'Fixture Event condition
    If a_dlg_button = "vFixtCode_changed" then 
    	if vSection ="floor" then
           vFixtCode_def = replace_parameters(vThrHldCode_orig,local_variables())
        else
           vFixtCode_def = replace_parameters(vFixtCode_orig,local_variables())
        end if
        a_dlg_button = ""
        vFixtVndr_def = replace_parameters(vFixtVndr_orig,local_variables())
    end if 
    
    'Base - Testing Section copy of 'Bullnose changed conditions
    If a_dlg_button = "vBaseType_changed" then
    	if vSection="floor" then 
    		vBaseCode_def = replace_parameters(vRtbCode_List,local_variables())
    	else
    		vBaseCode_def = replace_parameters(vFtbCode_List,local_variables())
    	end if
    	a_dlg_button = ""
    end if
    
    If a_dlg_button = "vBaseCode_changed" then 
    	vBaseStretch_def = replace_parameters(vBaseStretch_List,local_variables())
    	a_dlg_button = ""
    end if 
    
    If a_dlg_button = "vBaseStretch_changed" then 
    	a_dlg_button = ""
    	vBaseOut_def = replace_parameters(vBaseOut_List,local_variables())
    end if 
    
    If a_dlg_button = "vBaseOut_changed" then 
    	a_dlg_button = ""
    	vBaseInside_def = replace_parameters(vBaseInside_List,local_variables())
    end if
    
    if a_dlg_button = "vbaseInside_changed" then
    	a_dlg_button = ""
    	vBaseButt_def =replace_parameters(vBaseButt_List,local_variables())
    end if
    
    if a_dlg_button = "vBaseButt_changed" then
        a_dlg_button = ""
    end if
    'End of Base copy
     
    'Bullnose changed conditions
    If a_dlg_button = "vBullType_changed" then 
    	vBullCode_def = replace_parameters(vBullCode_List,local_variables())
    	a_dlg_button = ""
    end if 
    
    If a_dlg_button = "vBullCode_changed" then 
    	vBullStretch_def = replace_parameters(vBullStretch_List,local_variables())
    	a_dlg_button = ""
    end if 
    
    If a_dlg_button = "vBullStretch_changed" then 
    	vbullOut_def = replace_parameters(vBullOut_List,local_variables())
    	a_dlg_button = ""
    end if 
    
    If a_dlg_button = "vBullOut_changed" then 
    	vBullInside_rl_def = replace_parameters(vBullInside_List,local_variables())
    	a_dlg_button = ""
    end if
    
    if a_dlg_button = "vBullInside_changed" then
        a_dlg_button =""
        vBullButt_def = replace_parameters(vBullButt_list,local_variables())
    end if
    
    if a_dlg_button = "vBullButt_changed" then
        a_dlg_button =""
    end if
    
    'Apply Qty Get the Conversion
    
    if a_dlg_button = "vCheckBase_changed" then
        if vcheckBase = .t. then
        	Get_prdct_dimension(vBaseStretch)
        ui_msg_box("Base","Base  "vWidth) 'Check for my UDF
    	    vBaseConvQty =  round(((vBaseStrQty * 12 *vWidth) /144),2)
    	ui_msg_box("base","converted "vBaseConvQty)    
    	else
    	    vBaseConvQty =0
    	end if
    	a_dlg_button=""
    end if
    if a_dlg_button =  "vCheckBlns_changed" then    
    	if vCheckBlns = .t.
    		Get_prdct_dimension(vBullStretch)
    	 ui_msg_box("Bullno","bullnose is "vLength)
    	    vBullConvQty = round(((vBullStrQty * 12* vWidth) /144),2)
    	 ui_msg_box("bull","bull Converted "vBullConvQty)   
    	else
    	    vBullConvQty =0    
        end if
    	a_dlg_button=""
    end if
    
    If a_dlg_button = "vDeductTrims_changed" then 
    	vSumofConv = round(vBaseConvQty + vBullConvQty,2)
    	a_dlg_button = ""
    	if vDeductTrims =.t.
    	   vRevisedAreaQty = round(vFieldQty - if(vApplyQty<>0,vApplyQty,vSumofConv),2)
    	else
    	   vRevisedAreaQty = vFieldQty
    	end if 
    end if
        
    If a_dlg_button = "vApplyQty_changed" then 
    	a_dlg_button = ""
    	if vDeductTrims =.t.
    	   vRevisedAreaQty = round(vFieldQty - if(vApplyQty<>0,vApplyQty,vSumofConv),2)
    	else
    	   vRevisedAreaQty = vFieldQty
    	end if    
    end if
    
    if a_dlg_button = "Cancel"  then
          msg = "Are you sure you want to close the Estimate Criteria Page Without saving?"
          answer = ui_msg_box("Notice",msg,ui_yes_no)
          if answer = ui_yes_selected then
             a_dlg_button = "&Cancel"
          else
            a_dlg_button = ""
          end if
    end if  
        
    %code%) 
    
    'Save Current Record to table as New Record. 
    if varC_result_direct = "ok" then
      dim shared tCrit as p
      tCrit = table.get("est_criteria")
         tCrit.enter_begin()
            'Deleted the Fields here for shrink space
         tCrit.enter_end(.t.)
    end if 
    'tCrit.close()
            
    END FUNCTION
    How can I improve the speed and What did I miss on the calculation fields?

  • #2
    Re: xDialog Box

    John,
    Not quite enough info to easily try to figure out a solution for you.....it would be guessing on quite a few of your issues without being able to actually call up the xdialog....especially on the speed issue. A sample db using this will be necessary (for me at least) to dive into it. And what are the results you are getting and what are the expected results??

    Also, you state

    but
    Code:
    ui_msg_box("Base","Base  "vWidth)
    will (for some reason!) give the variable value....but you probably noticed you were not getting the text. You need to add a "+" sign between the text and variable.
    Such as ui_msg_box("Base","Base "+vWidth)
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________



    Comment


    • #3
      Re: xDialog Box

      (1) Too slow to open it
      The lookup() function is certainly not one of the fastest tools ever developed and you have many in your keylist_build sections. I would suspect those for the reason your xdialog is slow to open.
      There can be only one.

      Comment


      • #4
        Re: xDialog Box

        Mike and Stan,

        Thank you.
        I want to send the ZIP files now but I'd like ask about the "keylist_buld()".

        If "Keylist_build()" made slow processing, what other function do you recommend to use?

        Is "table.external_record_content_**()" better than "Keylist_build() for speed?

        Does "table.exter......._from_key_get()" give me the "Key Value" like "keylist_build()?

        If I use one of the "table.exter....()" function, How can I Get the Field Label?

        Comment


        • #5
          Re: xDialog Box

          The keylist_build() is not the problem. Lookup() is the problem. Your xdialog has to perform something like 60 lookups before it can display.

          I doubt if there is an alternative.

          Note: If you can translate the lookup() functions to the corresponding lookupC() and lookupN() functions, they would execute much more quickly.
          There can be only one.

          Comment


          • #6
            Re: xDialog Box

            alternate to the lookup in the keylist build, can you get the values you need before the keylist build with a fetch_find of a read-only copy of the lookup table? It may make things much quicker.

            I had some issues with keylist builds, and Cal had some great ideas, but I am not at my office right now to get the samples.

            more tomorrow...

            Tom

            Comment


            • #7
              Re: xDialog Box

              I am so curious as to what this XD looks like - can you post a screen shot? Also - what is the reason for making something so complicated instead of creating a form?
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


              • #8
                Re: xDialog Box

                Robin,

                I commented out all of the KL_builds and changed all of the form field values to zero or spaces, and this is what the dialog looks like. Once we aren't doing all of those keylist builds with lookups, it pops right up.

                Tom

                Comment


                • #9
                  Re: xDialog Box

                  I commented out all of the KL_builds and changed all of the form field values to zero or spaces
                  Nice trick, Tom. That goes in the toolbox if I can remember where I left it.
                  There can be only one.

                  Comment


                  • #10
                    Re: xDialog Box

                    John,

                    Just out of curiosity, what is a "butterfry"???

                    this is the code I spoke about last night. "We use table_external records_get" instead of "Keylist_build" . I was having real trouble with the keylist, so when I reached out to Cal Locklin, he pointed me in this direction. I did leave certain, simple keylist_builds in the script.

                    Hope it helps.

                    Code:
                    'Date Created: 05-May-2010 02:54:53 PM
                    'Last Updated: 18-Mar-2011 09:37:43 AM
                    'Created By  : Thomas Henkel
                    'Updated By  : Thomas Henkel
                    DIM aa as P
                    aa = addin.variables()
                    varinit()   'UDF
                    DIM clt as P
                    DIM lnk as P
                    DIM SHARED DLG as L
                    DIM SHARED vCASENO as C = ""
                    DIM SHARED vSSN as C
                    DIM SHARED vFOLDER as C = ""
                    DIM v65 as L
                    DIM vallow as C = ""
                    DIM SHARED vNAME as C = ""
                    DIM SHARED lnk_recno as N
                    DIM SHARED vPGM as C = ""
                    DIM SHARED vSEGM as C = ""
                    DIM SHARED vIWORKER as C = ""
                    DIM SHARED vCWORKER as C = ""
                    DIM SHARED vSWORKER as C = ""
                    DIM SHARED vDATE1 as D = {}
                    DIM SHARED vDATE2 as D = {}
                    DIM SHARED vACTION2 as C = ""
                    DIM SHARED vDATE3 as D = {}
                    DIM SHARED vSTATUS as C = ""
                    DIM SHARED vSTAT_DATE as D = {}
                    DIM SHARED vFILEROOM as C = ""
                    DIM SHARED vCREASON as C = ""
                    DIM SHARED vDREASON as C = ""
                    DIM shared vERR_TEXT as C = ""
                    DIM shared vORIGCASE as C = ""
                    DIM SHARED vMODEL as C
                    DIM OVER as L = .F.
                    DIM vCNT as N = 0
                    DIM SHARED vERROR as L
                    DIM SHARED varC_result as C
                    'DIM vIWORKER_rl_def as C 
                    'DIM vSWORKER_rl_def as C
                    'DIM vACTION2_rl_def as C 
                    DIM vSTATUS_rl_def as C
                    DIM vCREASON_rl_def as C 
                    DIM vDREASON_rl_def as C 
                    debugcheck()
                    'clt = table.open("client",FILE_RO_SHARED)
                    clt = table.get("client")
                    vSSN = clt.ssn
                    if clt.dob < addyears(date(),-65)
                    	v65 = .T.
                      else
                      	v65 = .F.
                    end if
                    vNAME = UT(clt.fname)+" "+ut(clt.lname)
                    if vMODEL = "E" .or. vMODEL = ""
                    	'lets first determine if the client already has a case number
                    	'count how many cases there are
                    	filt = "SSN= '"+vSSN+"'"
                    	vCNT = tablecount("link",filt)
                    	
                    	lnk = table.open("LINK",FILE_RO_SHARED)
                    	lnk.index_primary_put("Ssn")
                    	foundit = lnk.fetch_find(vSSN)
                    	if foundit > 0 .and. (vCNT>1 .or. left(lnk.Pgm,2)<>"RC")
                    		if vCNT >1 .and.left(lnk.PGM,2)="RC"
                    			'make sure we aren't using the reach case for the case number
                    			lnk.fetch_next()
                    		end if
                    		vFILEROOM = lnk.Floor
                    		vFOLDER = lnk.Filefolder
                    		if isalpha(left(lnk.Case,1))
                    			vCASENO = lnk.Case
                    			vORIGCASE = lnk.case
                    		  else
                    		  	if left(right(trim(lnk.case),6),1)>"3"
                    		  		vCASENO ="S"+right(trim(lnk.case),6)
                    		  	  else
                    		  	  	vCASENO = "C"+right(trim(lnk.case),6)
                    		  	end if
                    			vORIGCASE = vCASENO
                    		end if	
                    	  elseif left(lnk.Pgm,2) = "RC"
                    	  	'reach case from another client (maybe)
                    	  	vCASENO = lnk.Case
                    	  	vORIGCASE = lnk.case
                    	  	ansR = ui_msg_box(agency+" Customer Information","This Client has a REACH case - "+vCASENO+" - from another client,"+crlf()+"Do you want to assign a new Case Number?",51)
                    	  	if ansR <> 6
                    	  		ui_msg_box(agency+" Customer Information","Action cancelled at user request")
                    	  		end
                    	  	end if
                    		script_play("reg new case number")
                    		vORIGCASE = vCASENO
                    	  else
                    	  	'new case entry
                    	  	script_play("reg new case number")
                    		'debugcheck()
                    		vORIGCASE = vCASENO
                    	end if
                    	if vERROR
                    		end
                    	end if
                    	lnk.close()
                    end if
                    if vMODEL ="C"
                      	ansu = 7
                      else
                     	ansu = ui_msg_box(agency+" Customer Information","Are you just entering a \"Universal\" case?",292)
                    end if
                    if ansu =6
                    	vMODEL = "E"
                    	vPGM = "UNV"
                    	vDATE1 = date()
                    	vDATE2 = date()
                    	vACTION2 = "ENTRY"
                    	vFOLDER = vCASENO
                    	goto enterit
                    end if
                    vSTATUS_rl_def = "k=status,{keylist_build(\"H=.05,1:4,2:25\",''+Status,left(''+Status,4),left(''+Desc,25))}{}"
                    vCREASON_rl_def = "ke=closerea,{keylist_build(\"H=.05,1:6,2:15,3:25\",''+Closecode,left(''+Closecode,6),left(''+Category,15),left(''+Describe,25))}{}"
                    vDREASON_rl_def = "ke=denyreas,{keylist_build(\"H=.05,1:6,2:15,3:25\",''+Denycode,left(''+Denycode,6),left(''+Category,15),left(''+Describe,25))}{}"
                    
                    'vSEGM_rl_def = "k=segment,{keylist_build(\"H=.05,1:9,2:35\",''+Seg,left(''+Seg,9),left(''+Describe,35))}{prog=\"MED\"}"
                    'vSEGT_rl_def = "k=segment,{keylist_build(\"H=.05,1:9,2:35\",''+Seg,left(''+Seg,9),left(''+Describe,35))}{prog=\"AFD\"}"
                    'vSEGF_rl_def = "k=segment,{keylist_build(\"H=.05,1:9,2:35\",''+Seg,left(''+Seg,9),left(''+Describe,35))}{prog=\"FSP\"}"
                    'vSEGMA_rl_def = "k=segment,{keylist_build(\"H=.05,1:9,2:35\",''+Seg,left(''+Seg,9),left(''+Describe,35))}{}"
                    'vPGM_rl_def = "k=pgm,{keylist_build(\"H=.05,1:9,2:25\",''+Pgm,left(''+Pgm,9),left(''+Desc,25))}{}"
                    'vIWORKER_rl_def = "k=workers,{keylist_build(\"H=.05,1:9,2:25\",''+Wcode,left(''+Wcode,9),left(''+Wname,25))}{(between(left(wcode,1),\"A\",\"B\").or.left(wcode,1)=\"E\").and.left(WCODE,3)<>\"ADM\".and.left(wcode,2)<>\"AM\".and.left(wcode,2)<>\"AP\".and.left(wcode,2)<>\"AX\".and.left(wcode,2)<>\"BD\".and.left(wcode,2)<>\"BT\"}"
                    'vCWORKER_rl_def = "k=workers,{keylist_build(\"H=.05,1:8,2:25\",''+Wcode,left(''+Wcode,8),left(''+Wname,25))}{between(left(wcode,1),\"A\",\"B\").and.left(WCODE,3)<>\"ADM\".and.left(wcode,2)<>\"AM\".and.left(wcode,2)<>\"AP\".and.left(wcode,2)<>\"AX\".and.left(wcode,2)<>\"BD\".and.left(wcode,2)<>\"BT\"}"
                    'vSWORKER_rl_def = "k=workers,{keylist_build(\"H=.05,1:9,2:25\",''+Wcode,left(''+Wcode,9),left(''+Wname,25))}{left(wcode,2)=\"AM\".or.left(wcode,2)=\"AP\".or.left(wcode,2)=\"AX\".or.left(wcode,2)=\"BD\".or.left(wcode,2)=\"BT\"}"
                    'vACTION2_rl_def = "k=caseact,{keylist_build(\"H=.05,1:10\",''+Action,left(''+Action,10))}{}"
                    'Save the original full/unfiltered seg list in case a PRG choice ends up creating a blank seg list. A
                    'blank seg list (lookup list) will create havoc and lock up the program - a Ctrl-Alt-Del will be required.
                    full_seg_list = table.external_record_content_get( "segment","ut(seg)+\"  \"+trim(describe)","seg" )
                    seg_list = full_seg_list
                    
                    PGM_list = table.external_record_content_get( "pgm", "padr(pgm,6,\" \")+trim(desc)","pgm")
                    
                    action_list = table.external_record_content_get("caseact","padr(ut(action),16,\" \")","ACTION")
                    
                    full_worker_list = table.external_record_content_get("workers","ut(WCODE)+\" \"+wname","wcode")
                    filt1 = "(between(left(wcode,1),\"A\",\"B\").or.left(wcode,1)=\"E\").and.left(WCODE,3)<>\"ADM\".and.left(wcode,2)<>\"AM\".and.left(wcode,2)<>\"AP\".and.left(wcode,2)<>\"AX\".and.left(wcode,2)<>\"BD\".and.left(wcode,2)<>\"BT\""
                    worker_list1 = table.external_record_content_get("workers","ut(WCODE)+\" \"+wname","wcode",filt1)
                    filt2 = "left(wcode,2)=\"AM\".or.left(wcode,2)=\"AP\".or.left(wcode,2)=\"AX\".or.left(wcode,2)=\"BD\".or.left(wcode,2)=\"BT\""
                    worker_list2 = table.external_record_content_get("workers","ut(WCODE)+\" \"+wname","wcode",filt2)
                    do_again:
                    	if vORIGCASE = ""
                    		vORIGCASE = vCASENO
                    	  else
                    	  	vCASENO = vORIGCASE
                    	end if
                    	vERROR=.F.
                    	vSEGM = ""
                    	vPGM = ""
                    	vDATE1 = ""
                    	vDATE2 = ""
                    	vDATE3 = ""
                    	vACTION2 = ""
                    	vSTATUS = ""
                    	vSTAT_DATE = ""
                    	vSWORKER = ""
                    	vIWORKER = ""
                    	vCWORKER = ""
                    	vCREASON = ""
                    button_prop = "{F=Arial,9,B}{B=red}{C=white}Override"
                    heading_string = vNAME+"   -   Case No: "+vCASENO+crlf()+"Case Information Entry"
                    ok_button_label = "&OK"
                    cancel_button_label = "Cancel"
                    more_button_label = "More"
                    override_button_label = "Override"
                    override_text = "~~If the Date is correct, click the 'Override' Button~~"
                    backcolor="#234+255+255"
                    
                    '***************************************************************************************
                    'for Change
                    if vMODEL = "C"
                    	lnk = table.open("link",FILE_RO_SHARED)
                    	lnk.fetch_goto(lnk_recno)
                      	vCASENO = lnk.Case
                    	vSEGM = lnk.Segment
                    	vPGM = lnk.Pgm
                    	vDATE1 = lnk.Date1
                    	vDATE2 = lnk.Date2
                    	vDATE3 = lnk.Date3
                    	vACTION2 = lnk.Action2
                    	vSTATUS = lnk.Status
                    	vSTAT_DATE = lnk.Stat_date
                    	vSWORKER = lnk.Swcode
                    	vIWORKER = lnk.Iwcode
                    	vCWORKER = lnk.Cwcode
                    	vCREASON = lnk.Action3
                    	vFILEROOM = lnk.floor
                     	backcolor = "#254+254+193"  
                    	heading_string = vNAME+"   -   Case No: "+vCASENO+crlf()+"Change Case Information"
                    	footer_string = "Click \"OK\" when finished."
                    end if
                    '****************************************************************************************
                    
                    
                    dlg_body =<<%dlg%
                    {Background=__backcolor__}
                    {region}
                    {text=45,2:heading_string}{SP=3}- Information marked with "{color=red}*{color=black}" is {color=red}{font=arial,9,b}REQUIRED{font=arial,8,n}{color=black};
                    {endregion};
                    
                    {line=1,0};
                    {lf};
                    {region}
                    Program{color=red}*{color=black}: [%O={@@}%.25vPGM^+pgm_list!vPGM_*]{sp=5}
                    Segment{color=red}*{color=black}: [%O={@@}%.25vSEGM^+seg_list!vSEGM_*];
                    {lf};
                    Application Date{color=red}*{color=black}: 
                    [%DATE;P=popup.calendar(dtoc(vDATE1));I=popup.calendar%.15vDATE1!vDATE1_*]{sp=3}
                    Registration Date{color=red}*{color=black}: 
                    [%DATE;P=popup.calendar(dtoc(vDATE2));I=popup.calendar%.15vDATE2!vDATE2_*]{sp=3}
                    Registration Action{color=red}*{color=black}: [%O={@@}%.25vACTION2^+action_list!vACTION2_*];
                    {lf};
                    Intake  Worker{color=red}*{color=black}: [%O={@@}%.20vIWORKER^+worker_list1!vIWORKER_*]{sp=3}
                    Redet Worker{color=red}*{color=black}: [%O={@@}%.20vCWORKER^+worker_list1!vCWORKER_*]{sp=3}
                    Service Worker: [%O={@@}%.20vSWORKER^+worker_list2!vSWORKER_*];
                    {endregion};
                    {lf};
                    {region}
                    Case Status: [%@vSTATUS_rl_def%.8vSTATUS]{sp=3}
                    Status Date: 
                    [%DATE;P=popup.calendar(dtoc(vSTAT_DATE));I=popup.calendar%.15vSTAT_DATE!vSTAT_DATE_*]
                    {endregion}{sp=3}
                    {condition=(vSTATUS="C")}
                    {region=a}
                    Close Reason: [%@vCREASON_rl_def%.8vCREASON]
                    {sp=3}Close Date: [%DATE;P=popup.calendar(dtoc(vDATE3));I=popup.calendar%.15vDATE3!vDATE3_*]
                    {condition=(vSTATUS="D")}
                    {start_pos}
                    {sp=3}Deny Reason: [%@vDREASON_rl_def%.8vDREASON]{endregion};
                    {condition=.T.}
                    {region}
                    {lf};
                    File Room{color=red}*{color=black}:  (vFILEROOM:3) (vFILEROOM:4)
                    {endregion};
                    {blueframe=1,2:Error Messages}
                    {Region}
                    {color=red}{font=arial,9,b}{text=90,3vERR_TEXT}{font=arial,8,n}{color=black};
                    {endregion};
                    {lf};
                    {line=1,0};
                    {region}
                    {justify=left}<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {condition=(vMODEL<>"C")}<15=more_button_label!MORE>{condition=.T.}
                    {sp=50}{condition=(over=.T.)}<%O={@@};B=G%=button_prop!OVERRIDE>{condition=.T.}{endregion};
                    %dlg%
                    
                    dlg_code = <<%code%
                    if (a_dlg_button = "OK" .or. a_dlg_button = "MORE") .and. vSEGM="" .and. vPGM <>"UNV"
                    	a_dlg_button = "CANCEL"
                      elseif a_dlg_button = "OVERRIDE"
                    	vallow = "Y"
                    	vERR_TEXT = ""
                    	over = .F.
                    	a_DLG_BUTTON = ""
                    	sys_send_keys("{tab}")
                      elseif left(a_dlg_button,6) = "vSEGM_" then
                    	trace.WriteLn( "SEG - " + a_dlg_button )
                    	if a_dlg_button = "vSEGM_setfocus"
                    		vPGM = word(vPGM,1)
                    	END IF	
                        if a_dlg_button = "vSEGM_killfocus"
                        	vERR_TEXT=""
                        	if vSEGM = "" .and. vPGM <>"UNV"
                        		vERR_TEXT="Segment MUST be SELECTED"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vSEGM")
                        	end if
                            'determine if Medicaid,  If so, change case number to appropriate "02" number
                            if vPGM = "MED"
                            	SELECT
                                    case word(vSEGM,1)="CCPD".or."GO"$word(vSEGM,1).or.word(vSEGM,1)="JCAD".or.word(vSEGM,1)="TTW".or.word(vSEGM,1)="MOCM".or.word(vSEGM,1)="MOAL".or.word(vSEGM,1)="JCNH".or.word(vSEGM,1)="MONH"
                                         if v65
                                             vCASENO="0210"+right(trim(vCASENO),6)
                                           else
                                               vCASENO="0220"+right(trim(vCASENO),6)
                                        end if
                               		 	vFOLDER = vCASENO
                                    case word(vSEGM,1)="MNC".or.vSEGM="MNNH"
                                         if v65
                                             vCASENO="0215"+right(trim(vCASENO),6)
                                           else
                                               vCASENO="0225"+right(trim(vCASENO),6)
                                        end if    
                    				 	vFOLDER = vCASENO
                                    case word(vSEGM,1)="FAM"
                    		  		 	vFOLDER = vCASENO
                                         vCASENO="0230"+right(trim(vCASENO),6)
                                    case word(vSEGM,1)="FCA"
                    				 	vFOLDER = vCASENO
                                         vCASENO="0270"+right(trim(vCASENO),6)
                                    case else
                               		 	vFOLDER = vCASENO
                    '                    vCASENO = vCASENO
                                END SELECT       
                                'refresh the heading string
                                heading_string = vNAME+"   -   Case No: "+vCASENO+crlf()+"Case Information Entry"
                            end if
                        end if
                        a_dlg_button = ""
                      ELSEIF left(a_dlg_button,5) = "vPGM_" then
                        trace.WriteLn( "PGM - "+a_dlg_button )
                        IF a_dlg_button = "vPGM_killfocus"
                        	vERR_TEXT = ""
                        	if vPGM = ""
                        		vERR_TEXT = "Program MUST be selected"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vPGM")
                        	end if
                        	'vPGM = word(vPGM,1)
                            filt = replace_parameters("trim(prog) = word([varC->vPGM],1)",local_variables())
                            'SAME THING:  filt = "trim(prog) = '" + vPGM + "'"
                            'The "seg_list" returned here must be formatted like the original seg_list so it MUST include
                            'the Tab stuff. Just use the original line and add the filter.
                            seg_list = table.external_record_content_get("segment","ut(seg)+\"  \"+trim(describe)","seg",filt )
                            'All "heck" breaks loose if the lookup list is blank so I added this JIC.
                            IF seg_list = ""
                                'Return it to the full list.
                                seg_list = full_seg_list
                            END IF
                        END IF
                        a_dlg_button = ""
                      ELSEIF left(a_dlg_button,7) = "vDATE1_" then
                        if a_dlg_button = "vDATE1_setfocus" then
                        	vERR_TEXT=""
                        	if vSEGM = "" .and.vPGM <>"UNV"
                        		vERR_TEXT="Segment MUST be SELECTED"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vSEGM")
                        	  else
                    	  		vSEGM = word(vSEGM,1)
                        	end if
                    	end if  			
                        if a_dlg_button = "vDATE1_killfocus" then
                        	if vDATE1<>{} .and. vMODEL = "C"
                    	    	if vallow ="Y"
                    	    		vERR_TEXT = ""
                    	    	  else
                    				vERR_TEXT = ckdates(vDATE1, "Application Date","B",60)
                    		        if vERR_TEXT <>"" .and. vallow = ""
                    		        	vERR_TEXT = vERR_TEXT+CRLF()+override_text
                    		        	over=.T.
                    		            ui_dlg_ctl_goto(agency+ " Customer Information","vDATE1")
                    		        end if
                    			end if
                    		end if
                            vallow = ""
                        end if
                        a_dlg_button = ""
                      ELSEIF left(a_dlg_button,7) = "vDATE2_" then
                        if a_dlg_button = "vDATE2_killfocus" then
                    		if vDATE2 <>{} .and. vMODEL = "C"    
                    	    	if vallow ="Y"
                    	    		vERR_TEXT = ""
                    	    	  else
                    		        vERR_TEXT = ckdates(vDATE2, "Registration Date","B")
                    		        if vERR_TEXT <>"" .and.vallow <> "Y"
                    		        	over= .T.
                    		        	vERR_TEXT = vERR_TEXT+CRLF()+override_text
                    		        	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE2")
                    		        end if
                    		        vERR_TEXT = ckdates(vDATE2, "Registration Date","F")
                    		        if vERR_TEXT <>"" .and.vallow <> "Y"
                    		        	vERR_TEXT = vERR_TEXT+CRLF()+override_text
                    		        	over=.T.
                    		        	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE2")
                    		        end if
                    			end if	        		
                    		end if
                            vallow = ""
                        end if
                        a_dlg_button = ""
                      ELSEIF left(a_dlg_button,4) = "vACT" then
                        trace.WriteLn( "ACTION - "+a_dlg_button )
                        IF a_dlg_button = "vACTION2_killfocus"
                        	vERR_TEXT = ""
                        	if vACTION2 = ""
                        		vERR_TEXT = "Registration Action MUST be selected"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vACTION2")
                        	end if
                       end if
                       a_dlg_button = ""
                      ELSEIF left(a_dlg_button,4) = "vIWO" then
                        trace.WriteLn( "IWORKER - "+a_dlg_button )
                        IF a_dlg_button = "vIWORKER_killfocus"
                        	vERR_TEXT = ""
                        	if vIWORKER = "" .and. vPGM <>"UNV"
                        		vERR_TEXT = "Intake Worker MUST be selected"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vIWORKER")
                        	end if
                       end if
                       a_dlg_button = ""
                      ELSEIF left(a_dlg_button,4) = "vCWO" then
                        trace.WriteLn( "CWORKER - "+a_dlg_button )
                       	if a_dlg_button = "vCWORKER_setfocus"
                       		if vIWORKER = "" .and. vPGM <>"UNV"
                        		vERR_TEXT = "Intake Worker MUST be selected"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vIWORKER")
                        	  else
                      			vIWORKER = word(vIWORKER,1)
                        	end if
                    	end if	
                        IF a_dlg_button = "vCWORKER_killfocus"
                        	vERR_TEXT = ""
                        	if vCWORKER = "" .and. vPGM <>"UNV"
                        		vERR_TEXT = "Redet Worker MUST be selected"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vCWORKER")
                        	  else
                      			'vCWORKER = word(vCWORKER,1)
                        	end if
                       end if
                       a_dlg_button = ""
                      ELSEIF left(a_dlg_button,4) = "vSWO" then
                        trace.WriteLn( "SWORKER - "+a_dlg_button )
                       	if a_dlg_button = "vSWORKER_setfocus"
                       		if vCWORKER = "" .and. vPGM <>"UNV"
                        		vERR_TEXT = "Redet Worker MUST be selected"
                        		ui_dlg_ctl_goto(agency+ " Customer Information","vCWORKER")
                        	  else
                      			vCWORKER = word(vCWORKER,1)
                        	end if
                       end if
                       a_dlg_button = ""
                      ELSEIF left(a_dlg_button,7) = "vDATE3_" then
                        if a_dlg_button = "vDATE3_killfocus" then
                        	if vDATE3 <>{} .and. vMODEL = "C"
                    	    	if vallow ="Y"
                    	    		vERR_TEXT = ""
                    	    	  else
                    				vERR_TEXT = ckdates(vDATE3, "Close Date","B")
                    		        if vERR_TEXT <>"" .and. vallow <>"Y"
                    		        	vERR_TEXT = vERR_TEXT+CRLF()+override_text
                    		        	over=.T.
                    		        	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE3")
                    		        end if
                    		        vERR_TEXT = ckdates(vDATE3, "Close Date","F",60)
                    		        if vERR_TEXT <>"" .and.vallow <>"Y"
                    		        	vERR_TEXT = vERR_TEXT+CRLF()+override_text
                    		        	over=.T.
                    		        	ui_dlg_ctl_goto(agency+ " Customer Information","vDATE3")
                    		        end if
                    			end if	  
                    		end if      
                    		vallow = ""
                        end if
                        a_dlg_button = ""
                      ELSEIF left(a_dlg_button,11) = "vSTAT_DATE_" then
                        if a_dlg_button = "vSTAT_DATE_killfocus" then
                            vSTAT_DATE = ctod(dtoc(vSTAT_DATE))
                        end if
                        a_dlg_button = ""
                      ELSEIF a_dlg_button ="OK" .or. a_dlg_button = "More"
                      	if w_count(vIWORKER)>1
                      		vIWORKER = word(vIWORKER,1)
                      	end if
                      	if w_count(vCWORKER)>1
                      		vCWORKER = word(vCWORKER,1)
                      	end if
                      	if w_count(vSWORKER)>1
                      		vSWORKER = word(vSWORKER,1)
                      	end if
                      	if vFILEROOM = "" .and. vPGM <>"UNV"
                      		vERR_TEXT = "File Room MUST be selected"
                        	ui_dlg_ctl_goto(agency+ " Customer Information","vFILEROOM")
                        	a_dlg_button = ""
                     	end if
                    end if
                    %code%
                    
                    dlg_body = stritran(dlg_body,"__backcolor__",backcolor)
                    dlg_title = agency+" Customer Information"
                    
                    varC_result = ui_dlg_box(dlg_title,dlg_body,dlg_code)
                    
                    if varC_result <>"OK" .and. varC_result <> "More"
                    	ui_msg_box(Agency+" Customer Information","Action cancelled at user request")
                    	end
                    end if
                    if vFOLDER = ""
                    	vFOLDER = vCASENO
                    end if
                    DLG =.T.
                    'lets enter it
                    
                    enterit:
                    lnk = table.open("link",FILE_RW_SHARED)
                    if vMODEL ="E" .or. vMODEL =""
                    	lnk.enter_begin(.T.)
                      elseif vMODEL = "C"
                      	lnk.fetch_goto(lnk_recno)
                    	lnk.change_begin(.T.)
                      else
                      	end
                    end if  	
                    	lnk.Ssn = vSSN
                    	lnk.Pgm = left(vPGM,3)
                    	lnk.Case = vCASENO
                    	lnk.Date1 = vDATE1
                    	lnk.Date2 = vDATE2
                    	lnk.Action2 = vACTION2
                    	lnk.Status = vSTATUS
                    	lnk.Stat_date = vSTAT_DATE
                    	lnk.Segment = word(vSEGM,1)
                    	lnk.Iwcode = upper(left(vIWORKER,4))
                    	lnk.Cwcode = upper(left(vCWORKER,4))
                    	lnk.Swcode = upper(left(vSWORKER,4))
                    	lnk.Filefolder = vFOLDER
                    	lnk.Floor = val(vFILEROOM)
                    if vMODEL ="E" .or. vMODEL =""
                    	lnk.Euser = accesstoemp(aa.bcbss.access)  'UDF
                    	lnk.Edate = date()
                    	lnk.enter_end(.T.)
                      elseif vMODEL = "C"
                    	lnk.cuser = accesstoemp(aa.bcbss.access)
                    	lnk.cdate = date()
                    	lnk.change_end(.T.)
                      else
                      	end
                    end if  	
                    
                    lnk.close()
                    :Client_Reg.Active0.Refresh()
                    'parentform.Resynch()
                    'PARENTFORM.Refresh_Layout()
                    if varC_result = "More"
                    	goto do_again
                    end if
                    end
                    Tom
                    Last edited by Tom Henkel; 03-18-2011, 11:16 AM. Reason: code and dialog box

                    Comment


                    • #11
                      Re: xDialog Box

                      Robin,

                      what is the reason for making something so complicated instead of creating a form?
                      This xDialog is a Filter(?) in order to get several values from several tables.
                      I have to get the QTY from Qty_Table, Product cost from My price table and more.

                      I tried the form but failed because I did not have the skill nor good idea yet.
                      Util two weeks ago, this xDialog calculated all of my calculation but I did not use it because it is too slow to open an xDialog and the numbers are off. After I changed some of value on UDF, my calculate fields are recognized.

                      I will try the Tom's way.

                      Thank you Robin, Tom, Stan and Mike.

                      Comment


                      • #12
                        Re: xDialog Box

                        Makes perfect sense. I guess when I see a script like that it just seems so overwhelming. But if based on different tables, I suppose you could build these XD strings with the genie in a series and put them together.

                        I'm a slow learner '^)
                        Robin

                        Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                        Comment


                        • #13
                          Re: xDialog Box

                          FWIW: If an xdialog takes a long time to open - it ain't the xdialog itself! It's something else in the code before the ui_dlg_box() command.

                          Xdialogs open very quickly. In fact, I wrote my own aims_msg_box() routine to replace ui_msg_box() partly because I don't like the delays you often see when opening ui_msg_box(). And I bet most people reading this never even noticed that there often is a delay with ui_msg_box(). There's about a 1/2 second delay - not every time but frequently - and most people attribute it to "some kind of calculation being done before opening the message." Do the same thing with an xdialog and there is never any detectable delay.

                          Comment


                          • #14
                            Re: xDialog Box

                            Hi Cal,
                            And is there someplace we can get a peek at your XD message box? I'd like to try it.
                            Robin

                            Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                            Comment


                            • #15
                              Re: xDialog Box

                              Originally posted by MoGrace View Post
                              Hi Cal,
                              And is there someplace we can get a peek at your XD message box? I'd like to try it.
                              Robin,

                              I am sure you know this but others might like to know that Bill Parker has a very nice alternative message box in the code archive HERE. As I recall it makes use of an Xdialog.

                              Raymond Lyons

                              Comment

                              Working...
                              X