Dataport and Request Form

SYLV1GSYLV1G Member Posts: 93
Hello

If i add a new control on the request form of a dataport the default controls Filename and Direction are not visible any more.

How can i do to show this controls again ?

Thanks in advance

Comments

  • Revolution1210Revolution1210 Member Posts: 161
    You need to add your own browse box if you modify the request form.

    This is easily done using a text box and calls to the Common Dialog Management codeunit (412).
    Ian

    www.NextEqualZero.com
    A technical eye on Dynamics NAV
  • SYLV1GSYLV1G Member Posts: 93
    Ok thank you !
  • cmuellercmueller Member Posts: 12
    You can find the solution for this problem at the german-speaking site

    http://www.navision24.de/tutorials/request-form-eines-dataports-selbst-gestalten.html
    (Thanks Mark Teuber for the trick)

    - create two new global variables ("Filename” / „Import” )

    - open the request form

    - insert a textbox (Property ID = 1 / AssistEdit = Yes / SourceExpr = Filename / Label for textbox ParentControl = 1

    - insert a radiobutton Import (SourceExpr = Import / OptionValue = True

    - insert a radiobutton Export (SourceExpr = Import / OptionValue = False

    - insert on the OnPreDataport-Trigger this code
    CurrDataport.IMPORT(Import);
    CurrDataport.FILENAME(Filename);


    Regards
    Christian
  • TheOrbTheOrb Member Posts: 8
    Hello,

    I knew about the <filename> controls needed to be designated as control n° 1 and it works but I can't manage to get the import/export radio changing dynamically the behaviour of dataport property, thus making impossible to use the filename dialog box for either an import or an export. Can you tell me if something is missing??
    Sorry to ask but I can't read German...
    Be blessed for your answer [-o<

    Best Regards

    Denis
  • NagiNagi Member Posts: 151
    Hi,

    Adding to what cmueller wrote earlier. To dynamically control import/export of a dataport, have a global variable (you could call it "Direction") declared as an option with the values "import" and "export". In the radiobuttons' properties you set their correct option value. Then, in your C/AL code, test to see which value has been selected by the end user and then set the import function accordingly.
    IF Direction = Direction::Import THEN
      CurrDataport.IMPORT(TRUE)
    ELSE
      CurrDataport.IMPORT(FALSE);
    

    As cmueller already wrote, this code should be in your OnPreDataport-Trigger.

    I hope this solves your problem.

    Cheers!
Sign In or Register to comment.