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

cancel
Showing results for 
Search instead for 
Did you mean: 

Existing Custome Code is not working with 6.9.3

Babuchellavelu
Contributor III

Good Morning,

We have recently  upgraded our lower environment to 6.9.3.

We have implemented validation using  custom code in many of our applications. Those are not working after the 6.9.3 upgrade. 

Is this expected because of Silverlight Removal and React implementation?

Is there any document available to implement custom validation in new way? Please advise.

1 ACCEPTED SOLUTION

Accepted Solutions

@CindyOLee, the button anonymous events have been changed.  You can use the following yo hijack the buttons:

 

// Hijack Save and Close Button
$('#master_btnSave1').clone().attr('id', 'master_customBtnSave').insertBefore('#master_btnApply1');
$('#master_btnSave1').hide();
$('#master_customBtnSave').unbind('click').prop("onclick", null).click(function(){ actual_vs_potential();return false;});
 
// Hijack Save Button
$('#master_btnApply1').clone().attr('id', 'master_customBtnApply').insertBefore('#master_btnApply1');
$('#master_btnApply1').hide();
$('#master_customBtnApply').unbind('click').prop("onclick", null).click(function(){ actual_vs_potential();return false;});

 

 Advisory Consultant

View solution in original post

9 REPLIES 9

Ilya_Khen
Champion III

Babuchellavelu,

That depends on your code solely and whether there were any element changes or UI changes performed by developers. There is no guideline on how to write Custom Code, you write it per your demand and need. Some help can be seen in this forum: https://community.rsa.com/t5/archer-custom-objects/gh-p/archer-custom-objects, but in case yours is not working per upgrade it has to be checked case by case as each case could be a unique.

DavidPetty
Archer Employee
Archer Employee

@Babuchellavelu, the removal of Silverlight is backend only and never was used for application/questionnaire records.  React implementation hasn't touched the UI for records either.

If you were on an earlier version of Archer it most likely the naming of the Save and Save and Close buttons have changed in the latest version.

If you post the custom object I can tell you what needs to be changed.

 Advisory Consultant

Hi David,

I read other articles on how to fix the custom object after the upgrade. I tried and I cannot figure out. The upgrade is to 6.9.2 from 6.4. The validation message did show, but it continues to save the data. It should not. Below is the codes.  Could you take a look and see what I miss and what the fix is.  Thanks in advance!

<script>
Sys.Application.add_load(function(){
 $("#master_btnApply1").click(function(){actual_vs_potential();});
 $("#master_btnSave1").click(function(){actual_vs_potential();});
});

function actual_vs_potential(e){

var actual_VH = false;
var actual_H = false;
var actual_M = false;

var potential_H = false;
var potential_M = false;
var potential_L = false;

// If [Actual Impact Rating] = Very High, assign true to actual_VH else
// if [Actual Impact Rating] = High, assign true to actual_H else
// if [Actual Impact Rating] = Moderate, assign true to actual_M
if ($('#master_DefaultContent_rts_ts1895_s3698_f16953c_3').is(':checked')) {
     actual_VH = true; 
} else if ($('#master_DefaultContent_rts_ts1895_s3698_f16953c_2').is(':checked')) {
     actual_H = true; 
} else if ($('#master_DefaultContent_rts_ts1895_s3698_f16953c_1').is(':checked')) {
     actual_M = true; 
}

// If [Potential Impact Rating] = High, assign true to potential_H else 
//If [Potential Impact Rating] = Moderate, assign true to potential_M else
// if [Potential Impact Rating] = Low, assign true to potential_L
if ($('#master_DefaultContent_rts_ts1895_s3698_f17807c_2').is(':checked')) {
     potential_H = true; 
} else if ($('#master_DefaultContent_rts_ts1895_s3698_f17807c_1').is(':checked')) {
     potential_M = true; 
} else if ($('#master_DefaultContent_rts_ts1895_s3698_f17807c_0').is(':checked')) {
     potential_L = true; 
}

if ( (actual_VH && (potential_H || potential_M || potential_L) ) ||
     (actual_H && (potential_M || potential_L) ) ||
     (actual_M && potential_L ) ) {
   alert('Potential Impact Rating must be same or greater than Actual Impact Rating.');
   e.preventDefault();
   alert(event.isDefaultPrevented());
   return false;
}

}
</script>

 

@CindyOLee, the button anonymous events have been changed.  You can use the following yo hijack the buttons:

 

// Hijack Save and Close Button
$('#master_btnSave1').clone().attr('id', 'master_customBtnSave').insertBefore('#master_btnApply1');
$('#master_btnSave1').hide();
$('#master_customBtnSave').unbind('click').prop("onclick", null).click(function(){ actual_vs_potential();return false;});
 
// Hijack Save Button
$('#master_btnApply1').clone().attr('id', 'master_customBtnApply').insertBefore('#master_btnApply1');
$('#master_btnApply1').hide();
$('#master_customBtnApply').unbind('click').prop("onclick", null).click(function(){ actual_vs_potential();return false;});

 

 Advisory Consultant

@DavidPetty thank you very much for the quick reply!  It works   Thanks again

@DavidPetty 

I spoke too soon   I needed to rollback the hijack codes because it won't allow me to save records if data is good with no validation failure. What else to change in the JavaScript?  Thank you.

What are you getting when you try to save a record?

 Advisory Consultant

@DavidPetty Nothing happen when I clicked on Save / Save and Close.  The record did not get save.

@DavidPetty Hi David, I tried and can't fix the issue. Save the record when no validation failure and display validation message and not save the record.  Any suggestion? 

Thanks.