Uncaught ReferenceError: EntityEditorCallback is not defined

Harshavardhan 21 Reputation points
2020-08-31T04:06:17.723+00:00

Dear All,

I am using the below code to pick the selected user details in people picker.
var invokeAfterEntityEditorCallback = function(func) {
var old__EntityEditorCallback = EntityEditorCallback;
if (typeof EntityEditorCallback != 'function') {
EntityEditorCallback = func;
} else {
EntityEditorCallback = function(result, ctx) {
old__EntityEditorCallback(result, ctx);
func(result, ctx);
}
}
};

The above code works only with VPN/within my company network, if i diconnect VPN/outside company network, sometimes i get the below error.

21406-image.png

Any idea please......................

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,340 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,608 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-08-31T08:01:33.91+00:00

    The network should only affect whether some js files can be imported correctly, you need to check whether this variable is already defined in the js file that needs to be imported.
    I don’t know the context of this code, so the suggestion I could give is if EntityEditorCallback is not defined before, add a statement defining it before this code.

     var EntityEditorCallback;
    

    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.