Show field message

Naveen87
Tera Guru

Hi Developers,

 

I have a list collector field called macro_module.

This variable drop-down does not have an option called 'Knowledge'.

 

When an end user search for 'Knowledge' on this variable. I want to show a field msg.

'For Request related to Knowledge Management, Please use Group Membership Management & select Knowledge Management as group name'
 
 
I wrote this onCchange client script but it's not working. Please suggest
 
Naveen87_1-1707285847682.pngNaveen87_2-1707285927765.png

 

11 REPLIES 11

Sohail Khilji
Kilo Patron
Kilo Patron

Try this :

 

var Value = newValue.getDisplayValue(); 

if (Value.indexOf("know") > -1)
{
// your logic here...
}

 

 

I hope this helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

try this also, try to log the value inside and outside of If conditions to see where it blocks....


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi, 

I tried your script & alert conditions.

We are unable to enter into If condition to check the field contains "Knowledge".

Out side if poping up.

Naveen87_0-1707290828097.pngNaveen87_1-1707290850259.pngNaveen87_2-1707290871362.png

 

Aniket Chavan
Tera Sage
Tera Sage

Hello @Naveen87 ,

 

As per my knowledge, a list collector variable uses a reference to a table using sys_ids, so it will not consider the text untill we select any choice in it . So, the client script might not trigger as expected because the choice is not selected, because there is no any choice for that text. you can test this by adding infomessage and see without any conditions the client script is triggering or not.

 

Even if we try using functions like 'includes,' since we have not selected any choice in it will prevents it from working.

 

Instead, a straightforward solution could be to use help text. We can add clear instructions there.

 

Please le me know your views and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

 

Aniket

Hi @Aniket Chavan ,

Help text would show the msg all the time. Which isn't ideal situation here.

I had also tried onChnage field msg which works fine. When some value is selected on variable. It shows the msg.

Naveen87_0-1707297619113.png

 

 

So it's not possible to show msg when Knowledge is searched on the Variable?