• Error adding code to Database script

    By Palm Palmkes 1 decade ago

    I get an error on this line when saving the code:

    Set doc_Profile = db.GetProfileDocument("frmActivityTrackingProfile")

    Variable not declared doc_Profile

    • Can you please provide more details?

      By Chris Blatnick 1 decade ago

      Hello,



      Can you please tell me exactly where in the code (sub, function, etc.) you are getting this message? I cannot duplicate your error. Also, any additional info (Notes version, etc.) that you could provide would be very helpful.



      Thank you!

      • Can you please provide more details?

        By Andy A Coker 1 decade ago

        Hi,



        I get the same error when placing the code in the Database Script - this is on a mail file running the lastest 7.0.2 openntf mail template. The bottom left reports that 2 errors were found. The script is highlighted in red on this line.



        Set doc_Profile = db.GetProfileDocument("frmActivityTrackingProfile")



        Thanks



        Andy

        • Make the following change

          By Chris Blatnick 1 decade ago

          OK…I figured it out. I missed the fact before that this was in the Database Script. I apologize for that. To fix this error, just dim the doc_Profile variable as so:



          Dim doc_Profile As NotesDocument



          I forgot to add "Option Declare" to the (Options) section (bad coding practice on my side) and the folks encountering this error probably had this turned on by default. Since I forgot to dim this variable, this is why you were getting the error message.