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

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make Custom Object Button Change Value in Values List

AmyJoJarboe
Contributor III

Hello All,

I'm still very new to Archer, but I'm trying to make a Custom Object Button that will change a value in a values list. I've seen a lot of samples, but they don't make much sense. Can someone please break this down very simply for me? I can create a button, I'm just really struggling on creating JavaScript that works to change a value in a values list.

Thank you!

25 REPLIES 25

David PettyGeoff Taylor Here is my code. For whatever reason, it still won't change the drop down. Additionally, I'm running Archer v6.4.1:

<div class="toolbar-app-buttons-left">
   <a title="Set Value" class="tb-btn-link-left" id="btnSetValue" href="javascript:void(0);"    data-check-dirty="false">
      <div class="tb-btn" data-icon="&#xE348" data-icon-pos="left">Submit</div>
   </a>
</div>

 

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

   $('#btnSetValule').click(function(){
   UpdateValuesList(integration.statusFieldId, integration.statusSubmit);
   });

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

Amy are you getting any errors in the browser console via the developer tools?

 Advisory Consultant

Nothing that seems entirely out of the ordinary:

pastedImage_1.png

Thanks, would help if I spelled the element id correctly

 

Change this, $('#btnSetValule').click(function(){

 

To, $('#btnSetValue').click(function(){

 Advisory Consultant

Okay! Now it's actually throwing an error:

pastedImage_1.png

Progress

 

Change this, function UpdateValueList

 

to this, function UpdatesValueList

 Advisory Consultant

New Error 

pastedImage_1.png

It looks like the custom object can't find the field.  Is the field id correct? Is the field on the layout or is it on a tab that's not visible?

 Advisory Consultant

Yes, the field ID is correct and the field is on a visible layout. Right now, I have the application in Development status, could that be causing it?

Is the field public or private?

 

Can you repost the custom object again?

 Advisory Consultant