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:24 PM
Hi @kalyani23,
Check if its empty or not
if (!current.parent) {
current.parent = current.parent_activity.parent.toString();
}
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
01-24-2024 10:36 PM
Hi Anand,
I tried giving the above code as u mentioned , but it showing as no preview available .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:47 PM
Hello @kalyani23 -
What specific value are you attempting to set to the parent field?
Could you please share more details about the specific value you intend to set in the parent field? This additional information will help me provide you with a more accurate solution.
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:53 PM
Hi Pratiksha,
as shown in this image i want set parent field , which is a reference filed .
the parent activity referenced record contains parent value . i want to set the same value here.