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

You have officially stumped me Mathura.

 

I just tried the same exact code in my 6.4 P3 environment and had no problems what so ever. I have no clue on why it's not working for you.

 

Last ask, screenshot of the layout tab.

 Advisory Consultant

Here are the snaps of front as well as back end. I just have 1 section with 2 fields.Front End.PNGBack End.PNG

Maybe you use not vanilla IE, but with customized strict GPO or adblocker?

 

Also, you are using correct role, which has rights to perform save on the application right?

 

If so, I would try also use animation post back instead of click handler. Maybe you have some other custom object which unbinds click handler.

Thanks.

 

On the front end screenshot, the Test Values List has a value of Yes, was that you or the script that set the value?

 

At this point I don't know what's causing your issue.  This is what I used in my test environment and had no issues setting the values list (set a drop-down) and saving the record.

 

<script type="text/javascript">
        var integration = {
                statusFieldId:"20720",
                statusSubmit:"71379"
        };

        function UpdateValueList(changeId, assignedValue) {
                var valueArray = new Array(1);
                valueArray[0] = assignedValue;
                $CM.setFieldValue(changeId, valueArray, '');
                $('#master_btnSave').click();
        }
</script>


<div style="text-align:center;">
        <img id="btnSaveAsDraft" src="BackgroundImageGenerator.axd?className=StyledButton&classProperties=caption:Set+Value;iconSetStyle:VistaRound;baseColor:%23DDDDDD;disabled:False" onclick="javascript:UpdateValueList(integration.statusFieldId,integration.statusSubmit);" style="text-align:center;"/>
</div>

 Advisory Consultant

David Petty‌ --- It should not matter that it appears his record is new and has never been saved... Right?

Normally, I would think we're doing all front-end stuff. but it was one thing that popped out at me when I looked at his snapshots (there's no tracking id). I wouldn't think that would matter, but just thought I'd ask. 

Correct, setting a field value has no barring on if the record is new or existing.

 Advisory Consultant

How about the extra comma?

 

 var integration = {

   fieldID:"11111", 

   valueID:"22222"

 };    

<script language="javascript">

var integration = {

fieldID:"23966",

valueID:"84163",

};

I was going to point that out but Mathura was getting the proper values in the alerts so I didn't think it break the call to set the value.

 

Mathura Kushwaha‌ you can try removing the comma Jason pointed out above and see if that makes any difference.

 Advisory Consultant

Thank you again David and Jason. I tried after removing that comma which Jason pointed but it didn't work .

Mathura, I'm truly at a loss on this isn't working for you.  The code I posted above (https://community.rsa.com/message/917280?commentID=917280&et=watches.email.thread#comment-917232 ) works perfectly fine for me.  You can try replacing what you have with that one and see or you can also delete the original custom object you have and create a new one to see if there's some type of corruption with that one.

 Advisory Consultant