Skip to main content
added 18 characters in body
Source Link
JoannaW_MSFT
  • 6.6k
  • 1
  • 8
  • 10

Per my test, it works in library EditForm.aspx.

TheAre you using the same list as the source list of the lookup column is the same list?

The “Company1” from the code below is the column’s internal name. Ensure the internal name of your column in the document library is “Company1”.

OfficeFieldContext.Templates.Fields = {
            'Company1': {
                'EditForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render),
                'NewForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render)
            }
        };

To get the actual internal name for your column, browsing to the library Settings > Edit Column and look at the path.

The path will be like:

<site>/_layouts/15/FldEditEx.aspx?List=%7B<list GUID>%7D&Field=<column internal name>

enter image description here

Per my test, it works in library EditForm.aspx.

The source list of lookup column is the same list?

The “Company1” from the code below is the column’s internal name. Ensure the internal name of your column in the document library is “Company1”.

OfficeFieldContext.Templates.Fields = {
            'Company1': {
                'EditForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render),
                'NewForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render)
            }
        };

To get the actual internal name for your column, browsing to the library Settings > Edit Column and look at the path.

The path will be like:

<site>/_layouts/15/FldEditEx.aspx?List=%7B<list GUID>%7D&Field=<column internal name>

enter image description here

Per my test, it works in library EditForm.aspx.

Are you using the same list as the source list of the lookup column?

The “Company1” from the code below is the column’s internal name. Ensure the internal name of your column in the document library is “Company1”.

OfficeFieldContext.Templates.Fields = {
            'Company1': {
                'EditForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render),
                'NewForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render)
            }
        };

To get the actual internal name for your column, browsing to the library Settings > Edit Column and look at the path.

The path will be like:

<site>/_layouts/15/FldEditEx.aspx?List=%7B<list GUID>%7D&Field=<column internal name>

enter image description here

Source Link
JoannaW_MSFT
  • 6.6k
  • 1
  • 8
  • 10

Per my test, it works in library EditForm.aspx.

The source list of lookup column is the same list?

The “Company1” from the code below is the column’s internal name. Ensure the internal name of your column in the document library is “Company1”.

OfficeFieldContext.Templates.Fields = {
            'Company1': {
                'EditForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render),
                'NewForm': Function.createDelegate(officeFieldHandler, officeFieldHandler.render)
            }
        };

To get the actual internal name for your column, browsing to the library Settings > Edit Column and look at the path.

The path will be like:

<site>/_layouts/15/FldEditEx.aspx?List=%7B<list GUID>%7D&Field=<column internal name>

enter image description here