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

Mathura, have you verified that the fieldID variable is correct for the values list field?  Also verify that the valueID variable is correct for the value id of the value you want to set for the values list.

 

Also make sure that the values list field is on the layout as well.

 Advisory Consultant

Thank you David for your response!

I want it to save the record after changing the value list. The ids are all good and the code works but it is not moving after the below statement:

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

 

Thanks,

Mathura

2 things that come to mind.

1. are you in edit mode when you're doing this?

2. wrap the function in a try catch and see if you can log an error.

If the values list display configuration is set to values pop-up, try changing to something else.

 Advisory Consultant

Hi Jason,

 

I am trying it in edit mode. I will check how it works with try and catch.

 

Thanks,

Mathura

David, Its a drop down field. I also tried with radio button, list & check boxes but it didn't work.

The only other thing I can think of is that the field is on the layout, but is it in a tab set that's not selected at the time the button is clicked?

 Advisory Consultant

Its on the layout but not in any tab set. I have also tried the code in a test application, with only one section, it worked but couldn't save the record.

So let me take step back so the line, ArcherTech.UI.GenericContent.GetInstance().setFieldValue(changeId, valueArray, ''); is setting the values list properly, but its the $("#master_btnSave").click(); that's not working?

If so what errors are appearing the browser console window when you display the developer tools?

 Advisory Consultant

mkushwaha1
Contributor III

This is what I see in the developer tools. I believe there is an issue with the below line because it doesn't execute any other statement after it. I tried it with alert code.

 

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

 

error.PNG

 

here is the code from scriptresource.axd line 188 :

{var layoutItem=$LM.getLayoutItemById(field.layoutId);if(layoutItem&&layoutItem.display==ArcherTech.Enums.LayoutItemActionType.ReadOnly)