cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object to Update Values List and Save 6.3 P5

NicholasPallard
Contributor II

We recently moved to version 6.3 P5 and one of our custom objects is no longer working.  The purpose of the custom object is to update a values list and then "Save" (previously "Apply").  We do not want to "Save and Close".  The issue in 6.3 is that the Save and Close button has returned and now the custom object closes the record instead of saving and staying on the page.  I have tried several methods posted by other users, but have not yet had any success in updating the values list and "Saving" instead of "Save and Close".  Any advice is greatly appreciated.  Below is the code we are using:

<script language="javascript">

 var integration = {

   fieldID:"11111", 

   valueID:"22222", 

 };    

function UpdateValueList(changeId, assignedValue) {

  var valueArray = new Array(1); 

  valueArray[0] = assignedValue; 

  ArcherTech.UI.GenericContent.GetInstance().setFieldValue(changeId, valueArray, ''); 

ShowAnimationAndPostback('master$btnSave')

}

</script>

<div style="text-align:center;">

<img src="../BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Advance to Step 2 of 5;iconSetStyle:VistaRound;baseColor:%23276CA8;disabled:False" onclick="javascript:UpdateValueList(integration.fieldID,integration.valueID);"></div>

1 ACCEPTED SOLUTION

Accepted Solutions

$("#master_btnApply").click(); then

View solution in original post

74 REPLIES 74

Ilya_Khen
Champion III

Instead of 

ShowAnimationAndPostback('master$btnSave')

use this:

$("#master_btnSave").click();

NicholasPallard
Contributor II

Hello Ilya,

I appreciate the recommendation, but unfortunately that doesn't appear to have solved the issue.  It absolutely updates the values list, but it saves and closes the record and I'm hoping to find a solution that just saves the record (similar to how the old "Apply" button worked.)

 

Thank you,

$("#master_btnApply").click(); then

NicholasPallard
Contributor II

Unfortunately, using $("#master_btnApply").click(); has the same outcome (i.e. it "Saves and Closes").  I tried something similar in previous tests, but renaming it to "Apply" doesn't seem to have the expected outcome.

Interesting, I just used btnApply in my 6.3 P5 environment and it Saves the record but does not go out.

 

Also, this is working fine in my environment: ShowAnimationAndPostback('master$btnApply');

jsol5
Advocate II

Not sure if you figured this out already, but in prior versions of Archer the save button was master_btnSave.

With this new version.  The save button is now master_btnApply and master_btnSave is now the save and close button.

 

So that means with the new release, the code you provided is referencing the new save and close button.

I had a similar issue with a custom object.  I just changed my click event to use the master_btnApply and it continues to work as expected.

NicholasPallard
Contributor II

Ilya and Jason,

 

I truly appreciate your help.  I was able to get this working using $("#master_btnApply").click(); as suggested.  I actually had two custom objects in my layout that had a similar purpose, but updated the values list to a different value.  The issue was that I only changed one of them.  Only changing one of them to $("#master_btnApply").click(); made it still operate as "Save and Close", but once I updated the code for both objects it worked as advertised.

Thank you so much for your help.

Welcome

mkushwaha1
Contributor III

Hi Everyone,

 

I am using the below code in 6.4 to create a custom button to change the value list value. It changes the value list but is not saving the record. I tried to troubleshoot it using alert and I found that it always stuck at ArcherTech.UI.GenericContent.GetInstance().setFieldValue(changeId, valueArray, ''); All suggestions and recommendations would be highly appreciated.

 

<script language="javascript">

var integration = {

fieldID:"23966",

valueID:"84163",

};

function UpdateValueList(changeId, assignedValue) {

var valueArray = new Array(1);

valueArray[0] = assignedValue;

ArcherTech.UI.GenericContent.GetInstance().setFieldValue(changeId, valueArray, '');

alert("Executing Alert");
$("#master_btnSave").click();

}

</script>

<div style="text-align:center;">

<img src="../BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Change Value;iconSetStyle:VistaRound;baseColor:%23276CA8;disabled:False" onclick="javascript:UpdateValueList(integration.fieldID,integration.valueID);"></div>

 

Thanks,

Mathura