Dynamically Updated Drop Down List & Custom Part Number

Former Member
Former Member
I have a need for a custom smart part number which embeds a 2 digit program code and then a 4 digit sequential number.  The system I have in mind is as follows: YYZZZZ.  Where YY is the program code and ZZZZ is then a sequential number. I've added a program code property to the program item type. I've also populated Aras with a few programs and program codes.  I'd like add a drop down menu to the parts form which allows a user to select the program and then when the part is saved, Aras automatically generates a PN which includes the program code and sequential number.  I have the sequential number part working. Reading through the forums, it seems like I need the list to dynamically update but I don't know how to set that up.
Parents
  • Hello, If you can set the type of this field to Listbox Single Select instead of Dropdown, you can use the sample below in order to add options dynamically as part of an onFormPopulated client event.
    var selectObj = document.all.YOUR_LISTBOX_FIELD_NAME;
    var opt = document.createElement("option");
    selectObj.options.add(opt);
    opt.innerText = "MY LABEL";
    opt.value = "MY VALUE";
    One possibility is to perform a query for your programs, loop through the programs returned, and then call the code above inside the loop to add an option for program. Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hello, If you can set the type of this field to Listbox Single Select instead of Dropdown, you can use the sample below in order to add options dynamically as part of an onFormPopulated client event.
    var selectObj = document.all.YOUR_LISTBOX_FIELD_NAME;
    var opt = document.createElement("option");
    selectObj.options.add(opt);
    opt.innerText = "MY LABEL";
    opt.value = "MY VALUE";
    One possibility is to perform a query for your programs, loop through the programs returned, and then call the code above inside the loop to add an option for program. Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data