How to set the value of dropdown form field to null, when the field is disabled
Hi, I have multiple dropdown fields in a form. For example i have 3 dropdown fields called 'list1', 'listA' and 'listB'. Thanks to @Christopher gillis for his blog, i can able to disable 'listB' dropdown field when the value of 'list1' is 'listA' . similary, disables 'listA' dropdown field when the value of 'list1' is 'listB'. my Problem is when i add an item, if i choose 'listA' from dropdown field 'list1', it enables 'listA' and i will choose a value call as 'Pannelleria' from dropdown list 'listA'. After sometime when i want to edit the item, i want to change the value of 'list1' from 'listA' to 'listB', i could able to disable the 'listA' and set the value to null on the form page and enables the 'listB' dropdown list. At this point, the value of dropdown field 'listA' is not set to null in database, instead it showing the value as 'Pannelleria'. i'm missing some code which give access to update the value in database. I attached following method in form events under OnFormPopoulate. Any suggestions or help is appreciable.! As i'm not a hard core programmer, improvising my code is also appreciable which helps me in learning. I'm working on Aras V12.0 thanks. regards, Venkat. var input = document.getElementsByName("list1")[0]; var input1 = document.getElementsByName("listA")[0]; var input2 = document.getElementsByName("listB")[0]; setTimeout(function(){ if(input.getElementsByTagName("input")[0].value == "listA"){ input2.getElementsByTagName("input")[0].value = ""; input2.getElementsByTagName("input")[0].disabled = true; input2.getElementsByTagName("button")[0].disabled = true; input1.getElementsByTagName("input")[0].disabled = false; input1.getElementsByTagName("button")[0].disabled = false; } else if (input.getElementsByTagName("input")[0].value == "listB"){ input1.getElementsByTagName("input")[0].value = ""; input1.getElementsByTagName("input")[0].disabled = true; input1.getElementsByTagName("button")[0].disabled = true; input2.getElementsByTagName("input")[0].disabled = false; input2.getElementsByTagName("button")[0].disabled = false; } },100);2.7KViews0likes0CommentsDisable value in list
Hi everyone Quite often we need to disable a value in a list, but previously created items with the value is still valid. Does anyone have a suggestion to a solution? Example: On our Part form we have a dropdown list called "Item Type". A value in the list needs to be disabled so it can't be used when creating new parts. The value is still valid for all previously created parts. Only option in Aras is to delete the value in the list, but this leaves us with another issue. When a user opens an old part with this value, which is allowed on old parts, the dropdown field is blank even though the value is still in the database. In our ERP system all list values have checkboxes to disable a value. If the checkbox is ticked the value is no longer selectable but items which already have this value still shows correctly. This can't be specific for us, so I hope someone have a solution. Thanks in advance. Regards Henrik Olesen Kamstrup A/S Denmark5.7KViews0likes3Comments