Index of Not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 02:38 AM - edited 11-29-2023 02:40 AM
Hi All,
I am using Index of with string and its not working. Please find the sample script below. when i tested i am only getting the If validation and else if is not working. please let me know if any changes has to done.
Note : filed name is same for all the conditions.
script :
if (field name.indexOf("x")<1){
here i am triggering one event
} else if (filed name.indexOf("y")<1 || filed name.indexOf("z")<1){
here i am triggering another event
} else if ( filed name.indexOff("x")<1 && filed name.indexOf("y")<1 || filed name.indexOf("z")<1){
here i am triggering another event ;
}else{
here i am triggering another event ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:42 AM
Can you show what you are trying?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:44 AM
1. filed type is reference and i have used the below code but its not working .
if ( filed_name.getDisplayValue().indexOf("x)<1) {
triiger the event
}else if (filed_name.getDisplayValue().indexOf("y")<1 ||filed_name.getDisplayValue().indexOf("z")<1 ){
triiger the event
}else if (filed_name.getDisplayValue().indexOff("x")<1 && filed_name.getDisplayValue().indexOf("y")<1 || filed_name.getDisplayValue().indexOf("z")<1 ){
triiger the event
} else {
triiger the event
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:46 AM - edited 11-29-2023 03:47 AM
I just asked you move to <0 instead of using <1
also hope you are using current.field_name.getDisplayValue()
You just send the script from your question, where is the code that I suggested you use, there wre changes I made, comment i added. did you see/use that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 03:51 AM
Please find the script .
Script :