06-30-2022 04:24 PM
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"?
Solved! Go to Solution.
07-01-2022 03:09 PM
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
06-30-2022 08:18 PM
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
07-01-2022 09:46 AM
@db_pdx I appreciate the response.
You are correct on the reasoning behind the ask, and I'll be researching your alternative solution.
Thanks!
07-01-2022 03:09 PM
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
07-01-2022 11:41 AM
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.