Can We Insert Control in Page Via Code ?

Purvesh_MaisuriaPurvesh_Maisuria Member Posts: 71
Hello Experts,

I Want to Add Some Controls in Page via Code. Is It Possible ???

For Example :
In Page : Company Information, I Want To Add Control Primary Key. See Image Before Add Control.

See Image After Control Add.


After Add This Control, I Want that Controls Visible & Editable Property Set To 'False'.

Is It Possible ???

Hope Possible & Experts Gives Me The Real Path As Soon As Possible.


Thanks & Regards,
Purvesh Maisuria.
1.jpg 92.7K
2.jpg 29.2K

Comments

  • BeliasBelias Member Posts: 2,998
    edited 2011-02-09
    1st. Why do you want to add the primary key field to the company information page? it is useless.
    2nd. it's not possible, but you can add all the controls by design, and then manage their visibile and editable properties by code with boolean variables (search "includeindataset" in mibuso)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Purvesh_MaisuriaPurvesh_Maisuria Member Posts: 71
    Hello Belias & Everyone,

    Actually I have to implement that functionality, i am not want to do that for particularly 'Company Information' page, i just take example of it. But i really want to do that functionality dynamically. Hope Some one have solution & give the path to reach the destination.

    By The Way Thanks To Reply, Hope U Solve my Queries in Future.

    Thanks & Regards,
    Purvesh Maisuria.
  • BeliasBelias Member Posts: 2,998
    2nd. it's not possible, but you can add all the controls by design, and then manage their visibile and editable properties by code with boolean variables (search "includeindataset" in mibuso)
    this is the only way
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • kinekine Member Posts: 12,562
    All depends on what you really need... e.g. you can use addin for this, but again, it depends...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Purvesh_MaisuriaPurvesh_Maisuria Member Posts: 71
    Hello Kine,

    I want to do like this,

    1. Page have table behind it.
    2. That table have primary key. In my case i use only first primary key. No matter if more than 1 field are there in primary Key.
    3. In this page i want to add those all control which comes in primary key with visible & enable=false.

    I search lots of thind but i m not able to get fruitful.

    For doing this which addin i have to use.

    Thanks & Regards,
    Purvesh Maisuria.
  • kinekine Member Posts: 12,562
    1) That table have primary key. In my case i use only first primary key. No matter if more than 1 field are there in primary Key.
    First primary key? There is only one each time... or do you mean "First primary key field"? What do you mean with "I use"?
    3. In this page i want to add those all control which comes in primary key with visible & enable=false.
    What do you mean with "al control which comes in primary key"? I do not understand what you want to do...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Purvesh_MaisuriaPurvesh_Maisuria Member Posts: 71
    Hello kine,

    Suppose i take purchase order page as example,

    behind purchase order page, purchase header table is there. now purchase header table have multiple key, see image

    now i this key listing, i have to use first one, i don't want other in my functionality.
    first key i have already get from code.
    now i want to add controls in purchase order page which are <No.> & <Document Type> which are in first key.

    but <No.> is already there, so only i have to insert <Document Type> in purchase order page,
    Now my question is, how can i put <Document Type> field in purchase order page dynamically.

    I have all thing, Ex. Purchase order page --> which have purchase header table --> which first key is "Document Type,No." , this are taken from code.

    For doing this which addin i have to use.

    Thanks & Regards,
    Purvesh Maisuria.
    1.jpg 18.7K
    2.jpg 27.2K
  • kinekine Member Posts: 12,562
    And why you need to do that dynamically? Just add the field you need on the page in design and you are done? What you are trying to solve for so long time?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Purvesh_MaisuriaPurvesh_Maisuria Member Posts: 71
    Hello Kine,

    I have to do this in all pages, i did that manual in one database, its around 1800-1900 pages are there, if i want to do this for different country's version than its too much time, so i want to do this dynamically.

    Thanks & Regards,
    Purvesh Maisuria.
  • kinekine Member Posts: 12,562
    But still, I didn't catch the "why" you are doing that and why someone will pay for that? For me there is something wrong if you need to do something like that...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.