How To save date and time value in date and time field in sugarcrm using before save logic hook ?

How To save date and time value in date and time field in sugarcrm using before save logic hook ?

Parents Reply Children
  • Based on what was described, it appears to me that you might be retrieving data with SQL directly from the database which is not something I would encourage. Sugar stores date times in GMT, not on your local timezone. That's why you see a difference in timezone offset.

    You should use instead Sugar Beans to retrieve the information you need, so that the date times will be converted on the logged in user's timezone settings. As a starting point you could look at this page of the manual and see how you go.

    Also, as on the original description it was mentioned you are working with logic hooks, you can interact with the bean object directly by using the first hook parameter as the current bean, without having to retrieve anything else. See this page for more details.

    If you are using entry points instead (as it was mentioned on the last post), entry points most likely are non-authenticated. Perhaps if that is indeed the case, it would be a good idea to re-think the approach of the customisation, if you are attempting to expose data to the outside world without authentication as that would not be safe.

    Hope the pointers will help you achieve what you are after

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States