I am trying to increase the value by one for a certain obs term. I can get it to translate into the note but it is not storing the value in the obs term. Drawing a blank. HELP!
Here is what I am using:
{IF DOCUMENT.FIRST_VISIT<>"" THEN OBSANY("PTRXVISITS")+1 ELSE "" ENDIF}
OBSNOW("obs", STR(VAL(OBSANY("obs")) + 1))
Assuming this is in a data display or the like, that you're not trying to assign the new incremented value to obsnow, and you've used some kind of validation on the obs so you know it's alwasy returning a number, this should work:
{IF DOCUMENT.FIRST_VISIT<>"" THEN val(OBSANY("PTRXVISITS"))+1 ELSE "" ENDIF}
jjordet, that worked perfectly. Thank You. Now I am trying to use a button to clear the value. Will this not work? Now it is just taking the value down by one. ???
OBSNOW("PTRXVISITS", STR(VAL(OBSANY("PTRXVISITS"))=0))
OBSNOW("PTRXVISITS", "")
For some reason that is not working. It is only reducing the value by 1. I need to reset the obs term to a value of 1.
OBSNOW("PTRXVISITS", "1") should work.
unless you have another snippet of code that's setting it after this...