Run a page with RunFormMode=Create from Code

AlishaAlisha Member Posts: 217
edited 2010-11-22 in NAV Three Tier
Is it possible to do this? I want to run a page from another page, to create a new record, and I need to pre-populate some fields. The only way I can run the page using this mode is using the properties and links, but this doesn't allow me to populate the fields I want, if I try to run it by code, I can't access this property and the page always runs on Edit mode!!

How can I solve this?

Comments

  • deV.chdeV.ch Member Posts: 543
    I had the same issue, i (partial) solved it with sendkeys. i did something like this:
    --OnOpenPage()
    IF ChangePageMode <> 0 THEN BEGIN
      MyCodeunit.SendKeyChangePageMode(ChangePageMode);
    END
    

    ChangePageMode is set by a function on the page.
    Known issues of this:
    - SendKeys itself...
    - You get two open pages, one in the Edit Mode & one in the New Mode

    I tired it with an ERROR(''); to close the Eidit Mode Page but it doesn't work...

    If someone has another solution, i would be very interested.
Sign In or Register to comment.