How to mark actual record
jpussler
Member Posts: 6
Hello,
I thought maybe somebody could help me with my problem. In a form I would like to mark the actual record (where the cursor is placed) with bold letters or in another font color. Is this possible and how can I do this. Any suggestions would be fine.
Thanks
Jochen
I thought maybe somebody could help me with my problem. In a form I would like to mark the actual record (where the cursor is placed) with bold letters or in another font color. Is this possible and how can I do this. Any suggestions would be fine.
Thanks
Jochen
0
Comments
-
eeehm. There was a posting about this on MBSOnline. But it is not running at the moment. :?
I thought Timo Lasser had a solution for this.
I'll try to remember it...0 -
May be something like OnFormat compare primary key of Rec with primary key last accessed record in OnAfterGetCurrRecord and if they are same, use bold font...0
-
Yes it was something like that but with a neat trick for unappliing these changes when going to the next record.0
-
Every TextBoxes have the Onformat - Trigger enter here your code.
Here is an example:OBJECT Form 99999 Cust List-example { OBJECT-PROPERTIES { Date=16.12.05; Time=19:55:14; Modified=Yes; Version List=NAVW14.00; } PROPERTIES { Width=11660; Height=6710; Editable=No; CaptionML=[DEU=Debitoren?bersicht; ENU=Customer List]; TableBoxID=1; SourceTable=Table18; } CONTROLS { { 1 ;TableBox ;220 ;220 ;11220;5500 ;HorzGlue=Both; VertGlue=Both } { 2 ;TextBox ;0 ;0 ;1650 ;0 ;ParentControl=1; InColumn=Yes; SourceExpr="No."; OnFormat=BEGIN IF "No." = '10000' THEN CurrForm."No.".UPDATEFORECOLOR(255); CurrForm."No.".UPDATEFONTBOLD("No." = '20000'); CurrForm."No.".UPDATESELECTED("No." = '60000'); END; } { 3 ;Label ;0 ;0 ;0 ;0 ;ParentControl=2; InColumnHeading=Yes } { 4 ;TextBox ;1640 ;0 ;8441 ;0 ;HorzGlue=Both; ParentControl=1; InColumn=Yes; SourceExpr=Name; OnFormat=BEGIN IF "No." = '10000' THEN CurrForm.Name.UPDATEFORECOLOR(255); CurrForm.Name.UPDATEFONTBOLD("No." = '20000'); CurrForm.Name.UPDATESELECTED("No." = '60000'); END; } { 5 ;Label ;0 ;0 ;0 ;0 ;ParentControl=4; InColumnHeading=Yes } { 14 ;CommandButton;4400 ;5940 ;2200 ;550 ;HorzGlue=Right; VertGlue=Bottom; Default=Yes; PushAction=LookupOK; InvalidActionAppearance=Hide } { 15 ;CommandButton;6820 ;5940 ;2200 ;550 ;HorzGlue=Right; VertGlue=Bottom; Cancel=Yes; PushAction=LookupCancel; InvalidActionAppearance=Hide } { 29 ;CommandButton;9240 ;5940 ;2200 ;550 ;HorzGlue=Right; VertGlue=Bottom; PushAction=FormHelp } } CODE { PROCEDURE GetSelectionFilter@2() : Code[80]; VAR Cust@1000 : Record 18; FirstCust@1001 : Code[30]; LastCust@1002 : Code[30]; SelectionFilter@1003 : Code[250]; CustCount@1004 : Integer; More@1005 : Boolean; BEGIN CurrForm.SETSELECTIONFILTER(Cust); CustCount := Cust.COUNT; IF CustCount > 0 THEN BEGIN Cust.FIND('-'); WHILE CustCount > 0 DO BEGIN CustCount := CustCount - 1; Cust.MARKEDONLY(FALSE); FirstCust := Cust."No."; LastCust := FirstCust; More := (CustCount > 0); WHILE More DO IF Cust.NEXT = 0 THEN More := FALSE ELSE IF NOT Cust.MARK THEN More := FALSE ELSE BEGIN LastCust := Cust."No."; CustCount := CustCount - 1; IF CustCount = 0 THEN More := FALSE; END; IF SelectionFilter <> '' THEN SelectionFilter := SelectionFilter + '|'; IF FirstCust = LastCust THEN SelectionFilter := SelectionFilter + FirstCust ELSE SelectionFilter := SelectionFilter + FirstCust + '..' + LastCust; IF CustCount > 0 THEN BEGIN Cust.MARKEDONLY(TRUE); Cust.NEXT; END; END; END; EXIT(SelectionFilter); END; PROCEDURE SetSelection@1(VAR Cust@1000 : Record 18); BEGIN CurrForm.SETSELECTIONFILTER(Cust); END; BEGIN END. } }
Copy the Code into an new, empty text-File. Import the textfile in the (CRONUS DB), compile the new form 99999.
After them, take a look in the C/AL Code of the both textboxes (enjoy).
RegardsDo you make it right, it works too!0 -
Yes. this is nice code but not what is meant by highlighting the current record.0
-
okay, its nearly the same way
Regards
PS: Are you every time online :?: 8-[Do you make it right, it works too!0 -
-
My charity :PDo you make it right, it works too!0
-
0
-
Here the solution:
Form - OnAfterGetCurrRecord() CurrentRecord := Rec; Form - OnTimer() // TimerInterval = 100 IF CurrForm.ACTIVE THEN IF NOT IsEqual(CurrentRecord2,Rec) THEN BEGIN CurrForm.UPDATE(FALSE); CurrentRecord2 := Rec; END; Description - OnFormat(VAR Text : Text[1024];) CurrForm.Description.UPDATEFONTBOLD(IsEqual(CurrentRecord,Rec)); IsEqual(Rec : Record "YourTableNo";Rec2 : Record "YourTableNo") : Boolean EXIT( (Rec."Primary Key Field 1" = Rec2."Primary Key Field 1") AND (Rec."Primary Key Field 2" = Rec2."Primary Key Field 2") AND (Rec."Primary Key Field 3" = Rec2."Primary Key Field 3") AND (Rec."Primary Key Field 4" = Rec2."Primary Key Field 4"));Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
With an timer its an easy way. But timer - solution are not so good.
For example an other way to update the form, is to uese the key-events (up, down). Place a menubutton behind the tablebox. make two entries. Give the entries the key events up, down (make there your update).
When the user will use the mouse, you can use the tablebox triggers.
RegardsDo you make it right, it works too!0 -
Have you any example code for that? It sounds interesting!garak wrote:[...]
For example an other way to update the form, is to uese the key-events (up, down).
[...]
When the user will use the mouse, you can use the tablebox triggers.
[...]Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Can be done I think, there are some games in the download section that use the up/down arrowkeys.
You have to think of manualy programming next(1) and next(-1) and error handling... :?
And do this for every form the user says he likes it.
Maybe it was better to say it cannot be done
0 -
Hello,
I tried this code, but it doesn't work the it expected it to work. The current record is indeed in BOLD, but the previous current record is also left BOLD. This should be turned back to NOT BOLD.
The problem is that the OnFormat tirgger is only executed for the new current record. Not for the previous one.
Any suggestions?
Erwin0 -
I have one suggestion, but you will not like it: don't do what you did. Changing how NAV is displaying actual selected line, is not worth the money customer will gave you for that. If you solve one problem, you will have another. Just teach users how it works.
Question is: what is the main cause that you are trying to do that? Can you solve this in another way? You need to answer these two basic questions...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


