Results 1 to 10 of 10

Thread: Date Field in custom module

  1. #1
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Default Date Field in custom module

    Hi All,

    I have a custom module, I have 2 date fields into that module.
    the name of the first date field is " case start date" and the name of the second date field is " Case end date"

    Now I want to implement that the date that the user has selected for the Case end date should NOT be prior to the case start date...

    Please help me in this regard as I want to implement this functionality asap and I know it is a bit tricky functionality but I know nothing is impossible for the Sugar heros....

    Thanks guys
    Cheers !!

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Date Field in custom module

    Hi,

    Extend the vardefs.php of you custom module and add following code for the field "case start date"

    PHP Code:
    'validation' => array('type' => 'isbefore''compareto' => 'CASE_END_DATE''blank' => true), 
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  3. #3
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Default Re: Date Field in custom module

    Hi,

    I have tried it but it is not showing any response once I save the record.

    Pls Help.

    Thanks
    Cheers !!

  4. #4
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Date Field in custom module

    Hi,

    After changing the vardefs(extended), you need to repair extensions and quick repair and rebuild cache to take effect of your extension.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  5. #5
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Default Re: Date Field in custom module

    Thanks a lot man !! it was awesome, it worked u r the Champ...



    Now can you please help me that I have a custom module and once I create a new Resource I need to auto populate some fields based on some pre entrered records that I have in the database and then will fill the rest of the form..

    Please help.

    Thank again Man ....Cheers for the good work !!
    Cheers !!

  6. #6
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Date Field in custom module

    Hi,

    I dint understand your requirement much.
    But, to pre-fill some data from other module(parent module) you need to do some custom code.
    Write conditions in view.edit.php and assign those values to the fields you want to show in edit view of child module.

    If, there is no specific conditions to satisfy, you can create a non-db(extend vardefs again) field which gets the value of a "related" module.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  7. #7
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Default Re: Date Field in custom module

    Hi,

    To give you my requirement more clearly...actually there are two modules that I have made in Sugar CRM.

    1) Employee Database
    2) Resource Management

    And there is NO relationship between these two modules...these two custom modules are independent but share the same sugarcrm database with different tables.

    Now there are few team assistants of each team who fill all the required data in the Employee Database say for eg. the Emp ID, First Name, Last Name, Email ID, Phone Number, Region Assigned to etc etc..

    Now I want that whenever anyone who is creating up the data in the edit view in the Resource modules and needs to fill the data for lets say Joy, then once he has typed Joy then all the fields that are related to the Joy in the Employee Database tool should get populated in the resource edit view with some extra fields that would be filled by the person and then can save the record in the resource module.

    To be short we can put a default value against the array fields in the resource module according to the name or the ID entered and then we can fill the rest of the details and can save the records.

    The reason why I am asking for this functionality is that the user does not need to enter the same information everytime when we already have most of the details entered in the database via other module...

    Please help and let me know if you need more clarity over the same. But I am pretty sure this is achievable in php and mysql but I am not sure about SugarCRM.

    Thank you
    Cheers !!

  8. #8
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Unhappy Re: Date Field in custom module

    Hi David,

    Please let me know of your opinion on the same.

    Will really appreciate your advise.

    Thank you
    Cheers !!

  9. #9
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Thumbs down Re: Date Field in custom module

    Quote Originally Posted by kingjatin View Post
    Hi,

    To give you my requirement more clearly...actually there are two modules that I have made in Sugar CRM.

    1) Employee Database
    2) Resource Management

    And there is NO relationship between these two modules...these two custom modules are independent but share the same sugarcrm database with different tables.

    Now there are few team assistants of each team who fill all the required data in the Employee Database say for eg. the Emp ID, First Name, Last Name, Email ID, Phone Number, Region Assigned to etc etc..

    Now I want that whenever anyone who is creating up the data in the edit view in the Resource modules and needs to fill the data for lets say Joy, then once he has typed Joy then all the fields that are related to the Joy in the Employee Database tool should get populated in the resource edit view with some extra fields that would be filled by the person and then can save the record in the resource module.

    To be short we can put a default value against the array fields in the resource module according to the name or the ID entered and then we can fill the rest of the details and can save the records.

    The reason why I am asking for this functionality is that the user does not need to enter the same information everytime when we already have most of the details entered in the database via other module...

    Please help and let me know if you need more clarity over the same. But I am pretty sure this is achievable in php and mysql but I am not sure about SugarCRM.

    Thank you
    Any suggestion for the same....at least let me know if this is achievable or not? I think we can have a healthy discussion over this topic...

    Where are the Sugar heros?

    Thanks
    Cheers !!

  10. #10
    kingjatin is offline Senior Member
    Join Date
    May 2010
    Location
    India
    Posts
    35

    Default Re: Date Field in custom module

    ??? Any Help Please...............
    Cheers !!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 2009-11-10, 06:58 AM
  2. Logic Hook + Passing Date to Custom Date Field
    By chrislynch8 in forum Developer Help
    Replies: 12
    Last Post: 2009-07-22, 03:58 PM
  3. Date & Time custom field
    By JimMurple in forum Developer Help
    Replies: 1
    Last Post: 2007-04-11, 11:59 AM
  4. custom field -> dateTIME not just date
    By elRey in forum Developer Help
    Replies: 6
    Last Post: 2006-11-20, 10:06 PM
  5. Replies: 1
    Last Post: 2006-06-16, 03:35 AM

Tags for this Thread

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
  •