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 and Set.external_record...

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

  • xDialog Box and Set.external_record...

    Good Morning Everyone,

    I used the A5's sample Code which is "Creating a Genie Dialog Box". I made the DropDown List box with Keylist Builder which worked well but ...

    I want to have the Dropdown list box which created with "Set.External_record_content_get()" . This code, DropDown List Box was tested and worked fine in the standard scripts.

    I could not figure the location of the my "Dropdown list box code" in place. I switched this code on the several location but I got an error messages or not showed the lists.

    A5 Error message said that "Cannot use function in this context".

    Does any one know where this script should be located or "Set.External_record_content_get()" is not work with it?

    Here is the Shorten of scripts

    Code:
    Function Initial_page as c ()
            'This command creates a pointer to all of the local variables in the script
           page = 1
           max_pages = 3
    [COLOR="#FF0000"][SIZE=4][COLOR="#B22222"]  ===== I tried on here[/COLOR][/SIZE][/COLOR]
           'flag controls if you can move off the current genie page.
           ui_dlg_box("Genie",<<%dlg%
            {startup=init}
            'some code here...
            {endregion}
           %dlg%, <<%code%
           if a_dlg_button = 
                  'some code here...
           %code%)
    [COLOR="#FF0000"][SIZE=4][COLOR="#B22222"]  ===== I tried on here[/COLOR][/SIZE][/COLOR]
    End Function
    
    function define_pages as C (vars as P)
    [COLOR="#FF0000"][SIZE=4][COLOR="#B22222"]  ===== I tried on here[/COLOR][/SIZE][/COLOR]
           with vars
    [COLOR="#FF0000"][SIZE=4][COLOR="#B22222"]  ===== I tried on here[/COLOR][/SIZE][/COLOR]
           page_1 = <<%dlg2%
           ui_modeless_dlg_box("genie",<<%dlg%
           {cellspillover=on}
           Something .....
           %dlg%,<<%code%
                       if a_dlg_button = 
                           'some code here...
    [COLOR="#FF0000"][SIZE=4][COLOR="#B22222"]  ===== I tried on here[/COLOR][/SIZE][/COLOR]
           %code%)
           %dlg2%
           end with
    end function
    Genie Dialog Box Sample.jpg

  • #2
    Re: xDialog Box and Set.external_record...

    Is there some portion of the syntax description you find unclear?

    The KEYLIST_BUILD() function returns specially formatted data for display of advanced record lists in an Xdialog form.
    If you can create an equivalent string with set.external...get() then you should be able to substitue it in place of keylist_build().
    There can be only one.

    Comment


    • #3
      Re: xDialog Box and Set.external_record...

      Hi Stan,

      I have this code where the Keylist_builder() and after .... end of the xdialog on 2nd function.

      Here, the code location and an error message.

      Genie_Error Msg.jpg

      Comment


      • #4
        Re: xDialog Box and Set.external_record...

        Yes, I can see the code location and the error message. I can't see the code or tell what you are trying to do.
        There can be only one.

        Comment


        • #5
          Re: xDialog Box and Set.external_record...

          Stan,

          I have attached the full script page A and B.

          Code:
          FUNCTION EstItem_Calculator AS C (vHdrId as c, vEstSection as c )
          
          Dim dlg_title as c ="Calculator"
          
          
          vPage = 1
          vMax_pages = 3
          'flag controls if you can move off the current genie page.
          dim genie_stay as L
          	genie_stay = .f.
          dim error_message as C
          'error message if you try to move off the current page when all
          'conditions have not been met.
          error_message = ""
          
          vlocal = local_variables() 'Call Local variable
          EstItem_define_pages(vlocal) 'UDF
          EstItem_set_flags(vlocal)
          
          'Initial Lists / Conditions
          DIM vEstUom_rl_def as C 
          	vEstUom_rl_def = "k=ctg_uom,{keylist_build(\"H=.05,1:5\",''+Uom_id,left(''+Uom_id,5))}{}"
          'DIM vPrdId_rl_def as C 
          '	vPrdId_rl_def = "k=old_prdcts,{keylist_build(\"H=.05,1:25[]\",''+Prod_id,left(''+Prod_Name+Shape_Id,25))}{}"
          DIM vColorNo_rl_def as C 
          	vColorNo_rl_def = "k=colorseries,{keylist_build(\"H=.05,1:38\",''+Colorseries_id,left(''+alltrim(Colorno)+\" \"+Colorname,38))}{}"
          
          dim vSeriesId as c
          DIM vSeriesId_rl_def as C 
          vSeriesId_rl_def = "k=series,{keylist_build(\"H=.05,1:25[Series Name]\",''+Series_id,left(''+Series_name,25))}{}"
          
          'Initial Lists value
          dim vPrdList as c
          [COLOR="#0000CD"]vPrdList = set.external_record_content_get("oldprd_lst.set",\
          "old_get_shape_name(alltrim(Shape_Id))+\" \"+Old_Prdgrp->Finish+\" \"+Old_Prdgrp->Pricegroup+\"^\"+alltrim(Prod_Id)",\
          "Old_Prdgrp->Finish+Old_Prdgrp->Pricegroup","left(Group_id,len(Var->vSeriesId)) = Var->vSeriesId",1)[/COLOR]
          
          
          dim vDlgbx as c
          vDlgbx = ui_dlg_box(dlg_title,<<%dlg%
          {startup=init}
          {region0}
          {region1}
          	{image=$$large.generic.key}
          	{wrap=20};
          	{lf};
          	This Genie will calculates 
          	the Purchase QTY, Coverage and Labor Cost.
          	{lf};
          	
          {endregion1}|{sp}|
          {frame=1,1}
          {region3}
          {embedded=70,15genie}
          {endregion3};
          {region}
          {endregion};
          {endregion0};
          {region}
          {justify=right}<15&Cancel> <15<&Previous!previous?flag_previous> <15&Next\>!next?flag_next> <15&Finish?flag_finish>
          {endregion}
          %dlg%, <<%code%
          'Condition
          if a_dlg_button = "init" then
             a_dlg_button = ""
             EstItem_show_page(vlocal,1)
          end if
          
          if a_dlg_button = "next" then
             a_dlg_button = ""
             vpage = vpage + 1
             if vpage > vmax_pages then
                 vpage = vpage + 1 'vmax_pages
             end if
            
             EstItem_show_page(vlocal,vpage)
          
          '   Something wrong here, Keybord enter on Next went to on Last page. The mouse click goes to Next page. Why????
          '   if vpage = vmax_pages then
          '       msgbox("Tell me right page "+vPage)
                 'Calculate_Rate(vlocal)
          '   end if
          end if
          
          if a_dlg_button = "previous" then
             a_dlg_button = ""
             vpage = vpage - 1
             if vpage < 1 then
                 vpage = 1
             end if
             EstItem_show_page(vlocal,vpage)
          end if
          %code%)
          	'It did not work at 4 locations, Top, here and Define Page, top and Insert
          	'if a_dlg_Button = "Series_changed" then
          		
          	'end if	
          		
          if vDlgbx = "&Finish" then
              'ui_msg_box("finish","good")
              play_sound("Windows XP Startup", UI_SYSTEM_SOUND)
              'open the table and save
              tbl = table.get("est_items")
          	tbl.enter_begin()
          		tbl.Esthd_id = vHdrId
          		tbl.ESTQTY = convert_type(vEstQty,"Numeric")
          		tbl.ESTUOM = convert_type(vEstUom,"Character")
          		tbl.PROD_ID = convert_type(vPrdId,"Character")
          		tbl.COLORNO = convert_type(vColorNo,"Character")
          		tbl.Po_Qty = convert_type(vPoQty,"Numeric")
          		tbl.Mtr_cost = convert_type(vPrdPrice,"Numeric")
          		tbl.ADJUST_MTR = convert_type(vAdjcost,"Numeric")
          		tbl.Deduct = convert_type(vDeduct,"Logical")
          		tbl.crewrate = convert_type(vPlnCrewRate,"Numeric")
          		tbl.labor_Production = convert_type(vlbrPrdctn,"Numeric")
          		tbl.ADJUST_LBR = convert_type(vAdjLbr,"Numeric")
          	tbl.enter_end(.t.)
          	parentform.Resynch()
          end if
          END FUNCTION
          Page B
          Code:
          function EstItem_Define_pages as C (vars as P)
          
          with vars
          
          dim vEstQty as n
          dim vEstUom as c
          dim vPoqty as n
          dim vAdjcost as n
          dim vAdjLbr as n
          dim vLbrUnit as n
          'dim Shared vLbrPrdctn as n
          
          vPage_1 = <<%dlg2%
          ui_modeless_dlg_box("genie",<<%dlg%
          {cellspillover=on}
          {lf};
          Enter the following Info;
          {lf};
          {region}
          	Estimated Qty:| [%z%.20vEstQty];
          	UOM:| [%@vEstUom_rl_def%.15vEstUom];
          	
          	{lf};
          {endregion};	
          {lf};
          Press the Next button below to get the Coverage.;
          %dlg%,<<%code%
          1=1
          %code%)
          %dlg2%
          vPage_2 = <<%dlg2%
          ui_modeless_dlg_box("genie",<<%dlg%
          {cellspillover=on}
          Select a Product name:;
          	{lf};
          	{region}
          	Series:| [%@vSeriesId_rl_def%.30vSeriesId!vSeries_changed];
          	[COLOR="#0000CD"]Product:| [.20vPrdId^+vPrdList!vPrdId_changed];[/COLOR]
          	Color Num:| [%@vColorNo_rl_def%.35vColorNo];
          	{lf};
          	Do you want to see SqFt  (10vDeduct);
          	{lf};	
          	
          	{lf};
          	{endregion};
          Press the Next button below to get the Result.;
          %dlg%,<<%code%
          1=1
          	'Calculate
          	[COLOR="#0000CD"]if a_dlg_Button = "Series_changed" then
          		vPrdId =" "  'Clean Previous value
          		vPrdList = set.external_record_content_get("oldprd_lst.set",\
          		"old_get_shape_name(alltrim(Shape_Id))+\" \"+Old_Prdgrp->Finish+\" \"+Old_Prdgrp->Pricegroup+\"^\"+alltrim(Prod_Id)",\
          		"Old_Prdgrp->Finish+Old_Prdgrp->Pricegroup","left(Group_id,len(Var->vSeriesId)) = Var->vSeriesId",1)
          		a_dlg_button =""
          	end if	[/COLOR]
          		
          		if a_dlg_button = "vPrdId_changed" then
          			'Calculate the PO Qty
          				vPoQty = Old_EstPoqty_calc(vLocal)
          			   
          			'Calculate the Labor unit cost
          				vLbrUnit = Round((vPlnCrewRate * 8) / vLbrPrdctn ,2)
          		    a_dlg_button=""
          		end if
          %code%)
          %dlg2%
          vPage_3 = <<%dlg2%
          ui_modeless_dlg_box("genie",<<%dlg%
          {cellspillover=on}
          Result:;
          {lf};
          	Purchase Qty:| [%z%.15vPoQty] {text=25,vPackSz};
          	Price from Book:| [%rz%.15vPrdPrice];
          	Adjust Cost:| [%z%.15vAdjcost];
          	{lf};
          	Labor Production:| [%rz%.15vLbrPrdctn];
          	Adjust Production:| [%z%.15vAdjLbr!vAdjLbr_changed] a day;
          	Labor Unit Cost:| [%rz%.15vLbrUnit];
          {lf};
          
          %dlg%,<<%code%
          1=1
          	if a_dlg_button ="vAdjlbr_changed" then
          		 'Calculate the Labor Unit Cost
          		 	vLbrUnit = Round((vPlnCrewRate * 8) / vAdjLbr ,2)
          		a_dlg_button =""
          	end if	
          %code%)
          %dlg2%
          end with
          '{justify=right}<15&Save>
          end function
          Thank you, Stan.

          Comment


          • #6
            Re: xDialog Box and Set.external_record...

            Completely confused. You dim the vPrdList variable and assign it the table.external......get() result in the function EstItem_Calculator. Then you try to refer/use the vPrdList variable in the EstItem_Define_pages function. Since it was defined in the first function as local it is available only to that function.

            If you aren't using it in EstItem_Calculator why not define it in EstItem_Define_pages?
            There can be only one.

            Comment


            • #7
              Re: xDialog Box and Set.external_record...

              Stan,

              Confusing. -- Me too.

              First, Maybe I am wrong but I have to place the code ( "vPrdList = Set.external.....()") on two locations in order to get Product lists. The one is on top and the other one is located after end of an xdialog. Otherwise, it will not work or I am still miss-understanding about creating the List box yet.

              Code:
              [COLOR="#0000CD"][SIZE=4][B]'Test scripts to get the list value[/B][/SIZE][/COLOR]
              DIM SHARED vSeriesId as C
              DIM SHARED vProdList as C
              DIM SHARED varC_result as C
              ok_button_label = "&OK"
              cancel_button_label = "&Cancel"
              DIM vSeriesId_rl_def as C 
              vSeriesId_rl_def = "k=series,{keylist_build(\"H=.05,1:25[Series Name]\",''+Series_id,left(''+Series_name,25))}{}"
              [COLOR="#FF0000"]vProdList = set.external_record_content_get("oldprd_lst.set",\
              	"old_get_shape_name(alltrim(Shape_Id))+\" \"+Old_Prdgrp->Finish+\" \"+Old_Prdgrp->Pricegroup+\"^\"+alltrim(Prod_Id)",\
              	"Old_Prdgrp->Finish+Old_Prdgrp->Pricegroup","left(Group_id,len(Var->vSeriesId)) = Var->vSeriesId",1)
              [/COLOR]
              varC_result = ui_dlg_box("Find Old Product ",<<%dlg%
              {region}
              Series:| [%@vSeriesId_rl_def%.40vSeriesId!Series_changed];
              Product:| [.40vProdId^+vProdList];
              {endregion};
              {line=1,0};
              {region}
              <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
              {endregion};
              %dlg%,<<%code%
              	if a_dlg_button ="Series_changed" then
              	       a_vProdId =""  'Clean Previous
              	      [COLOR="#FF0000"] vProdList = set.external_record_content_get("oldprd_lst.set",\
              		"old_get_shape_name(alltrim(Shape_Id))+\" \"+Old_Prdgrp->Finish+\" \"+Old_Prdgrp->Pricegroup+\"^\"+alltrim(Prod_Id)",\
              		"Old_Prdgrp->Finish+Old_Prdgrp->Pricegroup","left(Group_id,len(Var->vSeriesId)) = Var->vSeriesId",1)[/COLOR]
              	    a_dlg_button =""
              	end if
              %code%)

              second, I just want to show you what /where I did in the problem scripts. I tried this code on the several locations but were not right place.

              Comment

              Working...
              X