8 Replies Latest reply on Oct 16, 2012 9:11 AM by Annette

    Conditional Formatting???

    Annette

      Title

      Conditional Formatting???

      Post

            Hi and thank you in advance on any help you can offer. 

           I am working on a layout which I have attached a screenshot of to this post.  Basically what I would like to know is when I click the Add'l Info button, can it bring me to a particular layout based on what is chosen in the drop down list for the Service field (says EIT in image)?

           Thanks

      Layout.JPG

        • 1. Re: Conditional Formatting???
          Sorbsbuster

               You could capture the Service data at the point of clicking the button.  Say:

               Set Variable [$Service ; ThatPortalRelationship::Service ]

               Then do whatever your script is doing now to show the Additional Info record, but tack on to the end of it:

               If [$Service = "EIT" ]
               Go to Layout [The One you want for EIT]
               Else If [$Service = "ABC" ]
               Go to Layout [The One you want for ABC]
               etc
               End If

                

          • 2. Re: Conditional Formatting???
            Annette

                  Ok first off I would like to apologise right from the start because I'm a disaster!!

                 I hadn't a script done yet so I was trying to start this from scratch, but it seems no matter which way I do it it's not working so if you wouldn't mind helping me further. 

                 Here is what I've done so far.... 

                 Basically the image above shows a portal which is showing records from the EOC table.  I've created an additional table called EOC Details which has the extra information I need to capture.  I have a field on the EOC Details table called EOC_FK which is how I have it related to EOC table to the EOCID (EOC Details also has it's own primary key).  Do I need to have this additional table?

                 Now, like I said I started to write a script for the button to bring me to different layouts depending on what was selected in the Service (EOC Type) field.  I tried this

                   
            •           if [not[isempty (EOC::EOCID)
            •      
            •           Show custome dialog etc
            •      
            •           If [Get (last messagechoice) etc
            •      
            •           Freeze window
            •      
            •           Set Variable [$Service; Value: EOC::EOCType]
            •      
            •           Go To Layout [EOC Details (EOC)]
            •      
            •           New Record Request
            •      
            •           Set Field [EOCDetails:: EOCID_FK; $Service]
            •      
            •           Commit Records / Requests etc
            •      
            •           Go To Layout {original]
            •      
            •           End If
            •      
            •           End if
            •      
            •           If [$Service = "EIT" ]
            •      
            •           Go to Layout [EIT (EOC)]
            •      
            •           Else If [$Service = "5-18" ]
            •      
            •           Go to Layout [5-18 (EOC)
            •      
            •           End If

                 I think my error is in my variable but I just learned how to work with Variable yesterday!  ha ha

                 Again, just for reference

                   
            •           EOC Table  - EOCID (PrimaryKey), clientID, EOCType, etc
            •      
            •           EOC Details Table - EOCDetailsID (Primary Key), EOC_FK (linked to EOC::EOCID) , etc
            • 3. Re: Conditional Formatting???
              philmodjunk

                   What is the relationship between your layout's table and the portal's table?

                   Is the portal's table based on the EOC table or is the layout's table based on EOC? (EOC will be listed in "Show Records From" in layout setup if the layout is based on it. It will show in "show Related records from" in portal setup for the portal if the portal is based on it.)

              • 4. Re: Conditional Formatting???
                Annette

                      I think I'm over-thinking this and making it more difficult than it needs to be to be honest. 

                     The EOC portal in the image above is based on the EOC Table and basically when I click that additional info button i just want it to pop up a window to add more information for that portal row so I guess it's meant to be all saved on the same table???  The reason I wanted to make the button bring me to different layouts depending on the EOC Service type was because different types of services collect information that others wouldn't necessarily collect.  So i thought making a layout with the fields specific to the service type selected would make it easier for the user to fill in the appropriate fields. 

                • 5. Re: Conditional Formatting???
                  philmodjunk

                       A layout based on the EOC table is a commonly used option for what you want. It just wasn't clear from your original script and screen shot what was what. I believe I suggested a script to you earlier and what you have here isn't quite what I recommended.

                       Next question: Why do you need different layouts for different service types such as the EIT in your example?

                       These will all be records in the same table, so there is a good chance that you need only one layout for your data entry purposes stated here.

                       Assuming that you use only one layout for this, the minimum required steps for your script would look like this:

                       If [ not IsEmpty ( EOC::EOCID) ]
                          Go To Related Record [Show only related records; From table: EOC; Using layout: "EOC Data Entry" (EOC)]
                       End IF

                       Note: change the text shown in blue to match the name of an actual layout in your database that you have set up for entering EOC data.

                        

                  • 6. Re: Conditional Formatting???
                    Annette

                          The information that I have shown on the portal is the common fields that all different referral types will collect.  But beyond that different referrals require additional information specific to it.  i.e. An EIT referral may collect 20 additional fields of information on the referral specific to only EIT referrals and 5-18 referral may collect 5 additional fields specific to 5-18 referrals.  So rather than having one layout which shows all 25 fields when most may not be relevent to the referral you are entering I wanted it to only show the relevent fields to the referral (even though behind the scenes they are all saved on the one EOC table).  Does that make sense?  Basically its a way of ensuring the user doesn't get confused as well ha ha!

                    • 7. Re: Conditional Formatting???
                      philmodjunk

                           In which case my previous example can be modified as:

                           If [ not IsEmpty ( EOC::EOCID) ]
                              If [EOC:: Service Type = "EIT" ]
                                    Go To Related Record [Show only related records; From table: EOC; Using layout: "EIT Data Entry" (EOC)]
                              Else IF [EOC::Service Type = "5-18"]
                                    Go To Related Record [Show only related records; From table: EOC; Using layout: "5-18 Data Entry" (EOC)]
                              #continue this patter for each possible Service Type
                              End IF
                           End IF

                           Note that the only difference in the Go To Related Record steps are the names of the layout specified. Note also that both of the layouts are based on the EOC table.

                      • 8. Re: Conditional Formatting???
                        Annette

                              Thanks so much........

                              

                             and.....

                              

                             I was SO over-thinking it!