Editable = No not working :?:
tompynation
Member Posts: 398
I have a subform based on the folowing table:
Enabled Field No. Field Name Data Type Length Description
Yes 1 ID Integer
Yes 2 FabricatieID Integer
Yes 3 Fabricatienr Integer
Yes 4 Item Code 20
Yes 5 Hoeveelheid Decimal
Yes 6 Type Text 1
Yes 7 Verwerkt Boolean
Yes 8 Omschrijving Text 50
The property Editable of the field Item has been placed to No inside the table
And on the subform i've placed the Editable to No for the column Item
In the table there is following code for the Item field:
Item - OnValidate()
lv_Item.GET(Item);
Omschrijving := lv_Item.Description;
MODIFY;
In the Subform there is the following code for the Item column:
Item - OnLookup(VAR Text : Text[1024];) : Boolean
lv_Item.RESET;
IF gv_CatFilter <> '' THEN BEGIN
IF (gv_CatFilter = 'F') OR (gv_CatFilter = 'V') THEN
lv_Item.SETFILTER(lv_Item."Item Category Code",'%1',gv_CatFilter)
ELSE IF gv_CatFilter = 'A' THEN
lv_Item.SETFILTER(lv_Item."Item Category Code",'%1|%2|%3',gv_CatFilter,'L','S');
IF FORM.RUNMODAL(31,lv_Item) = ACTION::LookupOK THEN BEGIN
Item := lv_Item."No.";
Omschrijving := lv_Item.Description;
END;
END;
Now, how come that i can still change the field Item throug the subform when i've placed the Field as Editable = No in table and Subform?
I can olny change it through the lookup functionallity in the subform
Enabled Field No. Field Name Data Type Length Description
Yes 1 ID Integer
Yes 2 FabricatieID Integer
Yes 3 Fabricatienr Integer
Yes 4 Item Code 20
Yes 5 Hoeveelheid Decimal
Yes 6 Type Text 1
Yes 7 Verwerkt Boolean
Yes 8 Omschrijving Text 50
The property Editable of the field Item has been placed to No inside the table
And on the subform i've placed the Editable to No for the column Item
In the table there is following code for the Item field:
Item - OnValidate()
lv_Item.GET(Item);
Omschrijving := lv_Item.Description;
MODIFY;
In the Subform there is the following code for the Item column:
Item - OnLookup(VAR Text : Text[1024];) : Boolean
lv_Item.RESET;
IF gv_CatFilter <> '' THEN BEGIN
IF (gv_CatFilter = 'F') OR (gv_CatFilter = 'V') THEN
lv_Item.SETFILTER(lv_Item."Item Category Code",'%1',gv_CatFilter)
ELSE IF gv_CatFilter = 'A' THEN
lv_Item.SETFILTER(lv_Item."Item Category Code",'%1|%2|%3',gv_CatFilter,'L','S');
IF FORM.RUNMODAL(31,lv_Item) = ACTION::LookupOK THEN BEGIN
Item := lv_Item."No.";
Omschrijving := lv_Item.Description;
END;
END;
Now, how come that i can still change the field Item throug the subform when i've placed the Field as Editable = No in table and Subform?
I can olny change it through the lookup functionallity in the subform
0
Answers
-
Not editable means not editable for users. You can still edit the field via code."Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Hi tompynation,
U said : I can olny change it through the lookup functionallity in the subform : so u have the risponse.
Editable = No in the field (of the table) and Editable=No in the subform control : that mean u can't modify manually this field (try to tape something on the field : u can't....)
But using the lookup action, u have a code telling the system to take the value of the field "No." from table Iv_Item and assign it on ur record.
IF FORM.RUNMODAL(31,lv_Item) = ACTION::LookupOK THEN BEGIN
Item := lv_Item."No.";
Omschrijving := lv_Item.Description;
END;
END;
with ur code, u shoud have the item N° changed and also the description.. ? I m right ?
Try to comment this 4 lines
//IF FORM.RUNMODAL(31,lv_Item) = ACTION::LookupOK THEN BEGIN
//Item := lv_Item."No.";
//Omschrijving := lv_Item.Description;
//END;HKAMEL0 -
yes, but the lookup shouldnt be working anymore after i inserted the record...
So that you cannot change the Item field, so if you choose the wrong Item,
You should delete this line, and create a new line with the correct item...0 -
Item - OnLookup(VAR Text : Text[1024] : Boolean
IF Item = '' THEN BEGIN lv_Item.RESET; IF gv_CatFilter <> '' THEN BEGIN IF (gv_CatFilter = 'F') OR (gv_CatFilter = 'V') THEN lv_Item.SETFILTER(lv_Item."Item Category Code",'%1',gv_CatFilter) ELSE IF gv_CatFilter = 'A' THEN lv_Item.SETFILTER(lv_Item."Item Category Code",'%1|%2|%3',gv_CatFilter,'L','S'); IF FORM.RUNMODAL(31,lv_Item) = ACTION::LookupOK THEN BEGIN Item := lv_Item."No."; Omschrijving := lv_Item.Description; END; END; END;"Money is likewise the greatest chance and the greatest scourge of mankind."0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions