Editable Field in an non editable page

Mathan
Member Posts: 55
Hi everyone,
I have taken the sales order page 42. Such that when the status is 'Open' every field should be editable. And when the Status is 'Released', then all the fields should be Non-editable except that Posting Date and Order Date should be Editable. However, I am unable to get the editable field for the non-editable condition of the page. As even the editable field appears to be Non-editable.
I have gone through various old post for forms and i came up to this.
I have created a boolean variable and declared it false on the OnOpenPage trigger
fieldeditable:=FALSE;
I have set the editable property of the Dates as fieldeditable.
This is the Condition:
IF CurrPage.EDITABLE(Status = Status::Open) THEN BEGIN
CurrPage.EDITABLE(TRUE);
fieldeditable:=TRUE;
CurrPage.UPDATE();
END
ELSE BEGIN
IF CurrPage.EDITABLE(Status = Status::Released)
THEN BEGIN fieldeditable:=TRUE;
CurrPage.EDITABLE(FALSE);
CurrPage.UPDATE();
END
END
Could someone throw a light on where i am going wrong...?
Thank you.
I have taken the sales order page 42. Such that when the status is 'Open' every field should be editable. And when the Status is 'Released', then all the fields should be Non-editable except that Posting Date and Order Date should be Editable. However, I am unable to get the editable field for the non-editable condition of the page. As even the editable field appears to be Non-editable.
I have gone through various old post for forms and i came up to this.
I have created a boolean variable and declared it false on the OnOpenPage trigger
fieldeditable:=FALSE;
I have set the editable property of the Dates as fieldeditable.
This is the Condition:
IF CurrPage.EDITABLE(Status = Status::Open) THEN BEGIN
CurrPage.EDITABLE(TRUE);
fieldeditable:=TRUE;
CurrPage.UPDATE();
END
ELSE BEGIN
IF CurrPage.EDITABLE(Status = Status::Released)
THEN BEGIN fieldeditable:=TRUE;
CurrPage.EDITABLE(FALSE);
CurrPage.UPDATE();
END
END
Could someone throw a light on where i am going wrong...?
Thank you.
0
Best Answers
-
you need to use only variable and add that variable to all fields of page.5
-
fieldeditable := True;
if status = Status::Released then
fieldeditable := False;
add fieldeditable to all fields except 25 -
Could be simplified even further
...
fieldeditable := (Status = Status::Open);
Also, you need to make sure that you have set the IncludeInDataSet property to Yes on the fieldeditable variable and then set the Editable property to fieldeditable (on all fields except the 2 date fields - as stated by Mohana)
5
Answers
-
you need to use only variable and add that variable to all fields of page.5
-
fieldeditable := True;
if status = Status::Released then
fieldeditable := False;
add fieldeditable to all fields except 25 -
Thank you for your response Mohana. I will check out your advice and let you know.0
-
Could be simplified even further
...
fieldeditable := (Status = Status::Open);
Also, you need to make sure that you have set the IncludeInDataSet property to Yes on the fieldeditable variable and then set the Editable property to fieldeditable (on all fields except the 2 date fields - as stated by Mohana)
5 -
Thank you Mohana and Thank you Kishorm. I tried both your suggestions and it worked like a charm XD
. And in future, if some extra fields happen to get added to the page. Then for that too the property should be changed in the future right ? or is there happen to be any other way around ?
0 -
That's right, if you add any extra fields and you don't want them to be editable then you need to set the Editable property on those fields too0
-
Aww. Much obliged. That was insightful XD.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions