OBJECT Form 55555 TestForm { OBJECT-PROPERTIES { Date=08/05/09; Time=17.14.57; Modified=Yes; Version List=; } PROPERTIES { Width=13550; Height=6710; TableBoxID=1101339000; SourceTable=Table4; } CONTROLS { { 1101339000;TableBox;220 ;220 ;13110;5500 ;HorzGlue=Both; VertGlue=Both } { 1101339001;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr=Code } { 1101339002;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339001; InColumnHeading=Yes } { 1101339003;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr="Last Date Modified" } { 1101339004;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339003; InColumnHeading=Yes } { 1101339005;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr="Last Date Adjusted" } { 1101339006;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339005; InColumnHeading=Yes } { 1101339007;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr="Unrealized Gains Acc." } { 1101339008;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339007; InColumnHeading=Yes } { 1101339009;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr="Realized Gains Acc." } { 1101339010;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339009; InColumnHeading=Yes } { 1101339011;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr="Unrealized Losses Acc." } { 1101339012;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339011; InColumnHeading=Yes } { 1101339013;TextBox;0 ;0 ;1700 ;0 ;ParentControl=1101339000; InColumn=Yes; SourceExpr="Realized Losses Acc." } { 1101339014;Label ;0 ;0 ;0 ;0 ;ParentControl=1101339013; InColumnHeading=Yes } { 1101339015;CommandButton;6290;5940;2200;550; HorzGlue=Right; VertGlue=Bottom; Default=Yes; PushAction=LookupOK; InvalidActionAppearance=Hide } { 1101339016;CommandButton;8710;5940;2200;550; HorzGlue=Right; VertGlue=Bottom; Cancel=Yes; PushAction=LookupCancel; InvalidActionAppearance=Hide } { 1101339017;CommandButton;11130;5940;2200;550; HorzGlue=Right; VertGlue=Bottom; PushAction=FormHelp } { 1101339018;TextBox;220 ;5940 ;4730 ;440 ;Name=TextBox; HorzAlign=Right; SourceExpr='I am Hidden'; OnFormat=VAR MyCodeunit3@1101339000 : Codeunit 55555; BEGIN CurrForm.EDITABLE(MyCodeunit3.ShowModify(ISEMPTY,TRUE)); CurrForm.ButtonModify.VISIBLE(NOT ISEMPTY); CurrForm.ButtonShow.VISIBLE(ISEMPTY); CurrForm.TextBox.VISIBLE(FALSE); END; } { 1101339019;CommandButton;220;5940;2200;550;Name=ButtonShow; HorzGlue=Left; VertGlue=Bottom; CaptionML=ENU=Show; OnPush=VAR Mycodeunit1@1101339001 : Codeunit 55555; BEGIN CurrForm.EDITABLE(Mycodeunit1.ShowModify(ISEMPTY,CurrForm.EDITABLE)); CurrForm.ButtonModify.VISIBLE(NOT CurrForm.EDITABLE); CurrForm.ButtonShow.VISIBLE(CurrForm.EDITABLE); END; } { 1101339020;CommandButton;220;5940;2200;550;Name=ButtonModify; HorzGlue=Left; VertGlue=Bottom; CaptionML=ENU=Modify; OnPush=VAR Mycodeunit2@1101339001 : Codeunit 55555; BEGIN CurrForm.EDITABLE(Mycodeunit2.ShowModify(ISEMPTY,CurrForm.EDITABLE)); CurrForm.ButtonModify.VISIBLE(NOT CurrForm.EDITABLE); CurrForm.ButtonShow.VISIBLE(CurrForm.EDITABLE); END; } } CODE { BEGIN END. } } OBJECT Codeunit 55555 Test Codeunit { OBJECT-PROPERTIES { Date=08/05/09; Time=16.52.21; Modified=Yes; Version List=; } PROPERTIES { OnRun=BEGIN END; } CODE { PROCEDURE ShowModify@1101339001(TFIsempty@1101339000 : Boolean;TFExEditable@1101339001 : Boolean) : Boolean; BEGIN IF TFIsempty THEN EXIT(TRUE) ELSE EXIT(NOT(TFExEditable)); END; BEGIN END. } }
Comments
Reagrds,
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I wrote "..or a function somewhere"...it's up to the developer where to put it...
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
How about instead of to replace the function: You do not need to define codeunit variable then.
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
you're right!
friday has been a really bad day ](*,)
thanks for the suggestion
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Well here's my tuppence worth.
For all three controls: For the Modify button. Modify control, Text constants.
If they don't have write permission, tell them early.
TVision Technology Ltd
Regards,
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
in other words, onformat works only if visible is true. (it was not so long to explain after all )
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog