Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2019-08-13 03:11 PM
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!
2019-08-15 09:04 AM
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="" 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>
2019-08-15 09:10 AM
Amy are you getting any errors in the browser console via the developer tools?
Advisory Consultant
2019-08-15 09:26 AM
Nothing that seems entirely out of the ordinary:
2019-08-15 09:31 AM
Thanks, would help if I spelled the element id correctly
Change this, $('#btnSetValule').click(function(){
To, $('#btnSetValue').click(function(){
Advisory Consultant
2019-08-15 09:38 AM
Okay! Now it's actually throwing an error:
2019-08-15 09:41 AM
Progress
Change this, function UpdateValueList
to this, function UpdatesValueList
Advisory Consultant
2019-08-15 10:01 AM
New Error
2019-08-15 10:34 AM
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
2019-08-15 10:49 AM
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?
2019-08-15 10:59 AM
Is the field public or private?
Can you repost the custom object again?
Advisory Consultant