How can I render a Sugar datetimecombo field anywhere with Sidecar?


I have a custom block on the page and I want to use the Sugar datetimecombo field there for date and time selection like this:

How can I render a field like that somewhere else in my customisation javascript files?

I also need to be able to set the value of the datetimecombo field, but I could not figure out what kind of a format it uses and it would require a lot of code just to create a format like "2017-06-19T16:00:00+01:00" in plain javascript.

What format is that exactly? How can use Sidecar to format date and time like that?

Parents Reply Children
  • The first link in your post "article" links to my profile instead of an article.
    I have a new view, but I still don't know how to create a datetimecombo field in it. Can you please help with that?

  • This article on SugarCRM developer blog is very well written and shows how to properly create a new Sidecar view that appears as a modal/popup.

    The viewdefs shown in this example contain the SugarCRM field definitions, which can contain any field definitions that you can find in other module's viewdefs, like the date-time field.

    The key step then is to output those defined fields into the handlebars template of the new view as shown in the article.

    One thing I would note about the article, the documentation and the SugarCRM style guide - the custom.less file is not good for styling custom modules, because any module that copoies the file custom.less will overwrite what another module put there, so styling should be handled differently. So far I have seen styles within the handlebars template since there is no documented or specified way of doing it.