- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 07:33 AM
Hello ladies and gentlemen,
I would like to know how to show the list of record from the same table in a widget.
I have a balise <div></div> and i would like to have each line a record from the table ( if possible display only specifics fields and have the record filtered)
Best regards,
Maxime Nguyen.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2017 12:42 AM
Hi Rushit,
Thanks for your answer, while it is true that it display records from table i wanted to do code it, I found a way to display the list without calling an widget, here is an example:
HTML Template
<p ng-model="typevm" ng-change="c.Calcul_Price()">
<a
ng-repeat="item in data.type_vm"
value="{{item.value}}">
{{item.label}} <br/>
</a>
</p>
Server Script
var grTypeVM = new GlideRecord('sys_choice');
grTypeVM.addEncodedQuery( ' ..... ' );
grTypeVM.query();
data.type_vm = [];
while (grTypeVM.next())
{
var record ={};
var fields = grTypeVM.getFields();
for (var i = 0; i < fields.size(); i++) {
var glideElement = fields.get(i);
var name = glideElement.getName();
if (name.indexOf("sys_") == -1)
record[name] = grTypeVM.getValue(name);
}
data.type_vm.push(record);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 08:08 AM
Hi,
there is Data Table(widget-data-table) widget out of box which you can add to any page you want...then you can configure instance options where you can specify table name , fields and filter.
then
and you have to mention which view to show like below...then create/update list view with whatever fields you want to show
(please mark helpful/like/correct if it helps)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2017 12:42 AM
Hi Rushit,
Thanks for your answer, while it is true that it display records from table i wanted to do code it, I found a way to display the list without calling an widget, here is an example:
HTML Template
<p ng-model="typevm" ng-change="c.Calcul_Price()">
<a
ng-repeat="item in data.type_vm"
value="{{item.value}}">
{{item.label}} <br/>
</a>
</p>
Server Script
var grTypeVM = new GlideRecord('sys_choice');
grTypeVM.addEncodedQuery( ' ..... ' );
grTypeVM.query();
data.type_vm = [];
while (grTypeVM.next())
{
var record ={};
var fields = grTypeVM.getFields();
for (var i = 0; i < fields.size(); i++) {
var glideElement = fields.get(i);
var name = glideElement.getName();
if (name.indexOf("sys_") == -1)
record[name] = grTypeVM.getValue(name);
}
data.type_vm.push(record);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2017 12:48 AM
yes..you can always code stuff...fetch any data from server and display using HTML.
my answer was more related to Out of box functionality and for someone who is not pro at coding