Tabular Form - change bgcolour of field for a particular rec
shogan@mila.ie
Member Posts: 113
Hi everyone,
Is it possible in a Tabular-Type form that the background colour for the "Status" field is green if a record has it set to "Open" and red if set to "Closed"? This is an Option field and I'd like to dynamically set it. It's just the field I need, not the entire record.
I notice that this is not possible in a Card-Type form, but I have been able to use a button on a Card-Type Form to set the FOREcolor of the Status field but does not seem to be a way of changing the BACKcolor.
I am developing this for a user in a tabular style (she's coming from a manual Excel system).
As a workaround, but I had also thought of using VISIBLE on two controls - red and green filled rectangle shapes, and making the BackTransparent property of the Status field well, transparent, and set the VISIBLE properties on the red and green rectangles accordingly directly behind the status field.
But I don't know how to make a Card-Type Form look like a tabular-Type Form.
I'd love to hear how others would do it?
Regards,
Stephen
Is it possible in a Tabular-Type form that the background colour for the "Status" field is green if a record has it set to "Open" and red if set to "Closed"? This is an Option field and I'd like to dynamically set it. It's just the field I need, not the entire record.
I notice that this is not possible in a Card-Type form, but I have been able to use a button on a Card-Type Form to set the FOREcolor of the Status field but does not seem to be a way of changing the BACKcolor.
I am developing this for a user in a tabular style (she's coming from a manual Excel system).
As a workaround, but I had also thought of using VISIBLE on two controls - red and green filled rectangle shapes, and making the BackTransparent property of the Status field well, transparent, and set the VISIBLE properties on the red and green rectangles accordingly directly behind the status field.
But I don't know how to make a Card-Type Form look like a tabular-Type Form.
I'd love to hear how others would do it?
Regards,
Stephen
0
Answers
-
What do you want changed?
See Example pics - is this what you want?
1. Sales Order Form
2. Sales Order List Form0 -
I'd take a different approach here : use a picturebox control in your tabelbox, with the sourceexpression set to "status" and a list of bitmaps in the "bitmaplist" property for the different colors you want. No code needed
0 -
Hi Harry,
The List Form looks perfect - but is it possible to have that colour effect dynamic on an Option field?
Regards,
Stephen0 -
For the list form it was a simple adding to the OnFormat Trigger of the Status field:
OnFormat(VAR Text : Text[1024];) CASE Status OF Status::Open : CurrForm.Status.UPDATEFORECOLOR(4953600); Status::Released : CurrForm.Status.UPDATEFORECOLOR(255); END;
I'm not sure i'm following about the option field?0 -
Hi Harry,
Sorry - allow me to explain:
I have the Status field set up as an Option Field in the background table - 'Open' and 'Closed' are the options.
I have put your code into the OnFormat trigger, but the following error appears when I attempt to run the report:
The double-space is intentional, and nothing is between "to on" in the second sentence.The Dynamic Property 'ColorSet' cannot be changed in this context. You tried to change 'ColorSet' to on the TextBox named 'Status'.
Basically I'd like to have the colour change between red and green immediately on updating this field in the form.
I am going to have lots of questions Harry, as I am building up quite a complex form, so be prepared! As always, thanks for your help Harry - really appreciate it.
Regards,
Stephen0 -
FYI: Status is the "Name" of my control. Yours might be <Control1000000185> for example. you can rename it to something more descriptive. and use that in the code0
-
Hi Harry,
Exported the object as .txt and found I had inserted code into the wrong field!
Your solution worked perfectly, thank you.
Regards,
Stephen0
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