Is there a way I can add choices to the related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:29 PM
I would like to add a few choices to a field on the related list on my demand form. so that when I am on the details tab and I select field portfolio as integration, only then should the choices display on the demand task located on the related list section of the form. Is this something doable
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 03:31 PM
Dependent fields are absolutely doable. I'm unclear of whether or not you are using reference fields or choice fields so I've included both in my explanations below.
Option 1: Make the field dependent to filter out certain options based on a value in a different field. (For Choice fields.)
- Go into the Dictionary for the field that will depend on another field.
- Select the Dependent Field tab. (may need to change to view as Advanced view)
- Check 'Use dependent field'
- Select the field it depends on from the dropdown menu that appears below the checkbox.
- If a Choice can appear for multiple values in the dependent field, make multiple of the same Choice with the dependent value of the Choice being one of each of the values from the dependent field.
- Choice A: 111, Dependent value is A
- Choice B: 111, Dependent value is B
- Choice C: 111, Dependent value is C
Option 2: Use a Reference Specification with an Advanced qualifier for a dynamic return of (values/records from a list) available for the field. (For Reference fields.)
- Reference: Specify the table the field is referencing
- Use reference qualifier: Advanced
- Reference qual: javascript: 'field=valueorsys_id^field=valueorsys_id^field=' + current.field + '^EQ';
NOTE: Change the operators as needed for your query in the reference qual.
Option 3: Client Script to add/remove Choices options. (Also Choice fields.)
Example scripting:
//onLoad() example
function onLoad() {
if(g_form.isNewRecord() || g_form.getValue('field') == 'value'){
g_form.removeOption('field', 'value_of_option'); //for existing options
g_form.addOption('field', 'value_of_option', 'Label of Option', index#); //adds to end of list if index is not specified
}
}
//onChange() example
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if(newValue == 'value'){
g_form.removeOption('field', 'value_of_option'); //for existing options
g_form.addOption('field', 'value_of_option', 'Label of Option', index#); //adds to end of list if index is not specified
}
}
I hope some of this is helpful to you.