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

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object is not working in 6.11 P1HF1

UnityAdmin
Contributor III

Hi Team,

We have implemented one custom object in value list field for one values to populate error/warning msg to user when they are trying to conclude the record without filling that required values. It is working when we chose that particular values at the very first time but when we change it to some other values and save the record and  again when we pick up the same values where we want the error, the CO is failing this time and it is not populating or the error msg.

Below is the code we have implemented:

<script type="text/javascript">

Sys.Application.add_load(function() {
$('div[id*="f' + 24781 + 'c"]').change(function() {

var esov = $CM.getFieldValue(24781);
var sasv = $('#' + $CM.getFieldById(42870).clientId).text().trim();


if (esov == '2318:0' && sasv == "Required"){

var msg = "You can not conclude the Engagement as Supplier Assessment is not completed";
var title = "Supplier Assessment Incomplete";
WarningAlert(msg,title);

console.log("Working")
}
});
});
</script>

Can you please guide us why it is happening or help us with logic which we need to implement in CO when we are rechanging the values to other then again choosing up the same values in the record.

Thanks

Unity Team

 

3 REPLIES 3

DavidPetty
Archer Employee
Archer Employee

@UnityAdmin being custom objects are part of page, when you do a save Archer reloads the page and executes the custom object and "resets" the variables.  If you need to keep the variable persistent between saves use Window.sessionStorage - Web APIs | MDN (mozilla.org)

 Advisory Consultant

UnityAdmin
Contributor III

@DavidPetty  We will explain you with an example suppose we have an assessment status field, custom object is working on the initial stages that means for the first time when the "required" values is selected it is throwing the error msg when we are concluding the record but suppose if we change the same field values to the other values as completed or not required and save the record then again we change the field values to the initial stages i.e. "required" for the same record then CO is failing and it is throwing the error when we are concluding the record.

So for the above case do we need to implement anything more in the code to make it working in every aspect of the "required" whenever it is selected.

What's the error being thrown by the custom object?

 Advisory Consultant