Get error values of fields - redux-form

I wanted to get the error values for the names of all the fields in my form. I wanted to show a "form-level" error saying "you need to go look at this field" and clicking individual messages will scroll them to that field.
I haven't been able to figure out how to get anything other then the "form-level" error from this.props.error.

I had a similar requirement and I used getFormSyncErrors selector which returns an object whose keys are the name of the invalid fields and whose values are the corresponding error:
{
recipientAddress: "Required",
recipientCity: "Required",
recipientZip: "Required"
}

Related

Kentico 12: change value of one page type field based on value of another field

I have a custom page type with two fields, StateName and StateCode. I would like it so that when a value is selected in either of these fields, the other field’s value changes to match.
So for example, if I select “Alabama” in the StateName field, the value of the StateCode field would automatically change to “AL.” Or if I select “CO” in the StateCode field, the StateName field would automatically change to “Colorado,” etc. Is this possible?
(I have to keep these as two separate fields, because I need to display either the state name or the state code on the front-end depending on context. Therefore, I can’t use a single field with options like AL;Alabama because then the field only returns the value AL and I have no way of getting the display name Alabama).
I know Kentico has options for setting “dependent” fields, but that only appears to determine visibility – e.g. only display Field B if I select a particular value in Field A. I can’t find a way to actually change the selected value in one field based on the selected value in another field.
Two control solution seems some kind of an overkill here. You can use StateInfoProvider to get what you want.
StateInfo state = StateInfoProvider.GetStateInfo("Alabama")
The other way would be to use a simple drop down control and use
query like that :
select stateCode + '|'+ StateDisplayName, StateDisplayName from cms_State
to get get code and display name as value separated by |

Change a field property in SNOW

I'm trying to change a field's default property in SNOW. Here in incidents we've a field Assigned to and it accepts some default values. But instead of that I want it to accept any values (Integer, String, Special characters etc). In my SNOW Form lay out tried the below.
Created a new String field, Named it as Assigned to Label and name as assigned_to and saved it and it ended up as shown below.
and when I added some random text in this field, it gave me the below error.
please let me know on how can I change this field to accept any string as Input.
Thanks
You are referencing the sys_user table on the form field Assigned to. You need to provide the value for the Assigned to field the sys_id from the User record.
Providing it with any text will result in an invalid reference since it is looking for the unique sys_id on the user table.

ServiceNow "Display Value"

I am not able to understand the meaning of "Display Value" in Service Now.
I found some of the documents on the web. But that was not helpful.
Think of it as choosing what field to use as the "Name" of the record. It's what shows up in reference fields, when you call the GlideRecord.getDisplayValue() function, and other places in the system.
Let's say for simplicity you have a table called "Problem" with 3 fields:
Number
Creation date
Created by
You're on the "Incident" table, and you want to link the incident to a certain problem. You open up the reference picker and choose the problem from the popup list, but when you return to the incident form the value showing in the field "Problem" says "2017-05-08 10:30:50". This indicates that the "Display Value" field is set to "Creation date". The incident is linked to the correct problem, but it's just the "Display Value" is not set correctly.
If you updated the "Problem" table so that it's "Display Value" field was "Number", then when you chose the problem to link your incident to, the "Problem" field on the incident record would show up for example like "PRB000005".
There can only be one display value per table. If you change a field to be the display value for that table, any other field on that table with display value = true will be set to display value = false.

SSRS show parameter values in header

I am trying to add an expression in header section, which would display parameter value chosen by users (if everything selected, display "ALL" instead). I am having trouble with "Property" parameter.
Report structure:
Report is a matrix report that shows data by year and grouped by refBuildingID. Parameter "Property" is based on RefBuildingID. I want to show these parameter values in header when users run this report.
Expression:
=IIF(Countrows("BuildingID")=(Parameters!refBuildingID.Count),"All",Join(Parameters!refBuildingID.Value,", "))
Error:
The Value expression for the text box ‘Textbox31’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset.
Is there a way to get around this error?
Try this method:
=IIF(Count("BuildingID")=Count(Parameters!refBuildingID.Value),"All",Join(Parameters!refBuildingID.Value,", "))
i think CountRows will work
=IIF(COUNTROWS("BuildingID").Equals(Parameters!refBuildingID.Count),"ALL",Join(Parameters!refBuildingID.Value,", "))

Symfony validation with dynamic message

I have been looking around and was wondering if it is possible to validate a form but dynamically add error message.
For example:
Test\TesterBundle\Model\Products:
constraints:
- Propel\PropelBundle\Validator\Constraints\UniqueObject:
fields: [Url, SKU, Title]
message: Field already exists
This if the Url isn't unique it will output Field already Exists. However, it doesn't state which field already exists.
My first thought was to use [fields] inside the message which through an error:
Test\TesterBundle\Model\Products:
constraints:
- Propel\PropelBundle\Validator\Constraints\UniqueObject:
fields: [Url, SKU, Title]
message: [fields] already exists
I then tried a simple %s to see if it already inserted this but just output the string.
Is there an already created method, would I need to extend the UniqueObject Constraint and create a new one that outputs the field name aswel, or would I need to create a new function to do this?

Resources