How to set default value for reference field , only when that field value is empty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:17 PM
Hi ,
I want to set default value in parent field (type reference), only when the field value is empty.
i have given this below code line :
javascript:current.parent= current.parent_activity.parent.toString();
but looks like not working .
Can anyone help with this code.
Thanks in advance
Kalyani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:59 PM
Hi @kalyani23
On which table you have this field ? Also, could please elaborate a bit on your requirement through screenshots ?
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 11:13 PM
Hi Amit,
The table used here is Skill tracker Activities . and it contains fields such as Activity code /Parent activity/Parent.
record 1 - Activity code- LSNVSPV273 and parent - STREQ0001084
record 2. in same table i am creating child record for the above activity code record
show it shows parent activity as above record (LSNVSPV273 ), also i want it to show parent value same as above that is (eg.STREQ0001084).
i tired executing the above query , it is returning correct sys_id. but the preview record is showing unavailable .
Thanks & Regards,
Kalyani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 11:32 PM
Hi @kalyani23
Have you tried using Auto-Populate feature which I highlighted earlier ? Also, to which table is the field "Parent" is being referred ?
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 12:02 AM
Hi Amit,
As i mentioned earlier , i couldnt find the autopopulate tab here . I am trying to set default value in dictionary override of a parent field in task table (global).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 11:50 PM - edited 01-24-2024 11:51 PM
Hi @kalyani23
Have you tried the Default value in the field dictionary?
The default value populates the field on the blank form for a new record, and also subsequently when the new record is submitted if the field is empty.
Specify a default field value
In your case it could be like below.
javascript:current.parent_activity.parent.toString();
Cheers,
Tai Vu