IntegerField is not giving error in first place if the value entered is text

Certified Associate Developer

Hello All,

I'm displaying integerField control inside an editable grid. The information added is getting saved in database table. The problem which is happening here is related to error message that user is not getting while entering any text value in the field. If user enters any non numeric value then it gets cleared out after mouse unfocus and again if we enter any non numeric characters only then it displays error message. Can somebody help me to figure out why is this happening?

Below is the code i'm using

 

a!integerField(
value:ri!AllTaskData_cdt.ContentMetricValue,
validationGroup: "EditContentMetrics",
required: true,
saveInto:{
a!save(
ri!AllTaskData_cdt.ContentMetricValue,
if(
or(
isnull(save!value),
len(save!value)=0
),
null,
save!value
)
),

a!save(
ri!updatedTaskData_cdt[ri!index].ContentMetricValue,
if(
or(
isnull(save!value),
len(save!value)=0
),
null,
save!value
)
)
}
)

 

Where AllTaskData_cdt and updatedtaskData_cdt is a cdt. AllTaskData_cdt is the variable which actually holds the value and updatedTaskData_cdt is used to store the updated values. The call to this rule is made from another interface where a!foreach() loop is running and hence one by one it sends the value for AllTaskData_cdt and that is why this variable is not declared as an array here

  Discussion posts and replies are publicly visible

Parents
  • Hi viveku0001,

    I suggest you to use the parameter called "Refresh After" and the valid value for the parameter in your case must be "KEYPRESS",which means it refreshes after every character typed into the field.
    If the user deselects the field after changing its value you can use "UNFOCUS" which is considered as a default value.
  • 0
    Certified Associate Developer
    in reply to ravalik
    Hello Ravalik,

    Its still the same, I think refreshAfter is just to decide when do we need the values to be saved after keypress or unfocus but here in my case the issue is related to error message that is not poping up if user enters any text value in numeric field at first instance instead it gets cleared out and again if we enter any non numeric value only then the message pops up.
Reply
  • 0
    Certified Associate Developer
    in reply to ravalik
    Hello Ravalik,

    Its still the same, I think refreshAfter is just to decide when do we need the values to be saved after keypress or unfocus but here in my case the issue is related to error message that is not poping up if user enters any text value in numeric field at first instance instead it gets cleared out and again if we enter any non numeric value only then the message pops up.
Children