How to get only value of Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 07:26 PM
Hi,
I have 2 tables A and B.
In table A there is a field u_start_time: type Time in picture
In table B I have a field with Reference type Name.
I used name.u_start_time to get data from table A. But there is no return value. I log in to get its information as shown below.
Is there any way to get the correct value 01:00:00 from table A to table B?
Thank and Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 09:39 PM
Hi @Chronos ,
You can create business rule use below script to and query table A to get start time to TableB.
var grA = new GlideRecord('tableA');
grA.addQuery('query records as per your requirment');
grA.query();
while(grA.next()){
var grB = new GlideRecord('tableB');
grB.addQuery('name', grA.name);
grB.query();
if(grB.next()){
grB.u_start_time = grA.u_start_time.getDisplayValue();
grB.update();
}
}
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 10:28 PM
Hi, @Anand Kumar P
My idea would be to set onChange for name, so when it changes the start time will also change accordingly. Perhaps the business rule is not appropriate here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2024 10:34 PM
Hi @Chronos
If you are trying On change client script , then on change of name you can call a script include to return the date from table A.
Have you tried this approach ? any blocker if you try this?
Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anwesha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2024 12:27 AM
Hi @Anwesha3
I tried but I had a problem returning the time value