Getting the input value of a date filter before it is applied? - ag-grid

Using filterModifiedCallback I am trying to get the current value of a date input and run my own validations on it before the user has the opportunity to apply it. Unfortunately, when using getFilterInstance(field) inside the handler, the object returned only has appliedModel, which is always null unless applied. Is it possible to get the current input value BEFORE it is applied (e.g. after the user has picked a date but has not applied the filter yet)?
I would expect that the filterInstance object would contain a snapshot of what the current input value is.
Thanks !

Related

How to search on a field that may be empty in zapier

Trying to sync up a postgres record to airtable on create/update. The field has a couple of ids that I would like to check for in airtable to determine whether I should create a new record or update an existing one. The first id (optional_id) I need to search on can possibly be null. This causes the search to fail before it can get to the other id(required_id) that should always be populated. Is there any way I can skip the initial search for optional_id if it turns out to be null in postgres?
My current outline is as follows:
I would use a Formatter > Text > Default Value step in case the input value can be null and then make sure the fallback value is from a record that does not exist.
If further help is needed, feel free to reach out to us here:
https://zapier.com/app/get-help

a number is required in the selection criteria when using a parameter

I am new to CR, and I think this is a complicated question. When a user runs the report, I want the user to input either nothing - which will get everything, or to input the values for that field - to get those specific values. Let me know if I am approaching this right.
I am trying to use a formula in the record selection formula editor. This formula references a parameter. I am trying to use WrkOrder.Center field - which is a number - in my selection criteria.
I am getting the error "a number is required here" in the record selection formula editor. I need to do a totext or cstr ? It just seems to still be incorrect.
if the center is blank then get all centers, else get the selected center input in the parameters by the users running the report.
if {?Center}="" then true else {?Center}=cstr({WRKORDER.CENTERNBR})
if {?Center} = "" then true else {?Center}={WRKORDER.CENTERNBR}
parameters to get what is either input or get all centers
First thing to check is the data type of your parameter and the data type of database field to ensure they match.
If you edit your parameter the first three controls on the form at the top are Name, Type, and List of Values. The Drop Down Box for Type will identify the data type of your parameter.
To identify the data type of your database field, find the field in the Field Explorer and if you don't already see a data type listed next to the column names for each table, right click on any field name and click "Show Field Type" and this will toggle the display of the field data type on and/or off. Its usually off by default I believe.
In order to use a comparison with the = operator, these two objects must have matching data types. You aren't able to change the data type of a database field, but you can change the data type of your parameter to match it.
Hopefully this will fix your error. The most common cause of the error message you are receiving is when one field is a Number type and the other is a Text type. Functions that convert the data will work in formula fields, but usually will continue to throw errors when used in selection expert formulas.

MongoDB Datetimefield Null Error

I am trying to save a null value in a dateTimeField object in MongoDB. I have a date I only want set after a certain condition has been fulfilled, but my site has the ability to save an object multiple time to the database before this variable will be set to anything other than a null or empty string value. I tried using db.dateTimeField(null=True) in my model file per Mongo's documentation to save a null value, but I still get an error when trying to save to the database.
According to this issue on Github, there is some inconsistent behavior with setting null values to dateTimeFields. Does anyone know if this has been fixed? I have a work around (adding my attribute to my object, then assigning it a value right before saving, therefore bypassing the need to save a null value, but it is a bit hacky, and I would like to use MongoDB's built in functionality if possible).
Thanks in advance!

Filemaker value validation against value list

Need to validate values within a field against Value List, retaining the value if on list but substituting a specific Value if not?
I am afraid you are mixing two separate things:
Validation checks if some conditions have been satisfied; if not, it throws an error. It will not correct the entry.
If you want user entry to be corrected, you need to either:
define the field to auto-enter a calculated value; or
attach a script trigger to it, and have the script modify the value entered by the user.
In this case, you could auto-enter a calculated value (replacing existing value) =
If ( IsEmpty ( FilterValues ( Self ; ValueListItems ( Get (FileName) ; "YourValueList" ) ) ) ; "Specific Value" ; Self )
--- Added in response to your clarification ---
Technically, you could run a script to find the records you want to verify and do Replace Field Contents (using the same calculation) on that field. You could run the script after changing the value list, as part of the weekly routine.
However, there are two major problems with this approach:
some records could be locked by another user;
you have no history of what happened, and no way to go back in case of making a mistake.
I also don't think it's good practice to have users modify a value list routinely. If you need to have a weekly list of values, you should store them in records, not in a value list. That way at least the part of the value list would have a history.
Another option you may consider is using an unstored calculation field with a similar formula. This would change dynamically with the value list, and leave the original field unmodified. This would be a good arrangement if, for example, you need to export the corrected values every week.

GWT + Editor: Avoid removing violation messages and wrong input

We implement in our GWT/GXT project displays that contain in most cases a filter form and a grid to show the filtered data. Displays are implemented with UiBinder and the "Gwt Editor Framework".
The user wants to have validations on the filter form. To do the validation we use JSR303 bean validation. The validation must apply on each change of a field in a filter form. The user wants also to have a kind of automatic fill a field based on the input in a second field (lets say a number range from and to). That works all perfect - but...
We struggle in a particular situation:
The user starts to type in some data in the filter form.
He puts a wrong value in a field that has to be parsed into a date (for example).
He continues typing into following fields which then cause an automatic prefill of a second field.
The result is currently, that the wrong value he typed into the date field is removed and the violation message as well.
Our current implementation will do a flush() to get the values the user typed in already. After that we fill a attribute in the model (based on the input) and do an edit(model). If there are some violation messages because of a wrong input in a different field in that filter form, the value is removed. That happens on field that need a parse (date, time, number).
The question is now:
Is there a way to keep the wrong value and the violation message as well?
Thank you for any replay!