I am new to using WebRatio and IFML. I need to build a small web application where at a certain point it is necessary to do some validation based on the timestamp a user provides. This timestamp should be between the range of minimum 24hours from now and maximum 14 days.
I hoped to find a way to adapt the values passed from a Time Utility component, add 24 hours or 14 days to it and then use a Compare Validation Rule to validate what the user has entered.
Can someone please explain how I can accomplish my goal here?
the best way to make this validation is to model in the form two hidden fields containing the minimum and maximum value allowed for the timestamp. In this way you can model on the timestamp field two Compare Validation Rules. Each Compare Validation Rule uses the Value Field property filled in with one of the hidden field. So, at the end, the validations on the field express these conditions
timestamp field greater than minimum timestamp
timestamp field lower than maximum timestamp
To fill the hidden fields with the correct value, given the current timestamp, you can use the Dates Function component. You can download it from the WebRatio Addons
Related
I'm looking for a way to set a condition requirement that a specific date field will be equal to today's date, or yesterday's.
How do I do it?
Add a new formula resource of type Date and name it yesterday (or whatever) and put that code in there.
{!$Flow.CurrentDate} - 1
Edit: I am not sure if you are doing something differently but here is a screenshot of a Get Records flow element filtering based on a formula value:
And to be perfectly clear, here is a screenshot of that formula definition:
I have a report where I defined two parameters to set the starting date and ending date.
However, I want to implement a logic so that the user can choose starting date and ending date unless the range between them pass over 1 year. As an example, if the user chooses "01/01/2017" for the start date, the maximum available end date must be displayed and limited to "01/01/2018". The vice versa also must be applied, when the user chooses the end date first, start date must be limited.
Is that possible to implement this logic into Sql Reporting Services? Thanks in advance.
I am using smart table for my angular project. I am facing an issue for sorting a table column which has Date type data. I get the column info in milliseconds which i convert to Date type. It works as it is when date doesn't have any formatting applied. However, if i apply formatting to make it more easily readable, the sorting doesn't work properly, half the data is sorted and other half is not.
How can I sort Date type column if i want to apply formatting as well?
Here's the code snippet of what I have tried so far
for(var i=0; i<$scope.rowCollection.length; i++)
{
$scope.rowCollection[i].ltime =
(new Date($scope.rowCollection[i].lastRegisteredTime )).toLocaleString();
$scope.rowCollection[i].rtime =
(new Date($scope.rowCollection[i].registeredTime)).toLocaleString();
}
In this, lastRegisteredTime and registeredTime are data in milliseconds. If I just convert the data to Date without toLocaleString(), sorting works. But, it is little difficult to read the information for users as I want to show the time information as well.
Any help is appreciated.
Thanks
Since toLocaleDateString returns a string, you cannot sort by ltime as if it were a real date object. I suggest you leave the field as date object and then use date filter in views, where ever you wish to display the date.
<span>{{row.ltime|date:'YYYY/MM/DD'}}</span>
or
<span>{{row.ltime| date:'fullDate'}}</span>
My SSRS report displays a date range (2 parameters) and a multi-selectable value parameter for a field called "MeterNumber".
What I want is for the default value of the multi-selectable parameter to show ALL values until the user specifies one of the values in the list.
I've tried doing this by setting the general tab in the parameter properties to "Allow Multiple Values", and the Available and Default values to equaling the same value fields from the same dataset, but no go.
Any thoughts?
You can use the same dataset that populates the Available Values of the parameter, to populate the Default Values of the parameter.
Then by default, all values are selected when the user first opens the report.
You can assign minimum date and maximum date in your back-end if your date start and date end is empty or null (remember the min date in sql is 1/1/1753 12:00:00 AM and max date is 12/31/9999 11:59:59 PM so your date format should be like that). So when its passed on your parameter it will get all the data within that minimum start date and maximum end date.
This is how you are going to assign min date time in c#
DateTime dateStart = SqlDateTime.MinValue.Value;
and max date
DateTime dateEnd = SqlDateTime.MaxValue.Value;
Do you have any blank and/or null values for MeterNumber in the dataset? This can cause issues with Parameter values. Since in your case you need multiple values, then you can't have null values. Just make sure Allow blank value ("") and Allow multiple values are selected. Then, make sure you don't have NULL values in the MeterNumber column. If you do, then convert to empty string, i.e., ISNULL(AC.MeterNumber, '') as MeterNumber
Just had the exact same problem #Byronyk, however just realised what the issue was (Also aware this post is very old, this is more for those who stumble upon this!)
The issue I found was that I had one extra Value in the available values than in the Default Values, and as such it threw out the default selections.
Once I realised and added it in, the default values were selected again.
I suspect this is the issue, as the date worked fine, the issue was in the 'MeterNumber' parameter
I am storing DOB in MySQL DB and while indexing data in SOLR I want to calculate age in years and store it another field
Is there a way to do this.
I can calculate the age when the user first registers and enters the DOB but then there is no way for me to know to update the age of a user every year.
Can you suggest me ways to do this if the doing it while indexing is not the right approach
Thanks
Don't think you can get the calculated field returned with the response.
The calculation can be easily done on the client side, consuming the Solr response.
Function queries allow you to use the field values with a lot of operations on it.
e.g. milli second between the current date and dob
ms(NOW,dob)
But they are we used just in queries and not be effect the response.
As mentioned previously you can use function queries to calculate the age. You can also use a field name alias to return a new field in the Solr response, for example:
&fl=age:div(ms(NOW,dob_dt),86400000)
would return a new field called age with the difference between the dob_dt field and the current date. The function query ms(NOW,dob_dt) will return the milliseconds from dob_dt until the current date. The div() function converts this value to days (i.e, 1000606024). Extending this to convert to years (1000606024*365):
&fl=age:div(ms(NOW,dob_dt),31536000000)