- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 09:44 PM
hi guys
i want to populate my location value in a drop down from location table and on click of submit i want to select that value so would you pls share jelly script for this..
thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 07:01 AM
Hi Mithlesh,
Since you are asking for jelly script I hope you are trying this in a UI Macro or UI Page. For pulling values from database and load the drop-down options see below code in bold.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_location" object="true">
var location = new GlideRecord('cmn_location');
//location.addQuery('country','USA'); //Give the query filter condition if any as per your requirement
location.query();
location;
</g:evaluate>
<select id="location">
<option value="">-- None --</option>
<j:while test="${jvar_location.next()}">
<option value="${jvar_location.getValue('name')}">${jvar_location.getValue('name')}</option>
</j:while>
</select>
</j:jelly>
And you also mentioned that you want to select the value on Submit. In case if you using this macro in a catalog item form, you can do that from an onSubmit catalog client script on the relevant catalog item level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 06:57 AM
Hi Mithlesh,
You can refer to the OOB UI page bsm_options_dialog
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 07:00 AM
The URL of the UI Page for it should be something like the following:
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-09-2015 07:01 AM
Hi Mithlesh,
Since you are asking for jelly script I hope you are trying this in a UI Macro or UI Page. For pulling values from database and load the drop-down options see below code in bold.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_location" object="true">
var location = new GlideRecord('cmn_location');
//location.addQuery('country','USA'); //Give the query filter condition if any as per your requirement
location.query();
location;
</g:evaluate>
<select id="location">
<option value="">-- None --</option>
<j:while test="${jvar_location.next()}">
<option value="${jvar_location.getValue('name')}">${jvar_location.getValue('name')}</option>
</j:while>
</select>
</j:jelly>
And you also mentioned that you want to select the value on Submit. In case if you using this macro in a catalog item form, you can do that from an onSubmit catalog client script on the relevant catalog item level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2015 06:59 AM
thanks Guhan its working but i have one more dout i want to set a reference field on my custom table from my location table ..means the value which select from drop down its should update in my custom table column which is a reference field