Get in Touch

Our team of experts is looking forward to hearing from you!

Location
Kolkata Address:
Unit No. 803 & 804, 8th Floor, Merlin Matrix, DN-10 Sector – V, Saltlake, Kolkata – 700091

Hyderabad Address:
Flat No. 101, Plot No. 20, VIP Hills Image Garden Road Madhapur, Hyderabad – 500081

Australia Address:
7 Starling Street, Marsden Park Nsw, 2765 Australia

SINGAPORE
68 Circular Road #02-01, Singapore 049422
Phone
IN: +91 98309 68604
IN: +91 90077 99382
AU: +61 447276768

Blog

Conditional Cell Coloring in data forms using Groovy

When it comes to highlighting certain data cells, we all must have got our hands on validation rules. Undoubtedly, they make things quite descriptive and help to control data entry when required. But at the same time, the trouble to maintain all these objects is equally troublesome.

Let’s take an example of a simple scenario,

  1. If the data is missing, color it light yellow
  2. If the no. of units is less than 10, color it yellow
  3. If the no. of units is more than 10, color it light blue
  4. If the no. of units is exactly 10, fill no color
  5. And make the Year Total value as Grey.

If we go for validation rules for this in form/s, we must set the required conditional formatting.

How about we have Groovy scripting capability in our application and lets see how Groovy makes our life easy by just maintaining a small piece of code which can be tagged to any form to serve the same purpose.

Let’s understand different parts of the code.

  • The 1st line points to the grid then each data cell iterates one after another.
  • 1st if statement checks whether the cell value is missing then assigns cell color as light yellow.
  • Similarly, the other 2 elseif checks the other two conditions and assigns color respectively.
  • To make grey color to all Year Total value, “YearTotal” is specified with the data cell Iterator. This iterates all cells within year total and assigns the color.

How To Create Groovy Script

From calculation Manager create a new rule and choose as edit script and script type as ‘Groovy script’.

   

Write the code and then validate and deploy the rule.

Add Rule to Form

Attach the rule to required data form. Check the ‘Run Before Load’ as BR property and Save the form.

Output

This groovy rule can have all such conditions listed together in single rule which can be attached to multiple data forms making them behave the same way. Even a more complex scenario will be easier to achieve through groovy rather than validation rule. With support for Groovy rules in Oracle EPM Enterprise Cloud, you can address all types of limitations. Groovy improves the performance by creating focused calculations. Dynamically generate calculation scripts at runtime based on contexts defined in the Groovy script. So Groovy scripting plays well with EPM and makes application work efficient and easier.

Contact informationWe are always ready to help you and answer your questions

KOLKATA

Unit No. 803 & 804, 8th Floor, Merlin Matrix, DN-10
Sector – V, Saltlake, Kolkata – 700091,                                                      ISO 27001 Certified

HYDERABAD

Flat No. 101, Plot No. 20, VIP Hills Image Garden
Road Madhapur, Hyderabad – 500081

AUSTRALIA

7 Starling Street, Marsden Park Nsw, 2765 Australia

SINGAPORE

68 Circular Road #02-01                Singapore 049422

Phone:

IN: +91 98309 68604
IN: +91 90077 99382
AU: +61 447276768

Email
Interested in working with us? 
admin@essprom.com

Get in touch

Please enable JavaScript in your browser to complete this form.