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

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>

74 REPLIES 74

Hi David,

 

I just tried as you instructed. It is changing the value but not saving the record.

I feel like it must be an issue with browser.

 

Thanks,
Mathura Prasad

I remember I had suggested already to check access rights, browser addons, adblockers, goo, different browsers.

JeffBerkowitz
Collaborator II

Hi Mathura,

 

Did you ever get this resolved? I am having the exact same issue on an Archer 6.4 SP1 P6 platform. I created a simple ODA with a values list and a custom object with the following code:

 

<div style="margin: auto; width: 40%">

   <div class="toolbar-app-buttons-left">

      <a title="Save And Close" class="tb-btn-link-left" id="customSaveandClose" href="javascript:void(0);" data-check-dirty="true"> <div class="tb-btn" style="background-color:green; color:white">Save And Close</div>

      </a>

   </div>

</div>

 

<script type="text/javascript">

 

var integration =

{

statusField:"22732",

statusApprove:"74218"

};

 

function UpdateValueList(changeId, assignedValue) {

   var valueArray = new Array(1);

   valueArray[0] = assignedValue;

   

   alert(changeId);

   alert(assignedValue);

   

   $CM.setFieldValue(changeId, valueArray, '');

   

   alert(changeId);

   alert(assignedValue);

   

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

 

}

 

$("#customSaveandClose").click(function(){

   UpdateValueList(integration.statusField,integration.statusApprove);

});

 

</script>  

 

 

The values list gets updated but the record is not saved. The two alerts before the $CM.setFieldValue(changeId, valueArray, ''); statement execute, but nothing after the  $CM.setFieldValue(changeId, valueArray, ''); statement executes.

 

I tried different browsers but the behavior is the same.

 

Thanks,

Jeff Berkowitz

Jeff, are you executing in the View mode?

Jeff,

Did you try using

ArcherTech.UI.GenericContent.GetInstance().setFieldValue(changeid,valuearray,'');

Instead of

$CM.setFieldValue(changeId, valueArray, '');

 

Ideally, both are supposed to do the same. You reply to Ilya's question will give more insights.

$CM is a shortcut for ArcherTech.UI.GenericContent.GetInstance(), I believe

Oh I didn't know that.  Thanks Ilya.

Hi Ilya,

 

I am executing in Edit mode.

Hi Ilya and Arun,

 

I have tried both. The results are the same. The values list gets set but the record is not saved. 

Jeff,

 

By record no saving you mean, save action is not executed?