This week Clemente Raposo, Lead Developer of SuiteCRM, explains how to use Field Definition Mappers in SuiteCRM 8.
Field Definition Mappers are designed as a favourable way to manipulate field behaviour or to change how fields display. They allow you to transform the original values before they are processed just after the field definitions (vardefs) are fetched. Additionally, Mappers work independently, so it is possible to add as many as you need and can be defined to apply across all modules or just for a specific module. Overall, Field Definition Mappers are a great way for you to extend SuiteCRM 8 to work just the way you want it to.
In today’s example, we are going to demo an alternative way to define updating field value based on a backend calculation, using an example that changes the priority field in Cases based on the subject value. Watch this week’s video to learn all about Field Definition Mappers, and be sure to check below to get the code example to help you get started.
Below you will find the code sample from the video:
extensions/defaultExt/modules/Cases/FieldDefinitions/Mappers/PriorityCalculationLogicDefinition.php
extensions/defaultExt/modules/Cases/Service/Fields/CaseCalculatePriority.php
This sample can be used as an example to add your own Field Definition Mappers based extension in SuiteCRM.
If you are looking for more development insights, the Development Team here at SalesAgility have created instructor-led Masterclasses. Designed for developers, covering both SuiteCRM 8.x and SuiteCRM 7.x, head over to the MasterClasses to find out more.
About SuiteCRM
SuiteCRM is one of the world’s most popular CRM applications. Our feature-rich enterprise-ready alternative to Salesforce enables your sales teams to sell, market & service smarter. Providing all the benefits of CRM at substantially lower costs, with the freedoms and flexibility of Open Source.
You can download and host SuiteCRM on your own servers, in the public cloud / private cloud or try our SAAS offering SuiteCRM Hosted. It is the ultimate freedom, allowing you to stay in full control over your business data. Try SuiteCRM for free here.
Help support the SuiteCRM project by becoming a sponsor today!