3 basic tips to remember during Plugins development

Below are some basic tips that I always recommend to use during the development of plugins to increase the stability and robustness of the code:

1 – Use context.depth property

Useful to check all those situations in which the code in a plugin causes the activation of the same plugin generating a loop!

2 – Use GetAttributeValue instead of Entity.Contains for attributes

Useful to manage the given key was not present in the dictionary error! This approach returns a Null value or Default Value if attribute is not present into attribute collections and you will manage a logic correctly.

3 – Do the Entity Check

Useful to check if the plugin is fired from your target entity.

Add in the comments below your tips to not be forgotten!

Hope it helps and happy 365Power’ing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.