Converter and validators messages in dutch - xpages

I have a question about converters. On one of my fields I added an converter to change the field value into an date. Whenever a user enters the incorrect date/time format an error is shown " This field is not a valid date. ".
I want to force it to be in dutch. Could i Change the local to simply show it in dutch or should i write custom converter ( don't hope so ) with a dutch message returned?
Related to this , I Think, are the messages for validators. I have an expression validator which returns "Expression is invalid" message when the computed expression ( it is saved in a notes document and read on page load ) is invalid. Can I somehow change this to dutch? So that the user knows what is going on?

Related

Lotus Notes: RichText Content

I want to create a field that will tell me,
if that field's content is empty (ex: no attachment),
it will reflect in another field that it is empty.
For that reason,
I have created/tested a Rich-Text field in a form.
Let's say that Rich-Text Name is Test1.
Then, I added a computed text field, let's say the name is Test2.
In Test2 field, I set the formula as this,
#If(Test1!="";"Yes";"No")
As a result, in the Test2's field, it does not show me that the Test1's field is empty, even though it has no text/attachment inside the Test1 field.
I have tested many times, and the result is still the same.
Please help me on this matter to solve this problem.
Thank you in advance.
There is no direct solution AFAIK. If using LotusScript is an option for you, here's a common workaround to find out whether an RT field is empty:
Put the focus on the RT field by calling NotesUiDocument.GoToField("Test1").
Select all contents of the RT field by calling NotesUiDocument.SelectAll().
The call to NotesUiDocument.SelectAll will raise an error (can't remember wich error code) if the RT field is empty. Trap that error using On Error GoTo <label of error handler>. If the code does not enter the error handler, you know the RT field is not empty. If it does, you know the RT field is empty. You can then take the appropriate action, e.g. put a message in text field 'Test2'.
To make this approach more user-friendly, I'd also suggest you add some code that puts the focus back on the original field (i.e., the field that had the focus before the above LS code was triggered).

How to get label of field in error message from Netsuite Suitescript 2.0?

I am getting error messages from netsuite like
The field custevent97 contained more than the maximum number ( 5 ) of characters allowed
You have entered an Invalid Field Value 1511 for the following field: contact
Phone number should have seven digits or more.
It is difficult to understand which field is wrong & which value is wrong.
How to get error message with label name of specific field from suitescript 2.0?
AFAIK, all of the above errors will be returned by NetSuite when you try to save a record. So it won't be easy to overwrite them but you can use workaround as below.
Write your code in try-catch block and then validate error message to check if some field value is invalid. If field value is invalid, you can then fetch the said field from record using nsRecord.getField, and then fetch its label using field.label, and overwrite the error messages.

DialogFlow Fulfilment - How to get both original and default value for a parameter

I am trying to get a time value from an intent as both $time and $time.original. I need the $time value to do some processing on it and I need the $time.original to show the output back to user.
For example, if user says, 'are you open tomorrow?', I want to respond 'Yes, we are open tomorrow?' but on the back end, I need the value of date 'tomorrow' to do the processing.
Any help would be appreciated.
First, you would need #sys.date entity if you want to catch value of entities like tomorrow instead of #sys.time
Now coming to the question, directly extracting the parameter value will only give us parsed date value, not the original value.
But if we set an output context, then from that context we can extract both parsed value and the original value as intended.
Here is a request that we get on webhook we can get date and date.original by parsing the output-context that we set in the intent:
{"responseId":"###","queryResult":{"queryText":"are you open
tomorrow","parameters":{"date":"2018-12-28T12:00:00+05:30"},"allRequiredParamsPresent":true,"fulfillmentText":"","fulfillmentMessages":[{"text":{"text":[""]}}],"outputContexts":[{"name":"projects/###/agent/sessions/###/contexts/time","lifespanCount":5,"parameters":{"date":"2018-12-28T12:00:00+05:30","date.original":"tomorrow"}}],"intent":{"name":"projects/###/agent/intents/###","displayName":"time-intent"},"intentDetectionConfidence":1,"languageCode":"en"}}
I have not also tried with it yet but I Guess you would be able to parse it with it system entity Dialogflow system Entities
as they're shown #sys.date and example matches with what you need. I guess it will be processing it into date

Extract Field Values from Link Issues

I want to check if the field values in the "Issues" field is null or not using a groovy script as a validator. As there are certain scenarios that will require the user to fill in this field, however not always so I cannot make it just a required field.
So it would be the latter field "Issue" is what I want to see if it is null. And to be able to check the status of "Link Issue".
EDIT: This gave me the appropriate solution for the issue at hand. https://answers.atlassian.com/questions/14203790/how-to-set-linked-issues-as-mandatory-field-on-issue-creation

Modify edit box data display type error message

I have a edit box in my xpage and i've set data display type to number. I also have a error message component so I can display the error which i get if i insert any other char that is not a number. I get this message:
This field is not a valid integer
So my question is- is there a way to modify this message so I can display whatever I want to in the message? Or I shouldn't bother with this and just achieve the functionality in other way?
The message is handled by the in-built number converter, so you would need to add your own converter to change the message and handle the conversion between the number required by the business logic and the string required for the browser.
You can use the DojoNumberTextBox and that will only allow number values.
Howard

Resources