What are Extensions in - GlideScriptedExtensionPoint ?

Raji10
Tera Contributor

Hi All,

I just wanted to understand what does the method getExtensions returns in the GlideScriptedExtensionPoint?

 

Why the methods defined in the extension point has to run N number of times (Extensions)?

For example:

var eps = new GlideScriptedExtensionPoint().getExtensions("CanReserve");
			eps.forEach(function(ep)
						{
				if(ep.handles(thing))
					{
						canReserve = ep.canReserve(thing,from,until,by);
					}
			});

Thanks & Regards,

Raji.

6 REPLIES 6

this article link is not working

Chavan AP
Tera Guru

Hi Raji,

 

will you read the below article, I hope u will have a clear understanding of it

 

https://codecreative.io/blog/are-extension-points-worth-it/

 

do mark helpful in response

Regards,

Ajay

Chavan AP
[ Architect | Certified Professional]

Was this response helpful? If so, please mark it as Helpful and Accept as Solution to help others find answers.

Raji10
Tera Contributor

Hi Both,

Thank you for your quick response, I have gone through these articles earlier to my question in the forum. My only doubt is what is the necessity of running all the extensions with the same name and then storing it in the same variable (Only the last extension will be stored in the ), you can refer to the below script, 

var eps = new GlideScriptedExtensionPoint().getExtensions("CanReserve");
			eps.forEach(function(ep)
						{
				if(ep.handles(thing))
					{
						canReserve = ep.canReserve(thing,from,until,by);
					}
			});

Thanks & Regards,

Raji.