Roster validation

Discussions about CSEntry
Post Reply
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Roster validation

Post by prabhustat »

Dear team,

I have query on roster check point, when i am apply a check point in the roster, calling from other roster variable. Its not controlling, will you please help it. my problem is RO0 (line number) form other roster i am kept condition other roster RO8

if RO0 = RO8 then
errmsg("ID cannot be same as Member ID");
reenter;
endif;

Thanks,

PP
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Roster validation

Post by josh »

Can you give us a bit more context? What proc is your logic in? Are R00 and R08 variables in the same roster or different rosters or is one or other not in a roster? Which variable comes first on the form? Is this system or operator controlled?
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: Roster validation

Post by prabhustat »

Dear Josh,

Thanks for the response, I have attached application for reference. the variables in R00 (RO0_FORM) and R08 (RO5_FORM) is in different roster.

I have one more query also, the application on system control mode, when in partial save opening, the cursor its not moving to last path, its keep showing the error messages. I have used addmode & ispartial() function to avoid the messages. But my problem come in the rosters using curocc() command. its showing lots of issues. I want to control for the first time entry curocc () should on later in need stop the occurs command. especially i am facing the issue in non-resident rosters. Will you please give some example for the both query.

Thanks in advance.

P
Attachments
HH.zip
HH Application
(120.68 KiB) Downloaded 376 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Roster validation

Post by josh »

Since your check is in the proc for R08 it is being executed while in the roster on R05_FORM but it is referring to the item R00 which is in a different roster (the one on R00_FORM). In order for this to work you need to use a subscript when referring to R00. Remember that in a roster there are multiple versions of each item: one for every row of the roster. In order to distinguish which row you are referring you use a subscript. A subscript is just the row number in parentheses after the variable name. For example R00(1) means the R00 occurrence that is in the first row. The exception is that if your logic is being executed while you are in a roster you don't need to specify a subscript for variables in that same roster. This means that in the proc for R08 you don't need a subscript for R08 but you do need one for R00 since it is in a different roster. In your case you want to use the occurrence of R00 from the first roster that is in the same row as the row the user is currently on in the second roster. To do this you can use the currocc() function which returns the row number that the user is on in a roster. With that change your code would look like:
if RO0(curocc()) = RO8 then
    
errmsg("ID cannot be same as Member ID");
    
reenter;
endif;
Note that it would be perfectly legitimate to use the subscript for RO8 too but it isn't needed since CSPro already knows which row you are on in the current roster.

I believe your second issue is that your check for whether or not to show the error messages is:
if !ispartial() or addmode then
If you have a case that was partially saved while in add mode and you reopen it, technically that case is still in add mode. A case can only be in modify mode if it was completed. Once completed, you can open the case in modify mode and then do a partial save in which case when you reopen again it will still be in modify mode. In your case, I'm guessing that you have a case that was not completed and was partially saved and when you reopen it the variable addmode is set to true so your error checks are still running. I think you should try the following instead:
if !ispartial() or !addmode then
With this logic the checks will be skipped if the case was partially saved or if you are not in addmode.
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: Roster validation

Post by prabhustat »

Thanks lot Josh, for your solution its works fine. Sorry one more query.

In my Non-Resident Family Members rosters, when its add mode its working fine, but in modify mode or partial save, I am facing problem I think due to occur command its keep adding more rows automatically, whenever I am opening. How to control. If it’s only fist time add mode then occur should works else it should stop.

Will you please help me, thanks in advance.

PP
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: Roster validation

Post by prabhustat »

Hi Josh,

How to stop the roster occur command, when its partial mode or modify mode.

Thanks in advance.

:geek: PP
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Roster validation

Post by josh »

You can use the endgroup command to move on to the next field after the roster.
Post Reply