Need a help, in a linkin' in a form...

BeckaBecka Member Posts: 178
Hi all! :mrgreen:

I have a problem, i need to link a control value to another table.. but my form has no source table, and i don't need source table.. I need to link the control of a form to another table.. if any ideas just help..

thanks to all! :mrgreen:
MCSD
Attain Navision

Answers

  • tinoruijstinoruijs Member Posts: 1,226
    Do you mean:
    Add global recItem, record Item.
    In OnOpenForm: recItem.GET(ItemNo);
    In SourceExpr control: recItem.Description

    Or else can you give an example of what you are trying to achieve?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • BeckaBecka Member Posts: 178
    okay.. I've a form, which has no source table, and i need to add a control, that will linked to another table.. To say in other words, i need a control with selectable function, but not an option type...
    MCSD
    Attain Navision
  • jonsan21jonsan21 Member Posts: 118
    I believe you came from .NET programming background, yes? I did a customization for a customer before, to make a Navision form similar to a web form.

    What you need to do:

    1. Have a global variable, called aText for code 20, and a global variable called Item as record Item
    2. create the text box on your unbound form
    3. set the SourceExpr property of the text box to the global variable
    4. at the OnLookup trigger of the textbox write
    IF FORM.RUNMODAL(FORM::"Item List",Item) = ACTION::LookupOK THEN
      aText := Item."No.";
    
    5. now you have an unbound form, with a textbox, with a selection from the Item table, returning the Item No.
    6. the next step is to to some validation, but that is out of scope :p

    Rgds,

    Jon.
    Rgds,

    Jon.
  • BeckaBecka Member Posts: 178
    That's it maan.. Thanks a lot :)
    MCSD
    Attain Navision
Sign In or Register to comment.