There is no hard and fast rule for what way to go, it all depends on your needs, risk appetite, available capital and capabilities.
Here are five reasons we think you should build it yourself versus buying it:
Ownership
It's yours and does everything your business needs and everything it doesn't. If you take a product-centric approach to building it, you may even be able to make money selling it to others who don't want to build.
Cost
You won't waste money for features you don't need and will reduce dependence on licences. The initial capex may be more expensive than off the shelf software, but the through life costs are usually less, making it a good medium term business case.
Fit for purpose
As you are building for what you need, it will help improve the way you do business. If you are in an industry with unique requirements, you may be able to develop a competitive advantage over those who implemented off the shelf options.
Adaptability
Need a new feature? Your customer and employee feedback can potentially be adopted quicker through proactive product management. You won't have to wait to see if enough "other customers" justify it being added.
Integrated
Since you are building the software it will naturally integrate with your existing systems possibly saving time and money when compared with off the shelf products.
If you prioritise control and customisation, or have a unique problem to solve, building may be right for you, but don't take just this list's word for it.