Disable "new item" on related items when in display-mode

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
UDRO
Posts: 22
Joined: Mon Sep 21, 2020

17 Nov 2021

Hi,

I would like to put something like:

if(fd._formType() == 'Display'){
// code to disable "new item" on related item
}

in the Javascript of a form. Is this this possible?

Thank you, UDRO

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

17 Nov 2021

Dear UDRO,
You can do it with the following code:

Code: Select all

fd.relatedItems()[0].find('.ms-list-addnew').hide();
Replace 0 with the index of the Related Items control.
Cheers

UDRO
Posts: 22
Joined: Mon Sep 21, 2020

17 Nov 2021

Thank you!

UDRO

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests