What is the best practice to be followed when I would like to add few functions in the OOB Script Include

Raji10
Tera Contributor

Hi All,

I have to add few functions in the OOB Script Include(reusing the other functions in the script include), but stuck with the dilemma between creating (duplicating) a new script include or modify the existing oob one. In the latter case, the challenge is to check the skipped file in every upgrade.

1 ACCEPTED SOLUTION

HI,

Let's say if you have a function in KnowledgeAccessSNC and you want to modify that function then what you should do is copy that function form KnowledgeAccessSNC and add it to KnowledgeAccess script include and modify that function here.

 

So what will happen is if you call the function as new KnowledgeAccess().functionName() then it will not use the function from KnowledgeAccessSNC but from KnowledgeAccess. if the function is not present here then it will use it from KnowledgeAccessSNC.

So basically KnowledgeAccess is used for overriding any function in extended Script include which is readonly or not recommended to modify.

 

Thanks,
Ashutosh Munot

View solution in original post

6 REPLIES 6

Raji10
Tera Contributor

Hi @Rafael Cardoso ,

Thank you for the information. Can you please verify if my understanding is right.

Let's say the 'KnowledgeAccessSNC' is an OOB script include, and it is being extended by an other customized script include 'KnowledgeAccess'. 

1. I can call the functions inside the OOB script include using the name of the customized script include.

KnowledgeAccess().canReadArticle();

2. If the function exists in the new script include, then the system runs the same, else it checks for the function in the OOB script include.

So, the order of priority is from customized script include which extends the OOB, and then the OOB.

 

Thanks & Regards,

Rajalakshmi

HI,

Let's say if you have a function in KnowledgeAccessSNC and you want to modify that function then what you should do is copy that function form KnowledgeAccessSNC and add it to KnowledgeAccess script include and modify that function here.

 

So what will happen is if you call the function as new KnowledgeAccess().functionName() then it will not use the function from KnowledgeAccessSNC but from KnowledgeAccess. if the function is not present here then it will use it from KnowledgeAccessSNC.

So basically KnowledgeAccess is used for overriding any function in extended Script include which is readonly or not recommended to modify.

 

Thanks,
Ashutosh Munot