Results 1 to 5 of 5

Thread: turn off Relate field validation

  1. #1
    veersoftsales is offline Senior Member
    Join Date
    Jan 2009
    Posts
    22

    Default turn off Relate field validation

    Hello,
    I am customizing Leads module and adding a AccountName as a Relate field.
    I want to do the following
    * I want to give a account name that is not existing in the Accounts module, say for example, 'abc123'. 'abc123' account does not exist
    * I change the focus to another field.
    * The AccountName is cleared.

    I don't want to have the validation when I change the focus to another field. In this case, I want the invalid account name to be retained.

    How do I turn off the validation for a Relate field.

    Thanks.

  2. #2
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Re: turn off Relate field validation

    Quote Originally Posted by veersoftsales View Post
    Hello,
    I am customizing Leads module and adding a AccountName as a Relate field.
    I want to do the following
    * I want to give a account name that is not existing in the Accounts module, say for example, 'abc123'. 'abc123' account does not exist
    * I change the focus to another field.
    * The AccountName is cleared.

    I don't want to have the validation when I change the focus to another field. In this case, I want the invalid account name to be retained.

    How do I turn off the validation for a Relate field.

    Thanks.
    Hi,

    If I understand correctly, you want to be able to relate a field to an Account that is not an Account in the CRM Maybe create a field for Accounts not in System (prospect Account Name) make it a text field and then use the correct one when creating the lead?

    There is already a relationship in the CRM between Accounts and leads - I don't see why you want to add it again?
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  3. #3
    veersoftsales is offline Senior Member
    Join Date
    Jan 2009
    Posts
    22

    Default Re: turn off Relate field validation

    Thanks Chris.

    If the Account is not existing (by giving a not a valid account name), then after clicking the Save button,
    the Account should be created. So we plan to override the Save functionality.

  4. #4
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,130

    Default Re: turn off Relate field validation

    You need to create a custom field type like "include\SugarFields\Fields\Relate" or you can customize the relate field type directly. But the first one is upgrade safe.

  5. #5
    edg
    edg is offline Sugar Community Member
    Join Date
    Feb 2007
    Location
    Atlanta, GA
    Posts
    46

    Post Re: turn off Relate field validation

    I'd create a non-db (virtual) field for the entry of the account name different from the relate field that is not validated until pre-save.

    Then, during pre-save, do a look up to see if the Account exists and, if so, store the Account ID in the relate id field. Otherwise, add the new record and then update the relate account id field.

    You may want also want to do a lookup validation as an onchange to the field and prompt the user to indicate the account does not exist and confirm that they really meant to add a new account. Otherwise, typos are likely to create some serious issues.

    On a "related" note, if you are expecting the leads to show up on the subpanel for the account, you're also going to have to update the relationship id during pre-save. I posted a Developer Tutorial that contains steps and examples of how to do that. See http://www.sugarcrm.com/forums/showthread.php?t=47776

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Validation error in relate fields(custom modules)
    By salimmohd82 in forum Developer Help
    Replies: 9
    Last Post: 2009-05-26, 04:20 PM
  2. How to turn a text field into a drop down
    By buckalec in forum Help
    Replies: 9
    Last Post: 2009-04-02, 11:02 AM
  3. Validation check field
    By winnet in forum Developer Help
    Replies: 1
    Last Post: 2009-03-30, 03:56 PM
  4. javascript - turn of validation on a field
    By mikesolomon in forum Developer Help
    Replies: 3
    Last Post: 2008-06-19, 07:48 AM
  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
  •