Child Item Attachment

rss

Posted by ksertkaya - Nov 28 ’16 at 12:43

Hello,

 

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

 

Thanks.

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 15 days
    #1 by Dmitry Kozlov Nov 28 ’16 at 02:30

    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
    Member
    Member for: 6 years 17 days
    #2 by ksertkaya Nov 28 ’16 at 03:58

    http://prntscr.com/dcolvl

     

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

  • YuriyMedvedev
    Moderator
    Member for: 5 years 2 months 10 days
    #3 by YuriyMedvedev Nov 28 ’16 at 10:00

    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
    Member
    Member for: 6 years 17 days
    #4 by ksertkaya Dec 9 ’16 at 12:21

    Not work :/

    http://prntscr.com/dh69wx

  • YuriyMedvedev
    Moderator
    Member for: 5 years 2 months 10 days
    #5 by YuriyMedvedev Dec 9 ’16 at 07:28

    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
    Member
    Member for: 6 years 17 days
    #6 by ksertkaya Dec 14 ’16 at 01:17

    Thank you smile

Displaying 1 to 6 of 6 messages