cancel
Showing results for 
Search instead for 
Did you mean: 

People Planning - Register Field List - Default Value for Dates

jpray
New Contributor II

When adding a new employee to the PLP Register (as opposed to importing the register), I'd like to have the "Hire Date" Register Field remain blank. I've removed the Default Value from the Register Field List line item in hopes this would be the solution, however the "Hire Date" now populates with 01-01-1900. Does anyone know how to accomplish a blank "Hire Date"?

jpray_1-1656619787201.png

jpray_0-1656619733792.png

1 ACCEPTED SOLUTION

I think @ckattookaran solution is the better approach if you really want to ensure the field is populated before saving.

If you are still interested in applying column formatting, you'll need to modify the PLP_SolutionHelper BR.  Function 'GetColFormat'.  Its a pretty large function with various checks based on column name to build up a formatting string that is applied to the SQL Editor component.  Somewhere in the middle you can add something to the effect of:

If columnName.XFEqualsIgnoreCase("HireDate") Then

colFormat.Append(", BackgroundColor = ColorOfYourChoosing")

End If

 

Cheers    -db

View solution in original post

4 REPLIES 4

db_pdx
Contributor

The HireDate field is a Date datatype.  I don't believe you can have empty values (technically maybe it allows NULL's, but not sure you we have a way of introducing a real NULL value without really monkeying in the background).

What is the reason for wanting it empty?  Is it to ensure end-users populate the blank field with a value?  If so, consider applying formatting to the column to highlight required fields they need to populate.

-db

jpray
New Contributor II

@db_pdx I appreciate the response.

You are correct on the reasoning behind the ask, and I'll be researching your alternative solution.

Thanks!

I think @ckattookaran solution is the better approach if you really want to ensure the field is populated before saving.

If you are still interested in applying column formatting, you'll need to modify the PLP_SolutionHelper BR.  Function 'GetColFormat'.  Its a pretty large function with various checks based on column name to build up a formatting string that is applied to the SQL Editor component.  Somewhere in the middle you can add something to the effect of:

If columnName.XFEqualsIgnoreCase("HireDate") Then

colFormat.Append(", BackgroundColor = ColorOfYourChoosing")

End If

 

Cheers    -db

You cannot make it go as NULL (SQL server default for the date is 01/01/1900). Now even if you change the table to accept NULLs, the SQL editor components always fill the data with default values. So even if it is null on the backend when you save the data, the SQL editor sends back the default value of respective data types and saves it in the table.

Now you can create validation rules on the save using the event handler and let the user know that they've not entered a date and stop the save from happening.