- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 07:41 AM
Dear All,
I have a "table name" type field whose base table is alm_asset. According to my requirement it should show all extended tables except one/two. Also it shows table name in bracket i.e. dropdown value are in format ... Hardware[alm_hardware] etc, which we don't want.
To implement this I have added tableschoicescript attribute in the field and hardcoded extended table names there..
But problem is that I want first option to be "--None--" but in the field by default some other value is coming from script include (one of the table name) when I open the form .It is proper if I click the dropdown.
I wrote a client script to to add "--None--" in index 0..but nothing is helping..
Can somebody suggest me way to achieve this..Please check screenshots for reference.
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 11:53 PM
I haven't used that Attribute before so I am not sure how to do it at source (Script include)
But DOM manipulation is unnecessary and you can add a onload script for this.
g_form.addOption('u_table_choice_example','','-- None --',0);
g_form.setValue('u_table_choice_example','');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 11:24 AM
Deepa,
If your field is mandatory, then the following script will work. If it is not mandatory, DOM manipulation is the only way I could think of to achieve your requirement.
onLoad Client script:
g_form.addOption('u_table_name','','-- None --',0);
if(g_form.isNewRecord()){
$('incident.u_table_name').options[0].selected=true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 11:27 PM
Field is not mandatory Abhinav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 11:43 PM
Thanks Abhinav for your help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 11:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2016 11:42 PM
Yes Kalai checked with this too..
But Abhinav's approach is working as that field is becoming read only after submission and value is not changing...