Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object to show alert on value change

DeepaSaran3
Contributor II

Hi Team,

     Recently I have written a code in v6.9 P2 to show an alert for record when value list(radio button) field value changes to certain value. Somehow when I used the same code in other application it is not working. Please help me to address this issue.

Below is my code :

<script>
Sys.Application.add_load(function() {

$('div[id*="f'+ 52505 +'c"]').change(function() {

if($CM.getFieldValue(52505) == '444297:0' || $CM.getFieldValue(52505) == '491761:0'){

alert("Kindly navigate to 'Findings' tab and create a new finding or lookup existing finding before marking the result as Ineffective or Observation.");
}

});

});
</script>

 

Thanks in advance!

6 REPLIES 6

DavidPetty
Archer Employee
Archer Employee

Deepa, the ids for the field and values list values (non-global values lists) are different from application to application and also could be different from environment to environment.

Make sure the ids for both the field and values list values are accurate.

 Advisory Consultant

DeepaSaran3
Contributor II

Thanks for your prompt response David. Yes I did changed the field and value ids. 

While running the code in debugger it shows syntax error which I could not able to identify. It would be great if you can figure out if anything wrong with this code in script tag. In the mean while I will try the same for another application.

Anytime 

What's the syntax error?  Also clicking on the error in the console will take you to the code and the line the error occurred at.

 Advisory Consultant

DeepaSaran3
Contributor II

Hi David,

      Issue identified: code is not working because field is radio button but it works correctly with drop down list. Do we need to write use a different syntax to use radio button field type?

 

 

If you're using the getFieldValue() function, yeah it's a limitation of that function. You'd have to get the value by using native JavaScript/jQuery.

 Advisory Consultant

DeepaSaran3
Contributor II

Hi David,

    Could you please help me with sample code for reference.