3 Replies Latest reply on Mar 31, 2010 12:45 PM by Anas

    Save checkbox values in a portal

    Anas

      Title

      Save checkbox values in a portal

      Post

      Ok, lets make it simpler:

       

      I have to tables (first: "SocialHistory", second: "MedicalExamination"), the second is related to the first by a "PatientNr".

      There will be for example 100 patients (so 100 SocialHistories), but 140 MedicalExaminations (because a patient may come more than once to the same doctors office).

      In the first table's layout i have checkboxes referring from the second table and an portal also to the second table.

      I use this scriptScript

       to create a new record in the related table, and add the symptoms I found examining the patient.

      Next time patient comes, they may be different, that's why I want to save the symptoms in the portal below (I made a calculation which is called "All_the_symtoms" and added symptoms from each organ.). But its not working. Performing the script for a second time creates a new empty record, but through the checkboxes i can only alter the first(!) record. The second remains empty.

      Here's my layout: 

      I know that the easiest way is to put the checkboxes in the portal, but it looks ugly. I want only to have a small synopsis of symptoms from the last visit in the portal.

       

      I will appreciate your help.

       Constantinos

        • 1. Re: Save checkbox values in a portal
          Anas

          Image links were not working

          Thats the script

          whic is working fine

           

          and thats what i want to do

          http://i43.tinypic.com/nei62h.jpg

          • 2. Re: Save checkbox values in a portal
            philmodjunk

            Make your check box fields at the top global fields so that their contents are accessible even after you change layouts.

             

            In your script to create a new record in the portal add lines that fill the text field with the contents of your check box fields.

             

            Set Variable [$PatientNr ; Value: SocialHistory:: PatientNr]

            Go To Layout [ExaminationbyPatientNr]

            New Record/Request

            Set Field [ExaminationbyPatientNr::$PatientNr]

            Set Field [ExaminationbyPatientNr::All The Symptoms ; SocialHistory::gCheckbox1 & ¶ & SocialHistory::gCheckbox2 & ¶ & SocialHistory::gCheckbox3 & ¶ & SocialHistory::gCheckbox4]

            Go To Layout [Original Layout]

             

            Keep in mind that if you make multiple selections in a single check box field each selection will show as a separate line of text. You may want to use the subsitute function to replace ¶ (carriage returns) with some other text such as a comma and space to reduce the number of lines of text that are copied to the text field.

            • 3. Re: Save checkbox values in a portal
              Anas

              Wow man, I love you!

              I knew your little "magician-wise man" icon would solve my 3days lasting problem.

               

              Live well,

              Constantinos