Change Editable Property of Page on Condition

postsauravpostsaurav Posts: 516Member
edited 2012-07-04 in NAV Three Tier
Hi all,

I had a simple query, i want to know is it possible in NAV 2009 SP1 to Change Editable Property of Page during Run Time Based on a field.

Example -
If Status is Released of a sales order the Sales Header Form should be Un-EDITABLE but if the status is OPEN the Sales Header should be Editable.

Let me know if there is any way to do it.
Thanks & Regards,
Saurav Dhyani

http://saurav-nav.blogspot.in

Answers

  • Jatin_PatelJatin_Patel Posts: 200Member
    Use CurrPage.EDITABLE(FALSE);

    Pass Boolean argument according to your requirement.
    Jatin Patel
    Microsoft Dynamics NAV Consultant
    Jatin's Blog
  • vijay_gvijay_g Posts: 891Member
    Use CurrPage.EDITABLE(FALSE);

    Pass Boolean argument according to your requirement.

    Have you checked it?
    Vijay Gupta
    Changing the code is last step. Try to change processes first...
  • postsauravpostsaurav Posts: 516Member
    Hi Jatin,

    No it dosen't work. I already tried this before posting the post.
    Thanks & Regards,
    Saurav Dhyani

    http://saurav-nav.blogspot.in
  • postsauravpostsaurav Posts: 516Member
    Hi all,

    Is there any way that it is possible ?
    Thanks & Regards,
    Saurav Dhyani

    http://saurav-nav.blogspot.in
  • mohana_cse06mohana_cse06 Posts: 4,851Member
    I didnt test this solution perfectly so please test it before implementing.

    Create a Global Boolean Variable ex: StatusEditable
    Set IncludeInDataset property of variable to Yes
    Select Page Tabs ex: General
    Set Editable property of tab to StatusEditable
    write below code in OnOpenGetRecord trigger of Page
    StatusEditable := Status = Status::Open;
    
  • udayrmerudayrmer Posts: 171Member
    Hi

    Please try it to handle in following way.

    1) assign value of your control value to a Boolean variable
    2) set all the page controls' ( Text boxes) Editable property to this Boolean variable
    3) use CurrPage.UPDATE on your control variable's OnValidate
    Uday Mer | MS Dynamics NAV Techno-Functional Consultant
  • postsauravpostsaurav Posts: 516Member
    I didnt test this solution perfectly so please test it before implementing.

    Create a Global Boolean Variable ex: StatusEditable
    Set IncludeInDataset property of variable to Yes
    Select Page Tabs ex: General
    Set Editable property of tab to StatusEditable
    write below code in OnOpenGetRecord trigger of Page
    StatusEditable := Status = Status::Open;
    

    Hi Mohan,
    I already tried that but the problem in this solution is that -
    If we make tab un-editable only the first tab can be seen other tabs comes as collapsed.

    So client will not get agree on same.
    Thanks & Regards,
    Saurav Dhyani

    http://saurav-nav.blogspot.in
  • postsauravpostsaurav Posts: 516Member
    udayrmer wrote:
    Hi

    Please try it to handle in following way.

    1) assign value of your control value to a Boolean variable
    2) set all the page controls' ( Text boxes) Editable property to this Boolean variable
    3) use CurrPage.UPDATE on your control variable's OnValidate

    Hi udayrmer,

    Is this the only solution?
    I know it will work great but as i already added in the post that the form is Sales Header, that means there will be 60 -100 fields in sales header Page. Adding that property on all these fields i don't think that is a appropriate solution.
    And what about use will add a new field to the form he had to add the code everytime.
    Thanks & Regards,
    Saurav Dhyani

    http://saurav-nav.blogspot.in
  • mohana_cse06mohana_cse06 Posts: 4,851Member
    postsaurav wrote:
    So client will not get agree on same.
    postsaurav wrote:
    I know it will work great but as i already added in the post that the form is Sales Header, that means there will be 60 -100 fields in sales header Page. Adding that property on all these fields i don't think that is a appropriate solution.
    And what about use will add a new field to the form he had to add the code everytime.

    You or your client have to adjust some where..
  • mohana_cse06mohana_cse06 Posts: 4,851Member
    postsaurav wrote:
    Hi Mohan,
    I already tried that but the problem in this solution is that -
    If we make tab un-editable only the first tab can be seen other tabs comes as collapsed.
    I tried it again and the Invoicing and shipping tabs are not collapsed :-k
Sign In or Register to comment.