Menu

Welcome, Guest
Username: Password: Remember me

TOPIC: Field Type of Time?

Field Type of Time? 4 years 6 months ago #1535

  • ak
  • ak's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 9
  • Karma: 1
Hi,

I have a business requirement that needs me to create a field of time type. Imagine Datetime field without the date.

This question has been asked many times on the SugarCRM forums but none of the replies I found provide a complete working solution. The only reply that came close was this one: forums.sugarcrm.com/f6/how-creat-custom-field-type-time-46594/

I do see that there is a Time folder with the required scripts in /include/SugarFields/Fields/Time. But I have no ideas on how to activate this field type in Studio, let alone use it.

I have tried creating a datetime field in the Contacts module and then editing the detailviewdefs.php and editviewdefs.php in /custom/modules/Contacts/metadata/ to add 'type' => 'Time' to the field attribute array. But all that resulted in was a blank output next to the field in the Detail and Edit layouts.

Please help me get the time field type working. I am sure many others will face the same issue.

AK
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1536

  • ak
  • ak's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 9
  • Karma: 1
Just one clarification: by "activate this field type in Studio", I mean "make this field type available in Studio". Surely, don't want people to get lost on the terminology ;)

Anyone? This is a roadblock.
Last Edit: 4 years 6 months ago by ak.
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1560

  • ak
  • ak's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 9
  • Karma: 1
Will, can you please help with this?
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1606

  • Will
  • Will's Avatar
  • Offline
  • Forum All-Star
  • Where there's a Will, there's a way!
  • Posts: 4221
  • Thank you received: 498
  • Karma: 144
Hi ak,

You would need to create a custom field type of time for this to work, not just edit the viewdefs.

Thanks,

Will.
Support the Project - Github Twitter Facebook
Download the latest release: Download SuiteCRM 7.9
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1624

  • ak
  • ak's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 9
  • Karma: 1
Hi Will,

Thanks for replying. As I mentioned in the first post, there already exists a field type of time in /include/SugarFields/Fields/Time. But I am not sure how to utilize this field type. Am I missing something?

Regards,
AK
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1655

  • ak
  • ak's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 9
  • Karma: 1
*bump*
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1656

  • Will
  • Will's Avatar
  • Offline
  • Forum All-Star
  • Where there's a Will, there's a way!
  • Posts: 4221
  • Thank you received: 498
  • Karma: 144
Hi AK,

It seems this is used as the time part of the datetime field. This seems to be incomplete code for what would be a type 'Time' field.

Thanks,

Will.
Support the Project - Github Twitter Facebook
Download the latest release: Download SuiteCRM 7.9
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1657

  • ak
  • ak's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 9
  • Karma: 1
Ah, ok. In that case, would you be so kind to get me started with creating a "Time" field from scratch, please?

EDIT: I imagine this is in the list of most requested features since it's not present already. Have you or somebody you know happened to work on this for any deployments that Sales Agility did?
Last Edit: 4 years 6 months ago by ak. Reason: Added more info
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1660

  • Will
  • Will's Avatar
  • Offline
  • Forum All-Star
  • Where there's a Will, there's a way!
  • Posts: 4221
  • Thank you received: 498
  • Karma: 144
Hi AK,

This is not a feature that has been requested by SuiteCRM users but would be a welcome contribution to SuiteCRM(post this in the suggestion box). We are working on a bug fix release(7.0.2) to be released hopefully next week. SuiteCRM 7.1 will be released at the end of January with new features such as social integration.

Thanks,

Will.
Support the Project - Github Twitter Facebook
Download the latest release: Download SuiteCRM 7.9
The administrator has disabled public write access.

Field Type of Time? 4 years 6 months ago #1665

  • Kir
  • Kir's Avatar
  • Offline
  • Junior Member
  • Posts: 25
  • Thank you received: 3
  • Karma: 1
Can you tell why you need to create time field& What is the requirment that you can't use datetime field and customize display value?

Thanks in advance
The administrator has disabled public write access.

Field Type of Time? 1 year 7 months ago #41051

  • apoonawa
  • apoonawa's Avatar
  • Offline
  • Junior Member
  • Posts: 29
  • Thank you received: 7
  • Karma: 1
Did you ever figure out how to add a time field?
We need a time field to use in our workflow conditions. We want certain actions to performed at certain times each day.
A datetime field would not work in this case.
The administrator has disabled public write access.

Field Type of Time? 1 year 7 months ago #41052

  • apoonawa
  • apoonawa's Avatar
  • Offline
  • Junior Member
  • Posts: 29
  • Thank you received: 7
  • Karma: 1
Did you ever figure out how to add a time field?
We need a time field to use in our workflow conditions. We want certain actions to performed at certain times each day.
A datetime field would not work in this case.
The administrator has disabled public write access.

Field Type of Time? 3 months 1 day ago #63962

  • alsburymedia
  • alsburymedia's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Did anyone ever figure this out? We need to capture a time field for reporting purposes and the datetime field doesn't let us isolate time in 7.10.4

Thanks
The administrator has disabled public write access.

Field Type of Time? 2 months 3 days ago #65852

  • Alhimic
  • Alhimic's Avatar
  • Offline
  • New Member
  • Posts: 2
  • Karma: 0
I know only one way to add time field to module.

Change MODULE_NAME to real name of your module, PACK_NAME to real name of your package in module builder, FIELD_NAME to real name of your time field.

If you want to add this field to common module:

1. add TextField to your common module in Studio
2. add string to custom/Extension/modules/MODULE_NAME/Ext/Vardefs/sugarfield_FIELD_NAME.php
$dictionary['MODULE_NAME']['fields']['FIELD_NAME']['type']='time';

3. make Fast Repair and Rebuild

If you want to add this field to custom module:

1. add TextField to your custom module in ModuleBuilder
2. change 'type' attribute from 'varchar' to 'time' of your field in vardefs.php of you custom module in custom/modulebuilder/packages/PACK_NAME/modules/MODULE_NAME/vardefs.php
3. Install your package

After this actions I can edit time in this tield.

Hope this helps.
The administrator has disabled public write access.
Time to create page: 0.109 seconds
Powered by Kunena Forum