Dexterity Lookup Form

Last post 08-18-2008 8:29 PM by David Engler. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 08-13-2008 4:49 PM

    Dexterity Lookup Form

    Well, I'm building a Lookup form, with a search box, and I want to write a script that in case the search field change, to select the matching Item in the list box

    Any samples I can use to do it, or material that can explain it?

    Thanks

  • 08-13-2008 5:49 PM In reply to

    Re: Dexterity Lookup Form

    Can san Script use Local Variables or only Global?

  • 08-14-2008 2:03 AM In reply to

    Re: Dexterity Lookup Form

    Hi David

    The way a find field works on a lookup is as follows.

    Based on the current Sort By (ie. table index) being used, you need to populate the key field in the table buffer with the value from the window's find field.

    Then issue a get table <table> by number <index number>.

    This will do a find by example query and get the closest result. There is no need to check the err() result.

    Finally, issue a fill window from current by number <index number> to redisplay the scrolling window with the found record at the top.

    That's all folks.


    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

    Tags:
  • 08-14-2008 2:15 AM In reply to

    Re: Dexterity Lookup Form

    Hello again David

    I just want to clarify some terminology, at least from a Dexterity perspective.

    Fields exist on window contained in forms. Fields can be defined globally for a entire dictionary or locally on a form. Local fields cannot be stored in tables and are prefixed with '(L) ' when used on a window.

    Variables exist only in scripts. Variables can be defined locally in a script, passed in or out (or inout) as paramters or defined as global or system variables. Global variables are addressed with the of globals suffix. Common ones are 'User ID' of globals, 'Company ID' of globals and 'Intercompany ID' of globals.

    To answer your question. sanScript can use local and global fields on a window as well as local, parameter and global variables.

    If you are having issues addressing local fields, make sure you have the field surrounded by single quotes and have the (L) prefix. Better still use the Names button from the script editor. Find the field in question and double click on it (or single click and click OK). Then you can use Ctrl-V (Edit >> Paste) to add the name to your script.

    Did you get a chance to look at my blog posting:

    http://blogs.msdn.com/developingfordynamicsgp/archive/2008/08/11/how-to-get-started-with-dexterity.aspx

    David

    PS: Are you posting the same questions in multiple locations? I am seeing this on two discussion groups.

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

     

    Tags:
  • 08-14-2008 2:28 PM In reply to

    Re: Dexterity Lookup Form

    In the Inventory - Item - Item Maintenance , I changed "Generic Description" to "Manufacture" and I wish to have a lookup window like for Item class, to select Manufacture (I wish that Generic Description will display the manufacture name).

    So I created a lookup form, as shown in the documentation, but I can't understand from what you write, how to do the search in the list.

    Also I would like the list to be unique. It would help if you can give a more detailed script example

     Thanks

  • 08-14-2008 5:51 PM In reply to

    Re: Dexterity Lookup Form

    David

    If you are using the IV_Item_MSTR table for your lookup on the 'Generic Description' field, it will contain every record in the table.  That means that the same Manufacturer will be listed multiple times.

    To create a unique list of Manufacturers will require you to create a new table with a Manufacturer Setup window and a lookup window.  You could then use this lookup table to select Manufacturer to populate the 'Generic Description' field and also validate (and offer on-the-fly adding) when the field is typed in by hand.

    So, while I love Dexterity and am happy to help customise, I must ask why don't you just use one of the six user defined catergories that comes with Inventory and supports exactly what you are asking for. 

    Remember, any customisation that you add will need to be maintained for the life of the system.

    Finally to answer your question, here is an example bit of "find" code.

    set 'Customer Number' of table RM_Customer_MSTR to '(L) Find String';
    get table RM_Customer_MSTR by number 1;

    fill window MBS_Template_Lookup_Scroll from current by number 1;
    focus 'Customer Number' of window MBS_Template_Lookup_Scroll; 

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

  • 08-14-2008 6:02 PM In reply to

    Re: Dexterity Lookup Form

    Ok, I would be happy to use the existing MANUFACTURE from Item Class.

    How would you recommend I do it, I wish to see the Manufacture in the place of the Generic Description?

     

    Thanks

  • 08-15-2008 10:03 AM In reply to

    Re: Dexterity Lookup Form

    Hey, It works :-)

     

    Thanks

  • 08-17-2008 7:06 PM In reply to

    Re: Dexterity Lookup Form

    Great News David.

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

     

  • 08-18-2008 11:37 AM In reply to

    Re: Dexterity Lookup Form

    Ok, so it works, but its showing duplicates

    So I was thinking to use IV_User_Categories_Lookup to select manufacture from.

    How do I open this form? when I use:

    open form .... return to ....

    it opens the form but doesnt display any data

     

    Thanks

  • 08-18-2008 5:44 PM In reply to

    Re: Dexterity Lookup Form

    here is my script, still showing no data:

     open form IV_User_Categories_Lookup return to 'Item Generic Description';
    set 'User Category Descriptions'[1] of window IV_User_Categories_Lookup of form IV_User_Categories_Lookup to "MANUFACTURE";
    run script 'Redisplay Button' of window IV_User_Categories_Lookup of form IV_User_Categories_Lookup;
     

    Thanks

  • 08-18-2008 7:06 PM In reply to

    Re: Dexterity Lookup Form

    The following is from the Lookup.doc in the Software Development Kit (SDK).   The SDK can be installed from the Tools folder of CD 2 of the install CDs.

    IV_User_Categories_Lookup

    Script call:
    open form IV_User_Categories_Lookup return to  USER_CATEGORY_FIELD;
    set '(L) Number Check' of window IV_User_Categories_Lookp
     of form IV_User_Categories_Lookup to ARRAY_INDEX;
    set 'User Category Descriptions'[1]
     of window IV_User_Categories_Lookup
     of form IV_User_Categories_Lookup
     to USER_CATEGORY_DESCRIP_FIELD;
    set 'User Category Value' of window IV_User_Categories_Lookup
     of form IV_User_Categories_Lookup to  USER_CATEGORY_VALUE_FIELD;
    run script 'Redisplay Button' of window IV_User_Categories_Lookup
     of form IV_User_Categories_Lookup;

    Description:
    USER_CATEGORY_FIELD is the field on your form that should accept the return value.

    In lines two through four of the script, ARRAY_INDEX is the index of the 'User Category Values' field that you want to lookup for.

    In the third line of the script, USER_CATEGORY_DESCRIP_FIELD is the value you wish to set for the ‘User Category Description’ field.The "fill from current" statement is then used to fill the scrolling window and focus to the line that matches that key value.

    In the fourth line of the script, USER_CATEGORY_VALUE_FIELD is the value you wish to set for the ‘User Category Value’ field.The "fill from current" statement is then used to fill the scrolling window and focus to the line that matches that key value.
     

    David Musgrave [MSFT]
    Escalation Engineer - Microsoft Dynamics GP
    Microsoft Dynamics Support - Asia Pacific

    Microsoft Dynamics (formerly Microsoft Business Solutions)
    http://www.microsoft.com/Dynamics

    mailto:David.Musgrave@online.microsoft.com
    http://blogs.msdn.com/DevelopingForDynamicsGP

    Any views contained within are my personal views and not necessarily Microsoft policy.
    This posting is provided "AS IS" with no warranties, and confers no rights. 

    Tags: ,
  • 08-18-2008 8:29 PM In reply to

    Re: Dexterity Lookup Form

    Thank you

Page 1 of 1 (13 items)