Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

make a page in view mode to edit mode using code

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I created a page which is linked to an action of an another  page.  for eg : consider 'A ' and 'B ' as 2 pages. Page 'B' get opened as part of a button(action) click of page ' A'  , a blank page

Intially 'B ' is a blank page with all its fields in non ediatble mode. Many actions is linked to this page.  Data get created on this page as part of various actions. 

My issue is that  among various fields one field is a checkbox . when i enable the checkbox , i want to make another field in edit mode using programing method(codes).

I tried many methods for this. But i failed.....plz help.plz give support.

How to make a page in view mode to edit mode by using C/Side in Navision RTC 2009.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: make a page in view mode to edit mode using code

    Dear All,

    Thanks to all for this support . But  this solution didn't solve my issue. 

    Suppose page 'A' be a released Work Order  and the  page B is  linked to the page's current Work Order. The use of page B is to create some records realated to its  corresponding Work Order. There are many methods for creating the records in  page B.

    So initially page 'B ' is blank(no data in page and in its table related to this Work order). This page is in the form of  header and lines and the header conatins 3 fields and among them one field is a checkbox  All the fields in header are in non editable mode except the checkbox. 

    when i put a tick in the checkbox ,  i want to make another field in editable mode without pressing new button(ctrl+l). 

     

    I know how to set a field in editable  mode or non ediatble mode using a global variable and code. I already set for this field.

    If I  press new button (ctrl+N) first and  later  if I am enabling the checkbox , the other field is get changed to editable mode. 

    I want to know How to make a page in new mode or view mode using C/AL code?  Plz help. plz..........

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,878 on at
    RE: make a page in view mode to edit mode using code

    After page is opened i don't think there is a way to make the page editable from non-editable, you have to add the code in OnINit or OnOpenPage trigger of the page or you can use page variable and and set the editable before you open it.

    Example:
    
    SalesHeader.SETRANGE("No.","Sales Order No.");
    SalesOrder.SETTABLEVIEW(SalesHeader);
    // Add other condition here and if satisfy then
    SalesOrder.EDITABLE := FALSE;
    SalesOrder.RUN;


  • Suggested answer
    jcastro Profile Picture
    jcastro 2,245 on at
    RE: make a page in view mode to edit mode using code

    I think the easiest way to accomplish this would be to work with page B being editable from the start, but play with the property "DelayedInsert" of Page B instead. You might get a similar result in a way simpler way.

    You can check more info regarding DelayedInsert here: msdn.microsoft.com/.../dd301257(v=nav.80).aspx

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: make a page in view mode to edit mode using code

    Hi,

    Suppose you have a two fields on the form that is in non-editable mode. And you have a check box, if you click on that check box then these two fields should be in editable mode. For doing this, write the code on OnPush Trigger of check box like this...

    If check box = true then begin

    CurrForm.field1.visible(true);

    CurrForm.field1.editable(true); 

    CurrForm.field2.visible(true);

    CurrForm.field2.editable(true); 

    CurrForm.UPDATECONTROLS;

    end;

    This is just for help. This is not a complete code. According to your code you can use it in c/al. 

    Thanks

    Niraj Kumar

    http://niraj-msnav.blogspot.com

    http://nirajdynamicsnav.wordpress.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans