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

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom object: Button to update a list of values. The first time click, it does not update the value.

EliasTabarez1
Collaborator II

Hi, i added a custom object that set a value list. This is the code:

<div class="toolbar-app-buttons-left">
<a title="Review" class="tb-btn-link-left" id="btnSetValue" href="javascript&colon;void(0);" data-check-dirty="true">
<div class="tb-btn" data-icon="&#xE348" data-icon-pos="right">Submit Questionnaire</div>
</a>
</div>
<script type="text/javascript">
var integration = {
FieldIdStatus:"25407",
statusSubmit:"83873"
};

$('#btnSetValue').click(function(){
UpdatesDate(integration.FieldIdStatus, integration.statusSubmit);


});

function UpdatesDate(Status, assignedValue) {

var valueArray = new Array(1);
valueArray[0] = assignedValue;
$CM.setFieldValue(Status , valueArray, '');
$('#master_btnApply').click()

}
</script>

 

But when i click the first time, the value list is not updated. I need to click twice. What could be the problem?

Thanks in advance

9 REPLIES 9

Ilya_Khen
Champion III

EliasTabarez1,

Out of curiosity, I just pasted the code to my environment and works fine. 6.9 SP1 P5.

Hi Ilya, i checked that the code works fine if the value list is a radio button. If the value list is a dropdown list, we have more problems

Thanks!

Ilya_Khen
Champion III

I tested with dropdown, and it is still fine.

Hi, our version is Version 6.8 P4 HF2. I will try in other instance with 6.9.

Hi Ilya i did some tests i cheched this:

If the record has a empty value in the value list and i execute the custom object, works fine. I check that this process call to getvaluelist.

But if the record has a value selected and y want to change this to other, i checked that there isnt a call to getvaluelist. For this reason, when i click the first time, the value list change to empty. In the second click, because the custom object click the save button, the code works fine.

Could you confirm if you have the same behaviour?

Thanks

Ilya_Khen
Champion III

Nope, it works for me regardless what is the value before empty of another value. And I did not do any modification to your code except different IDs.

Hi Ilya, thanks for the information. In my instance, when i execute the code the first time, if the value list is filled, i checked that GetListvalue procedure is not called, but if is empty the call is executed y the code works fine.

Ilya_Khen
Champion III

Wonder if you can ask from support about your behaviour then.

Ok thanks, is possible this behaviour is related with the versión