How to get date field value from one table and copy the same date into another table date field value??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2017 07:37 AM
Hellooo everyone,
I am trying to create a new change request from release module and i need to do the below task while doing so..
I have two date fields in release table called "Planned start date" and "Planned end date" and I need to reflect these dates same as in release table in the change table date fields called "Planned start date" and "Planned end date".
Here both date fields from both tables are having the same field names as "start_date" and "end_date".
I have written the below client script code but it's not working for me, please suggest me a solution for this??
function onLoad() {
//Type appropriate comment here, and begin script below
var rel = g_form.getReference('rm_release', getdatevalues);
g_form.setValue('u_reason_for_invoking_change','Release');
g_form.setValue('start_date','start');
g_form.setValue('end_date', 'end');
function getdatevalues(){
if(rel != '' & state == -5){
var start = g_form.getValue('start_date');
var end = g_form.getValue('end_date');
}
}
}
here's the output i got for the above code:
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2017 06:09 AM
Tomasi,
Thanks you so much for your response and stopping by...
I have tried the above one as you said and it's still the same issue, I am not getting anything in the date field, Can u please suggest me any script here as I am not able to enter anything in the end date default value..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 06:49 AM
Q: Are you populating a new form (starting with nothing) and then putting in a release, and expecting the start/end dates to automatically populate based on the new value in the release?
This makes a difference to determine how/when to get the values associated on that release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2017 02:32 AM
Tomasi,
Yes, I am doing the same...Can u please suggest me how can i do this???

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2017 05:19 AM
Take a look at michael.ritchie's utility called getReferenceAdvanced. You can trigger it from your onLoad client script.
getReferenceAdvanced, g_form.getReference and GlideAjax Alternatives
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2017 07:06 AM
Tomasi,
I have worked out this porblem with the below code: Using client script
I took the release field on change form as referrence and worked out this one, Anyway thank u so much for your help.
function onLoad() {
//Type appropriate comment here, and begin script below
var rel = g_form.getValue('rm_release');
var start = g_form.getValue('rm_release.start_date');
var end = g_form.getValue('rm_release.end_date');
var count = g_form.getValue('sys_mod_count');
if(rel != '' && count <=0){
g_form.setValue('start_date',start);
g_form.setValue('end_date',end);
g_form.setValue('u_reason_for_invoking_change', 'Release');
}
}