Add DropdownList with values

I  added a dropdownlist on a form, I am unable to make reference to the dropdownlist object via name or type in Javascript. And the object doesn't seem to exist when viewing HTML source. I am trying to populate the dropdownlist  with some values when the form is loaded. But I haven't been able to get the object. Can anyone help?
  • Hello, Could you elaborate on your use case for dynamically populating this dropdown? In the projects I've worked on, I've found that it's easier to accomplish this by manually creating an HTML field with a select. You can make this select look like a normal Aras dropdown by using the CSS below.
    .toolbarDropdown { /* Add this class to your <select/> tag in the HTML Field */
    display: inline-block;
    padding: 0 2.00033333rem 0 0.33333333rem;
    border-radius: 0;
    border: 1px solid #505050;
    height: 1.667rem;
    appearance: none;
    vertical-align: top;
    margin-top: 4px;
    -webkit-appearance: none;
    background: url("data:image/svg+xml;charset=UTF-8,%EF%BB%BF%3Csvg%20version%3D%221.1%22%20id%3D%22id1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewBox%3D%220%200%2022%2022%22%20enable-background%3D%22new%200%200%2022%2022%22%20xml%3Aspace%3D%22preserve%22%20preserveAspectRatio%3D%22xMaxYMin%20meet%22%3E%0D%0A%3Cg%3E%0D%0A%09%3Crect%20x%3D%220.478%22%20y%3D%220.478%22%20fill%3D%22%233668b1%22%20width%3D%2221.043%22%20height%3D%2221.043%22%2F%3E%0D%0A%09%3Cpath%20fill%3D%22%233668b1%22%20d%3D%22M21.044%2C0.957v20.087H0.957V0.957H21.044%20M22%2C0H0v22h22V0L22%2C0z%22%2F%3E%0D%0A%3C%2Fg%3E%0D%0A%3Cpolygon%20fill%3D%22%23FFFFFF%22%20points%3D%227%2C9%2015%2C9%2011%2C14%20%22%2F%3E%0D%0A%3C%2Fsvg%3E%0D%0A") right top no-repeat;
    background-color: #ffffff;
    }
    After setting up the HTML Field, you can look at this sample for adding an option to a select programmatically. Chris
    Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, The idea is to display a list of teams that a logged-in user belongs to. And the list should only contain the Teams a user is part of.  So when adding a part, the user must nominate which the team is the part for. As you can see on related post, where I also had issues setting the value of  a textbox which is bound to the teamId based on the selection from the list. Alternatively I can use the default UI object linked to the team_id property, but how do I filter the Teams Search pop-up window to show only the teams that that user belongs to?
  • Hello, You can get a comma-separated list of all of the Identities that a user belongs to in JavaScript by using aras.getIdentityList(). You can then run an AML query like below in order to get all of the Teams that have a member in that list.
    <AML>
    <Item type='Team' action='get'>
    <Relationships>
    <Item type='Team Identity' action='get'>
    <related_id condition='in'>PASS_IDENTITY_LIST_IN_HERE</related_id>
    </Item>
    </Relationships>
    </Item>
    </AML>
    You can call this AML query using aras.applyAML(aml) or aras.IomInnovator.applyAML(aml) and use the results to populate your list of Teams. Chris
    Christopher Gillis Aras Labs Software Engineer