VALIDATION ERROR

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
lfalvarado
Posts: 3
Joined: August 23rd, 2019, 12:59 am
Location: GB

VALIDATION ERROR

Post by lfalvarado »

Dears,

I would like you to help me with a problem that is presented to me, which I will try to explain in detail,
I'm working on a template with validation on it, that if I enter data in the first part the same person re-enters them and if you make a mistake shows you a message where I specify that there is error and in turn tells you the number of errors that com and when you complete a number of errors it will close.

I have the following syntax for normal entry in the first part :

PROC FNAME

If $ = " " then
errmsg ("El campo Primer Nombre no debe quedar vacio");
move FNAME;
endif;

if DFNAME<>"" |validando = 1 then
move DFNAME;
else
validando=0;
errores=0;
endif;

and for the validation of the same variable I have the following:

PROC DFNAME

PostProc
if $<>FNAME then
errores=errores+1;
if errores > 9 then
errmsg("Es la decima vez que se equivoca. \nLa plantilla se cerrara.");
stop(1);
else
errmsg("Inconsistencia en datos.\nCantidad de errores: %d.",errores);
reenter FNAME;
endif;
endif;


but it presents me with the following error message: unable to 'reenter FNAME' -target-item field is a skipped field {in Var DFNAME}

I HOPE YOU CAN HELP ME

THANKS
Attachments
PICTURE ERROR
PICTURE ERROR
error cspro.jpg (23.9 KiB) Viewed 2897 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: VALIDATION ERROR

Post by Gregory Martin »

I am assuming FNAME and DFNAME are consecutive fields. There is a CSPro bug whereby if you skip from one field to the field after it, and then reenter the previous field, that you get the error message that you see. We have fixed this in CSPro 7.3, which will likely be released next week.

However, for now you need a workaround. I would do this:
PROC FNAME

/// ...

if DFNAME<>"" |validando = 1 then
    // move DFNAME; // CHANGE THIS
   
advance to DFNAME;
Using advance instead of move (which will translate to a skip) should fix the problem.
lfalvarado
Posts: 3
Joined: August 23rd, 2019, 12:59 am
Location: GB

Re: VALIDATION ERROR

Post by lfalvarado »

Dear Gregory,

Thank you very much for your response, let me tell you that unfortunately the error still persists me when I make the change you suggested, do you think you can give me another option that I can use?
Let me tell you that they are not continuous items, the template has 1st pages, 5 initials that are responsible for collecting the information for the first time, then 5 endings that are the ones that validate the information entered for the first time. This problem arises to me when I am trying to validate the information on the second time.
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: VALIDATION ERROR

Post by aaronw »

CSPro 7.3 has been released, so I recommend trying to reproduce with that version. If you're able to reproduce the issue, then we'll take a closer look at your project. You'll need you to attach or email us the project. Along with your project, we need a data file with an already entered case and the steps to reproduce the issue.
Post Reply