Below is the error I get:
{
/*FUNCTION DEFINITIONS*/
/*Function for RUNPROCESS Button Record Med Hx Obtained*/
fn fn5825_406_1377114880(){
(DOCUMENT.MED_HX_OBTAI_5825_359_1377114880) (DOCUMENT.DATE_5825_375_1377114880) rec_MedHx9() fn remove_MedHx9()
} <-COMPILER ERROR NEARBY: Expect LEFT CURLY BRACKET. Instead had RIGHT CURLY BRACE after RIGHT PAREN
Whats going on in the run process button (which works fine if uploaded from EFE file) is theres multiple functions, and i noticed when I take at all but one I don't get the above error.
Any thoughts?
This is pretty self explanatory
fn remove_MedHx9()
} <-COMPILER ERROR NEARBY: Expect LEFT CURLY BRACKET. Instead had RIGHT CURLY BRACE after RIGHT PAREN
fn indicates this is code for a function. There should be a left curly bracket that begins the actual code of the function after the () rather than a right. If you only want to call that function and the code is somewhere else, the fn needs to be dropped.
Can you post the code from the button or the watcher pane? Your action button really should be
functionname1()
functionname2()
(though I don't know if I have tried to call 2 functions from a button but "should" work)
And then your code for the functions in the watcher pane
{ fn functionname1() {
functioncode
}
}
{ fn functionname2() {
functioncode
}
}
Thanks for the response, when imported from EFE file when clicking, for example, the record Med HX button if there's nothing enter in the field or no date entered an error message will appear. Also as you'll see below there's a checkbox hidden basically there for a data display to call to displays an "*" when the record button is click indicating the user has already clicked that button.
Code used on the button:
{(DOCUMENT.MED_HX_OBTAI)}{(DOCUMENT.DATE)}{rec_MedHx9()}{fn remove_MedHx9()}
Code in watcher pane:
{fn rec_MedHx9(){OBSNOW("ConsentSignd", DOCUMENT.MED_HX_OBTAI, DOCUMENT.DATE) DOCUMENT.CHECK6 = "yes"}}
{fn recmove2_MedHx9() {
strdate = LASTOBSDATETIME("ConsentSignd")
OBSNOW("ConsentSignd"," ", strdate)}}
Yes, this:
"Code used on the button:
{(DOCUMENT.MED_HX_OBTAI)}{(DOCUMENT.DATE)}{rec_MedHx9()}{fn remove_MedHx9()}"
Needs to have the fn removed.
WOW thank you!
Works like a charm, any insight to why EFE form with the fn works just fine and why it doesn't with VFE?
My only guess would be that the fn really isn't there on the EFE form and that it just didn't translate properly into VFE? Other than that I haven't a clue. Really have never dealt with EFE but code should be code once it is in the EMR. Glad I could help 🙂