Increase the size of Search SQL text

By | September 20, 2014

Sage CRM allows System Administrators to create different types of fields as per the requirement e.g. Text. Selection, Search selected Advance etc. We can put SQL clauses on SSA fields for restricting the information. However there is the limit on number of characters to be written in Search SQL text.

By default on Search Select Advanced field user can enter 60 characters maximum in “Search SQL” textbox
Image1
Now what if you want to add longer condition? Here is how you can increase this limit.
1. Login into SageCRM.
2. Go to Administration |Customization |Translations.
3. Check Inline Translation Mode checkbox
4. Go to Administration |Customization |Cases |Fields.
5. Click on New button
6. Click on highlighted area on below given Screen
Image2
7. Enter below given Code under US and UK Translations
<script language=”javascript” src=”../custompages/Entity.js”>
</script>
<script language=”javascript”>
window.attachEvent(“onload”,PageLoad)
</script>
8. Go to C:Program FilesSageCRM<CRM Instance>WWWRootCustomPages
9. Create new Entity.js file.
10. Enter below given code under .js file
function PageLoad()
{
if(document.getElementById(“searchSql”))
document.getElementById(“searchSql”).maxLength = 500;
}
11. If you increasing Max length of field on screen then you have to handle the same on Database level also. You can handle this by increasing the data size of field using below given query
alter table custom_edits
alter column colp_searchSql nvarchar(500)
12. Please do the metadata referesh.