Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2021-04-13 01:44 PM
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!
2021-04-13 01:56 PM
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
2021-04-14 01:07 AM
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.
2021-04-14 07:37 AM - edited 2021-04-14 07:39 AM
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
2021-04-20 08:40 AM
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?
2021-04-20 02:33 PM
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
2021-04-22 10:41 AM
Hi David,
Could you please help me with sample code for reference.