CMDB date field always required?

Moderator: crythias

Locked
drodralv
Znuny advanced
Posts: 102
Joined: 26 Jul 2019, 08:25
Znuny Version: 5.0.28

CMDB date field always required?

Post by drodralv »

Hello,

I have a question about date type fields for the CMDB. Even when is not required in the definition class code, the date is autofilled and we would like to keep it blank as some dates are not known yet. Is that normal? I´m thinking just in the way of leaving that fields as text type, to avoid that.

I´m attaching a photo, if that may help.

Thank you
You do not have the required permissions to view the files attached to this post.
root
Administrator
Posts: 4251
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: CMDB date field always required?

Post by root »

Hi,

Did you try to make it optional? Would be the easier to see your class definition.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
drodralv
Znuny advanced
Posts: 102
Joined: 26 Jul 2019, 08:25
Znuny Version: 5.0.28

Re: CMDB date field always required?

Post by drodralv »

Hi, the date fields not mandatory should have empty option i guess. The definition of the last 2 date fields is:

{
Key => 'RevocationDate',
Name => 'Revocation Date',
Searchable => 1,
Input => {
Type => 'Date',
YearPeriodPast => 20,
YearPeriodFuture => 10,
Required => 0,
},
},
{
Key => 'ExpirationDate',
Name => 'Expiration Date',
Searchable => 1,
Input => {
Type => 'Date',
YearPeriodPast => 20,
YearPeriodFuture => 10,
Required => 1,
},

So for the expirationdate, the required 1 is fine, as should be mandatory. The revocationdate does not allow me to be empty and that is a problem for us.

Any idea? OTRS 5.0.28

Thank you
root
Administrator
Posts: 4251
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: CMDB date field always required?

Post by root »

Hi,

I would try this:

Code: Select all

{
  Key => 'RevocationDate',
  Name => 'Revocation Date',
  Searchable => 1,
  Input => {
    Type => 'Date',
    YearPeriodPast => 20,
    YearPeriodFuture => 10,
    Required => 0,
  },
  CountMin => 0,
  CountMax => 1,
  CountDefault => 0,
}
- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
drodralv
Znuny advanced
Posts: 102
Joined: 26 Jul 2019, 08:25
Znuny Version: 5.0.28

Re: CMDB date field always required?

Post by drodralv »

Oh yeah, it worked!

THank you Roy :) :) :)
Locked