Assigning fields out of the flow

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Assigning fields out of the flow

Post by AriSilva »

As I understood, a field in a form is changed only when the system flow passes through the field in the program logic.
But sometimes it is necessary to change (or assign) the value of a field in a proc of another variable, without having to MOVE back to the previous field. I´ve tried that and it does not work, unless the flow of control returns to the field you want to change.
Is there a way to change the value of a field without being in its own proc?
Best
Ari
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Assigning fields out of the flow

Post by aaronw »

You don't need to move back to a previous field to update its value. You simple reassign it further down in the flow. For example, FIELD_1 is reassigned the value of FIELD_2 in PROC FIELD_2.
PROC FIELD_2

postproc

    FIELD_1 = FIELD_2;
AriSilva
Posts: 591
Joined: July 22nd, 2016, 3:55 pm

Re: Assigning fields out of the flow

Post by AriSilva »

But if the control does not pass thru the field, or if the field is in another form, which is never used, the field is not assigned.
Best
Ari
aaronw
Posts: 561
Joined: June 9th, 2016, 9:38 am
Location: Washington, DC

Re: Assigning fields out of the flow

Post by aaronw »

CSPro was designed to ignore values off path. However, the assignment is made, but when the data is written out it is ignored. During a partial save all values (on or off path are saved). This is done, so a skip doesn't immediately wipe a bunch of collected data. If you maintain a partial save (never letting the case complete) you can achieve the behavior you want.
Post Reply