We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Calculate the results of a field before pressing button SAVE

Hello Gerben,
The autonumber in a grid table works perfectly. Thanks.
Now we have 3 fields in a CRF:
F1
F2
F3=F1-2F2
Is there any script that loops through F3 every 2 seconds (for example) and
gives the result for F3 before pressing the button save?
Thanks in advance.
Xevi
on 20-03-2012 16:12 Gerben Rienk said the following:
> > Hello Laurens,
> >
> > Yes you can do that, but it will not look nice ;-) Have a look at the
> > attached XLS plus the two javascripts and think again if this is how
> > you want to do it.
> >
> > What basically happens is that you make a CRF with (at least) three
> > fields: one that must be filled to trigger the autonumber, the field
> > to set write the number to and a calculated that takes the same value
> > from the previous field.
> > In the XL these are called Descr, ANField and ANFieldForDisplay.
> >
> > What the script does is that it loops through all the fields in the
> > grid, but twice, because the existing fields and the newly added ones
> > are named differently, loopThroughRows(1) and loopThroughRows(2). This
> > sets the Autofield, based on whether the field Descr contains a value.
> > After that it hides the ANField plus the Discrepancy flag in hideFields().
> >
> > All this happens directly after the form is loaded and is repeated
> > every 2 secs.
> >
> > The reason why I put this in two scripts is that the total number of
> > characters was too large to put it all in Instructions.
> >
> > The difficult part is to name your elements. The GroupOID you can take
> > from OC, just don't forget to add the extra underscore. The input are
> > called "input", which comes as no surprise. Upload a version, open in
> > DataEntry mode and "inspect element" to find the right number.
> >
> > Hope this helps and if not, feel free to ask.
> >
> > Gerben Rienk
> >
> > http://www.trialdatasolutions.com
> >
> >
> >
>> >> Dear all,
>> >>
>> >> Is it at all possible to generate autonumbering in a grid table?
>> >>
>> >>
>> >> Thanks in advance for yoour help.
>> >>
>> >> Laurens
>> >>
>> >> Trailbureau Radiology
>> >> Dept. of Radiology
>> >> Erasmus MC Rotterdam
>> >> The Netherlands
This discussion has been closed.