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

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Object to Set value list field

agrawalneha
Contributor III

Hi,

I am trying to set a value list field using a custom object. The code is working only when I click on the button after saving the record. I want the value to set when I click on the button and there should be no dependency on save.

Please let me know what correction I can do in below code:

 

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

     <a title="Set Value" class="tb-btn-link-left" id="btnSetValue" href="javascript&colon;void(0);" data-check-dirty="false">

          <div class="tb-btn" data-icon="&#xE348" data-icon-pos="left">Set Value</div>

     </a>

</div>

 

<script type="text/javascript">

     var integration = {

          statusFieldId:"20458",

          statusSubmit:"72568"

     };

 

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

        UpdateValuesList(integration.statusFieldId, integration.statusSubmit);

     });

 

     function UpdateValuesList(changeId, assignedValue) {

        var valueArray = new Array(1);

        valueArray[0] = assignedValue;

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

     }

</script>

0 REPLIES 0