Options

How to Change Customer Card Page in Runtime

ravishahravishah Member Posts: 13
edited 2012-01-18 in NAV Three Tier
Hi All

I want to Put the Customer Card Page Editable as the User Rights. I Put the Editable "False" on the OnOpen Trigger of the Page.
Then I Create the Menu Button and After Press the Menu Button System Check Whether User has Permission or Not, If the User has Permission the Page Will be in Editable Mode Otherwise display the Error. I Made this Functionality for Classic Customer Card Form It's Working Fine bur in RTC It's not Working...Please Help me..

Comments

  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    Welcome to Mibuso :)

    Did you try by transforming the form using transformation tool or manually transforming?

    can you show us the logic and code written in page?
  • Options
    deV.chdeV.ch Member Posts: 543
    You can't change the Editable and the Visible Property on the fly while the page is running you can only set them up at the start (OnOpenPage).

    Maybe it's a solution for you to set the editable property based on the user setup while opening the page.


    EDIT: sorry i thought about it again, this is wrong! this only applies to the visible property!
    If you use a boolean variable with InDataSet = True and set that boolean on an action to True then your field will be enabled on the fly
  • Options
    thmartinthmartin Member Posts: 90
    I think you cannot control the Editable property of the page from code after the OnOpenPager trigger is run.
    This might be because that conflicts with the RunFormMode settings of the page.
    However you can instead (as said in the previous post) control the Editable property of the various FastTabs or individual fields.
    Thomas Martin
    NAV Developer
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    No..it is possible to contrl the editable property..

    check contact card and change the Type to person to company and company to person..you will get an idea..
  • Options
    deV.chdeV.ch Member Posts: 543
    Hmmm are we all talking about the same thing? i was talking about editable property of a Control (TextBox, FastTab,... ) not the entire page...
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    Yeah..I am talking about the fields editable property only..
    As I mentioned above..in contact card..if you selct Type= Person...Company No. field editable is set to true at run time..
    If you select type = company...company no. is editable is set to false..
  • Options
    SogSog Member Posts: 1,023
    yeah, but TS is talking about the entire page...
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    mohana_cse06mohana_cse06 Member Posts: 5,503
    Then the alrenate solution is make a boolean in Usersetup and write the code in OnOpenForm
    IF UserSetup.GET(USERID) THEN
      CurrForm.EDITABLE := UserSetup."User May Change Customer";
    

    rather than creating a menu button..
  • Options
    SogSog Member Posts: 1,023
    and to think that by only editing the permissions on the customer table of those users the same can be achieved.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    ravishahravishah Member Posts: 13
    Thank You so much to all for your Suggestion....
    Actually I want to Editable Whole page during Runtime...I Write Code "Currpage.EDITABLE := FALSE;" on onopen Trigger..and after that I write Code on OnAction Trigger of my Menu Button For User Right....This Functionality Works Perfect in Classic and I also try to Transform the Form through Transformation Tool but Atfet Transform the RTC page is not Working...
  • Options
    TejaswiniTejaswini Member Posts: 75
    Can any one please explain me the meaning of "on the fly"
  • Options
    archer89archer89 Member Posts: 337
    on the fly means in that context: at runtime. not when developing/changing the page.

    that issue is solved by declaring a global variable e.g. PageEditable (type boolean). Set that variable as value to Page property Editable (or visible). that variable can be changed during runtime. so write needed code into page trigger onopenpage, e.g. PageEditable := User.HasTheRightToEdit, where HasTheRightToEdit is a new field in table user.

    Also possible: work with page property permission or change the permission sets for that issue.
    follow https://msdynamicsnavashwinitripathi.wordpress.com/2015/08/05/accessbypermission-property-in-navision-2015/
    best regards
    Franz Kalchmair, MVP
    Alias: Jonathan Archer

    please like / agree / verify my answer, if it was helpful for you. thx.
    Blog: http://moxie4nav.wordpress.com/
Sign In or Register to comment.