Request Form in a dataport

RachelSoonRachelSoon Member Posts: 202
edited 2004-07-01 in Navision Attain
Hi All,
As you all know, when we run a dataport, a option tab with the file name and direction will be available for user to locate the import or export file path.

However, these will not be availble at the option tab when there is a control is added to the request form. The file name and direction are not available, the option tab only show the newly added control.

How can i add more control to the request form and maintain the original file name and direction?

Comments

  • AfonsoAfonso Member Posts: 27
    Hello,

    You have to crate a global variable of text type and on the assist edit trigger you write the next code:

    Janela.ShowOpen;
    IF Janela.FileName <> '' THEN Filename := Janela.FileName;

    Janela is a variable:

    Name DataType Subtype Length
    Janela OCX COMMON DIALOGS CONTROL

    then on the Initdataport trigger you write the code:

    CurrDataport.FILENAME(Filename);


    Regards

    Afonso
  • Tommy_SchouTommy_Schou Member Posts: 117
    Hi!

    To enable file-lookup in a dataport where you have put fields on the request-form you have to do the following.

    Create a variable to hold your filename.

    Put a textbox with accompanying label on the request form. In the properties of the textbox containing your filename you should set ID to 1 and assistedit to yes. Put your variable in the source-expression of the the textbox. Now when you run the dataport you will be able use F6 to look for your file.

    The trick is to have the textbox-id set to 1.
    Best regards
    Tommy
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • RachelSoonRachelSoon Member Posts: 202
    Hi Tommy and Afanso,
    Thank you so much for replying my question.
    I've tried it and it works!

    Thank you so much for helping
  • RachelSoonRachelSoon Member Posts: 202
    Hi Tommy,
    I am just wondering why the text box ID has to be 1? it only works for ID = 1. what is the relationship between the ID and the lookup?
  • Tommy_SchouTommy_Schou Member Posts: 117
    RachelSoon wrote:
    Hi Tommy,
    I am just wondering why the text box ID has to be 1? it only works for ID = 1. what is the relationship between the ID and the lookup?

    Nothing in particular that I know of other than the fact that navision on a dataport automatically creates a file-lookup on the field with ID=1. Probably just a hack that Navision created in the "old" days to accomodate the ability to create your own request-form.
    Best regards
    Tommy
  • DenSterDenSter Member Posts: 8,307
    RachelSoon wrote:
    Hi Tommy,
    I am just wondering why the text box ID has to be 1? it only works for ID = 1. what is the relationship between the ID and the lookup?

    Nothing in particular that I know of other than the fact that navision on a dataport automatically creates a file-lookup on the field with ID=1. Probably just a hack that Navision created in the "old" days to accomodate the ability to create your own request-form.
    I don't think this is a hack that Navision created, I think it was an unintended 'feature' that can be used in spite of Navision's efforts to shield that control from developers 8) .
  • Tommy_SchouTommy_Schou Member Posts: 117
    Hehe. true! That may very well be the case.. but we FOUND IT!! :twisted:
    Best regards
    Tommy
  • kinekine Member Posts: 12,562
    I don't found it, i learn it in my Application builder course... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Tommy_SchouTommy_Schou Member Posts: 117
    Course? What's that? :shock:
    Best regards
    Tommy
  • RachelSoonRachelSoon Member Posts: 202
    anyway folks, thanks a lot for helping.... :D
  • kinekine Member Posts: 12,562
    Course? What's that? :shock:

    Lessons... Class... Before I done my Application Builder exam for my Application builder licence, I have 5 day AB course (in time of Navision Financials...)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.