Can we set the Company territory field value to the Current logged in user's Territory instead of the default?

By | June 25, 2009

We all know that Territory (comp_secterr) field appears as a selection field on the Company Entry screen while creating a new company, but actually this field is not of type Selection.

If you will see the field type for this field by firing following query at back-end

Select ColP_EntryType From Custom_Edits Where Colp_ColName=‘Comp_SecTerr’

you will find that the field type is set to 53 and not 21 which is for selection fields. Actually speaking, 53 is the type set for the territory fields.

Now as this field is not the default selection type field, we cannot make use of the Create Script for setting the default value for this field. Then where you can write your code to achieve this functionality??? The answer is Custom Content box. You can try this by putting the script shown below in the onload event of Custom content area of the entry screen for the company i.e. CompanyBoxLong.
Note: please click on image to enlarge the same.

If you find this useful, Please drop us a mail on crm@greytrix.com.