Hi Mir,
Thanks for your file. I included a 2nd version of my file, please find it attached (file name has 'v2'). Please look at lines 291-301. You shall see that I included an 'if' clause for the DisplayColor field. I tested it and it's working. I realize in your code you also condition based on 'BU', so my suggestion, take my skeleton code, apply it to yours as-is, test and see it's working (regardless of BU), then create your further conditions based on the BU. This way you'll know this is working to begin with and if stops once you add your BU conditions then you shall know where to troubleshoot. Also, remember to choose the 'Color' field in the app's settings when you use this code, otherwise the DisplayColor is not part of that array of fields.
Lastly, just as a recommendation:
If/when you get this to work and if you have more intentions to continue extending this code for even additional fields and their use-cases, then instead continuing to next all of these if-else clauses I'd recommend you consider changing the structure to something like this: This some pseudo-code just to give you the idea of what I mean:
if (field === 'field1') {
}
if (field === 'field2') {
}
if (field === 'field3') {
}
..
..
if (field === 'fieldX') {
}
else {
}
this way would be more readable for each field name, in this way the 'else' is the one final case which is not any of the fields handled earlier. I hope it makes sense.
Let me know if all that helped.
Sagi