Page 1 of 1
Child Item Attachment
Posted: 28 Nov 2016
by ksertkaya
Hello,
I have a child Item. If child item has any attachment, "ChildItemHasAttach" checkbox is checked in parent Item. It is possible?
Thanks.
Re: Child Item Attachment
Posted: 28 Nov 2016
by Dmitry Kozlov
Hi,
Could you describe the case in more detail? What if there are more than one child item? How the child items are linked to the parent item? Does a user add child items from the parent form or somehow else?
Re: Child Item Attachment
Posted: 28 Nov 2016
by ksertkaya
http://prntscr.com/dcolvl
If it has one or more attachment, this checkbox has to checked.
Re: Child Item Attachment
Posted: 28 Nov 2016
by YuriyMedvedev
Hi! Try this code in Javascript, please:
if ($(".ms-itmhover").find("img[src^='/_layouts/15/images/attach']").length > 0) fd.field("ChildItemHasAttachments").value(true);
Re: Child Item Attachment
Posted: 09 Dec 2016
by ksertkaya
Re: Child Item Attachment
Posted: 09 Dec 2016
by YuriyMedvedev
Hi! Try to add CSS-class to Related items, for example "related-items" and then change js-code to this:
if ($(".related-items").find("img[src^='/_layouts/15/images/attach']").length > 0) { fd.field("ChildItemHasAttach").value(true); }
Re: Child Item Attachment
Posted: 14 Dec 2016
by ksertkaya
Thank you
