Question

Highlighting the record in the section page.

Dear Team,

I tried to highlight a record in the section page based on the value selected in the lookup,i tried in two sections.

Candidate Pool Section : I tried with the below code and it works fine and the record is getting highlighted based on the value i selected in the lookup.

Section Page : UsrCandidatePool1Section

Code : I kept the below code in the candidate pool section page

prepareResponseCollectionItem: function(item) {

            // Calling the base method.

            this.callParent(arguments);

            item.customStyle = null;

            // Determining the order status.

            var running = item.get("UsrRagTag") && item.get("UsrRagTag").value;

               var running1 = item.get("UsrRagTag");

            //If the status of the order is "In progress", the record style changes.

            if (running1.value === "1b58519b-e45a-4b6d-bc2a-79d9af242f6d") {

               item.customStyle = {

                  // The text color is white.

                  "color": "green",

                  // The background color is green.

                  "background": "#8ecb60"

               };

            }

         else if (running1.value === "ff15a334-e4e0-4514-997f-ab7dce6b2f3b") {

               item.customStyle = {

                  // The text color is white.

                  "color": "amber",

                  // The background color is green.

                  "background": "#ffff99"

               };

            }

            else if (running1.value === "8e8424b7-9225-41af-b9ff-32ace7d27da0") {

               item.customStyle = {

                  // The text color is white.

                  "color": "white",

                  // The background color is green.

                  "background": "#ff8080"

               };

            }

Candidates Section: In the morning when I tried with the same code in the candidates section, the record got highlighted with a given color, but after some time the section page is not getting loaded and getting the below error. So I commented out the code.

Page : UsrCandidates1Section

Can u please help me, where did it go wrong.

Please help at the earliest.

with out pasting the code the opens correctly.

Hoping for a positive reply.

Regards,

 Manikanta.

Like 0

Like

4 comments

You hid UsrRagTag field from the Grid. You can't get value of running1 now. I guess.

As Alex mentioned, in order for you to use the field value, it needs to exist in the ESQ for the list. This is based on the fields in the list layout, however, you can also add the field to the list's ESQ yourself as well. 

I have an article on this topic here: https://customerfx.com/article/styling-section-list-rows-based-on-conditions-in-the-data-in-bpmonline/

Look at the initQueryColumns method, this is where you can add the field to the list ESQ.

Ryan

Ryan Farley,

Thank Ryan for giving the solution.

It's working fine.

Regards

manikanta.

 

Ryan Farley,

Thanks, very helpful, I didn't use that method yet.

Show all comments