We have a Parent table as HR case and its child table as HR Task. In HR Case form there is a field known as "Effective Date" and same as in HR Task. I need to display the HR case Effective date value same as in HR task Effective date. Can please anyo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2015 08:17 AM
We have a Parent table as HR Case (Human Resources) and its child table as HR Task. In HR Case form there is a field known as "Effective Date" and same as in HR Task. I need to display the HR case Effective date value same as in HR task Effective date. Can please anyone help me with this ? Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2015 10:08 PM
The field is in both child and parent table separately? When you right click on the field on both table forms and press 'Show' What does table name display as when the pop up box comes up? If the field is on task - but is on both of these forms, there is no problem. If this is the case- and the HR Task is a task record for the HR Case record, there most likely is a field on the HR Task record that references the HR case record. Once you've confirmed that you can write a glide script to make sure both values for the field are the same. Here is some psedo code:
function fixEffectiveDate(){
var target = new GlideRecord('hr_task_table');
target.addNotNullQuery('effective_date');
target.query();
while(target.next()){
var case = new GlideRecord('hr_case_table');
if(case.get(target.case_reference_field)){
case.effective_date = target.effective_date;
case.setWorkflow(false);
case.update();
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2015 01:42 AM
Both the table have seperate fields.
In HR case table the element name is "u_effective_date" and in HR task table its "u_effective_date_1"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2015 01:57 AM
Hi Ismail,
Could you please tell me where to paste the given code? Because I tried and ran it in HR task effective date calculated value, but did not work. The value is not auto displayed which is in HR case.
Thanks,
Saurabh Chande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2015 02:35 AM
Why are you using two different fields if the value is same? You can use the parent field and that is why the concept of extending the tables.
Or is it only for few records the details are same and you want to copy from parent table?
Please clarify!