- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 05:34 AM
Hi,
I have a requirement to select a record and populate two other fields based on the record selected
I have added location table record picker but i am unable to proceed further on how to read the selected record sys id and populate the fields based on the selected value
Below are the changes i added on html and client controller of the widget
HTML:
<sn-record-picker field="location" table="'cmn_location'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" ></sn-record-picker>
Client controller:
$scope.location = {
displayValue: c.data.loc.name,
value: c.data.loc.sys_id,
name: 'location'
};
$scope.$on("field.change", function(evt, parms) {
if (parms.field.name == 'location')
c.data.setLocation = parms.newValue;
c.server.update().then(function(response) {
spUtil.update($scope);
})
});
Please let me know how to read the value and get the two fields populated. Also please confirm if the above process is correct
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 10:22 AM
Moulik,
Please take a look at the example I have posted on serviceportal.io:
https://serviceportal.io/sn-record-picker/
Then you can download the completed example I posted on Share which does exactly this:
https://share.servicenow.com/app.do#/detailV2/86b23f151370e2001d2abbf18144b0aa/overview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 10:22 AM
Moulik,
Please take a look at the example I have posted on serviceportal.io:
https://serviceportal.io/sn-record-picker/
Then you can download the completed example I posted on Share which does exactly this:
https://share.servicenow.com/app.do#/detailV2/86b23f151370e2001d2abbf18144b0aa/overview
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2018 02:32 PM
Hi nathanfirth
At The Same Time I Want To Show Another Table Values Also When I Am Selecting Location , I want to display some another table value also, i have reference field in another table
please help me out nathanfirth
Thanks
Dinesh kumar