February 24, 2019

Set background color for a field in form grid [DisplayOptionInitialize]

Hi Folks,

Today I am going to discuss how to make a filed text/background colorful :) This could be really helpful if you want to set such color based on an enum, like the status of the record or some kind of color coding on the grid based on an enum value. You can apply color on the entire grid line or one/more specific fields on the grid. So let's get started.

First, let's see how to achieve this using event handler. Assume there is field 'onHold' and you want to set vendor account no background/text to red or green based on this.  Go to your 'VendTable' form and vendTable data source and copy the event handler names 'DisplayOptionInitialize'. Paste this in a new class and write below code under this method (once you paste the event handler).
<CodeSample>


On new forms, the same can be achieved using overriding 'DisplayOption' method on the data source. Below code will give a hint


public void displayOption(Common _record, FormRowDisplayOption _options)
        {
            VendTable    vendTable = _record;

          //  _options.affectedElementsByField(<FieldName>);
            //    _options.backColor(<Color>);
            super(_record, _options);
        }
Please note, the color thing doesn't work when the user selects a record, it will make the selected line in default color setting. But useful when opening a grid and see the entire set of records.

See more..

Table Event handler methods in Dynamics 365 FO


Form Event handler methods in Dynamics 365 FO


Cheers!!!
-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

February 21, 2019

[Solved] Capture screenshots toggle doesn't appear on Task recorder

Hi Folks,

The Task records are slightly different in D365FO than earlier versions. If you are not getting the 'Capture screenshots' toggle on task recorder window on your environment try below steps,

1. Download FMLab folder from Github, https://github.com/Microsoft/FMLab
2. Unzip it and there must be a folder named 'TaskRecorderScreenshot'.
3. Now go to google chrome and go to More tool > Extensions
4. Click on 'load unpacked' and select  'TaskRecorderScreenshot' folder from the downloaded FMLab folder.
5. Once done, make sure its enabled on chrome extension.

Restart the chrome and check you must get the 'Capture screenshots' toggle on task recorder window.

Cheers!!!
-Harry
Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta