I put this code in form
OnAfterGetRecord
IF "No."<> xRec."No." THEN CurrForm.EDITABLE(FALSE);
I create new button "Edit" ](*,)
OnPush:
IF CurrForm.EDITABLE(TRUE) THEN MESSAGE('Your'in edition mode');
When i push that button.. form is editable..but subform still not
Anybody know this problem??
0
Comments
you need a funtion in the subform too, and you have to call them:
OnAfterGetRecord
IF "No."<> xRec."No." THEN CurrForm.EDITABLE(FALSE);
SubForm.DoEditable();
DoEditable
CurrForm.EDITABLE(FALSE);
br
Josef Metz
Josef Metz
1.CurrForm.Editable(FALSE) = form with subforms is set to uneditable
in this logic
2.CurrForm.Editable(true) = form with subforms is set to editable
but second didn't works
This works fine. Form is uneditable
Code in button don't work
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I already try it "currform.update(false)". Nothing helps.
When i put on form one subform user, after push "Edit" button sometimes must click subform,form,subform and then subform is editable.
When i put 2 subform on my form.. problem is bigger. second subform sometimes is non editable, no matter if he click few times everywhere
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Belive me , I try thif functions everywhere Update,Activate,Editable
I stuck on this from yesteday ](*,)
OnAfterGetRecord,OnPush - "edit" button" (currform and subforms),OnActivate,Deactivate subform
Nothing helps.. :-s
I had this same thing on a form with multiple subforms.
It reacts very wierd when moving between records ! C/Side code is correct.
But it seems onces disabled (this happens when you scroll to a record via < and > icons to one thas has a status that would disable the subform) the subform remains disabled until you scroll by a record that has data in the subform.
Only then the subform would enable again and show the data (when the editable flag was set to true ofcourse).
I also tried the currform.update(false) in form and subform etc... no effect.
Even if you scroll back from the record B where the subform was uneditable to record A where the subform initialy was editable, the subform remains uneditable.
I solved my problem by instead of using the editable propertie on the subform and try to set that true or false according to the content of a field, I used the Enabled properties of the controls in the grid of the subform.
The effect for the enduser is the same, he cannot edit data or click inside the grid. And when I switch from record to record the fields are now correcty enabled or disabled according to the status of the toplevel record.
Weird problem, but this is my workarround ! #-o
Danny
I don't know why but I've noted that sometimes it depends on what you've set as starting value of Editable property.
Set Editable to Yes, save the form, check if works. Do the same for subform.
Regards,
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03