Child Item Attachment

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

28 Nov 2016

Hello,


I have a child Item. If child item has any attachment, "ChildItemHasAttach" checkbox is checked in parent Item. It is possible?


Thanks.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

28 Nov 2016

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?

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

28 Nov 2016

http://prntscr.com/dcolvl


If it has one or more attachment, this checkbox has to checked.

YuriyMedvedev
Moderator
Posts: 33
Joined: Wed Sep 21, 2016

28 Nov 2016

Hi! Try this code in Javascript, please:

if ($(".ms-itmhover").find("img[src^='/_layouts/15/images/attach']").length > 0) fd.field("ChildItemHasAttachments").value(true);

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

09 Dec 2016


YuriyMedvedev
Moderator
Posts: 33
Joined: Wed Sep 21, 2016

09 Dec 2016

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); }

ksertkaya
Posts: 87
Joined: Wed Nov 18, 2015

14 Dec 2016

Thank you :)

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests