Results 1 to 6 of 6

Thread: Field validation?

  1. #1
    lmoreau is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    37

    Default Field validation?

    Sorry for all my questions just signed up for Sugar today, bye bye Salesforce!

    In Salesforce you can easily have validation on fields, so for example, we have a sales rep ID number that's a text field. It looks like BJD3743, CHD9228 etc. It's 3 letters and then 4 numbers. In SF I can have it only allow entries that match that.

    Same with province, only a 2 letter province/state from a list of valid state and provinces are accepted. Is there any way to do this in Sugar? Can't seem to figure it out.

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Field validation?

    This requires some custom programming.

    The closest you could come to it without programming would be to use the "required" option on a field, but that's exactly what you are looking for. Its benefit is that it would automatically validate the data based on the type of field, i.e. integer fields would only allow numbers, but it wouldn't allow you do define your own rules, while also requiring that the field be populated, which might complicate things further for you. The benefits of its use may be very minimal, if any.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  3. #3
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Field validation?

    Yes, the deafult dugar validation is just to check wheter a certain field is empty or not.
    Any "custom" validation needed to be programmed. It could be done with javascript (called before form's submit) or with php (called in sugar before_save logic_hook)
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  4. #4
    lmoreau is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    37

    Default Re: Field validation?

    Got it thanks everyone. It's not really critical or necessary it was just nice to have. I guess for province/state I could make it max size 2, which would keep it at least in the 2 character format.

  5. #5
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    4,813

    Default Re: Field validation?

    You could also make it a drop down field as it would require the users to pick a value from a predefined list, as opposed to them being allowed to type random values.

    Also note that address fields are handled in a special manner by Sugar. In a nutshell, you can't modify existing address fields individually without some custom programming, that includes replacing an existing field with a custom. For example, replacing the existing state field with one of your own.

    Of course, that's only of relevance if you want your field to be part of the default address block.
    Regards,

    Angel Magaña
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

    ________
    | Projects: |_____________________________________
    |
    | CandyWrapper (.NET Wrapper for SugarCRM SOAP API). Source now available on GitHub!
    | GoldMine to SugarCRM Express Conversion. Latest: 1.0.1.7 (Nov. 3, 2009)
    | CRM SkyDialer (Skype Integration). Latest: 1.0.2 (Feb. 17, 2010)
    | Round Robin Leads Assignment
    | Phone Number Formatter
    | CaseTwit (Twitter Integration)
    ______________________________________________

  6. #6
    Join Date
    Feb 2012
    Posts
    2

    Default Re: Field validation?

    Only way to add validation to a custom field is via javascript ? We can not have any validation through configuration ?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Field Validation
    By crmqwerty in forum General Discussion
    Replies: 2
    Last Post: 2011-04-27, 08:11 PM
  2. field control on validation
    By willyboy73 in forum Developer Help
    Replies: 5
    Last Post: 2011-04-11, 11:12 AM
  3. Float field validation
    By taptele in forum Developer Help
    Replies: 2
    Last Post: 2011-03-28, 08:30 AM
  4. Validation check field
    By winnet in forum Developer Help
    Replies: 1
    Last Post: 2009-03-30, 03:56 PM
  5. Field Validation
    By clearly in forum General Discussion
    Replies: 1
    Last Post: 2006-11-28, 03:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •