- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
le 09-28-2017 07:31 AM
I have a date field that I need to copy to a date time field. Is there a way to do this? Do I need to append the time before I copy?
Résolu ! Accéder à la solution.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
le 09-28-2017 07:58 AM
You can copy it directly. By default it will end up with a midnight value on the date from the date field. Example:
var gr = new GlideRecord('table_name');
gr.get('SYS_ID');
gr.my_date_time = gr.getValue('my_date');
gr.update();
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
le 09-28-2017 08:20 AM
You are welcome. I've run in to that more times than I care to admit. FWIW, we covered a lot of this in Episode 36 of TechNow.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
le 09-28-2017 08:23 AM
Awesome, next thing on my list.
You are a ROCKSTAR!!!
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
le 09-29-2017 01:17 PM
Is it possible to use it in Catalog Client Scripts?
var myDate = newValue;
var gdt = new GlideDateTime();
gdt.setDisplayValue(myDate);
var sdate= gdt.getNumericValue();
g_form.setValue("end_date",sdate);
I used On Change client script but doesnt seem to work
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
le 09-29-2017 01:20 PM
GlideDateTime is not an available object in client scripts. You would be better served using GlideAjax to do the processing on the server in this case.
Episodes 5, 6, and 33 of TechNow talk about client scripting and GlideAjax.
Docs: Client Scripts
Docs: GlideForm
Docs: GlideAjax
Developer: Client Scripting Technical Best Practices Overview
