How to modify Field’s Caption and Data box alignment in Sage CRM?

By | November 21, 2016

As we all know Sage CRM is considered to be an easily customizable software solution as per the client needs. The standard CRM solution itself allows many easy ways to make the customization whereas, it also supports Client Side Scripting to achieve the same.

New Stuff: Business Manager in Sage CRM

The field’s arrangement in standard CRM is done as shown below, where the field’s caption and its data entry box are parallel to each other.
Img2
But recently, one of our Client had a requirement to design a screen as a Form entry page; where the field caption and the data entry box will be adjacent to each other. This requirement was not feasible in standard CRM. And thus to achieve the same, we applied a client side script.

Add the below code in a js file and call it on custom content of the screen where you want to apply the changes –

<script>
crm.ready(
function AlignFields()
{
if(document.getElementsByClassName(“CONTENT”))
{
$(‘.CONTENT br’).replaceWith(‘ ‘);
}
if($(‘.CONTENT’))
{
$(‘.CONTENT br’).replaceWith(‘ ‘);
}
})
</script>

After applying the script, screen will look as shown below –
Img1
For the script to make the changes, make sure that all the fields on the screen are separated with a space as per the standard settings.
Also Read:
1. Adding Report Button on Opportunity Pipeline using JAVASCRIPT
2. JavaScript to print Amount (In Words)
3. Calling Javascript function from Workflow progress screen
4. JavaScript to Calculate days difference between dates (Duration)
5. Run the External JavaScript file in 64-bit Operating system