1 2 Previous Next 17 Replies Latest reply on Jun 12, 2009 2:17 PM by mrvodka

    conditional formatting

    dontneedanotherstinkingname

      Summary

      conditional formatting

      Description of the issue

      Good god this is alot of trouble just to repaort a bug. Filemaker pro 10  I wanted to report a bug, but I did not want to waste my time setting up a user account, but guess what there was no way to do it otherwise. The bug is this when conditional formatting is used with a formula to determine the formatting and then latter a script is used to copy and paste the information from the field that has the conditional formatting into another field the copied information is pasted twice!What I was doing was setting up one field to change text color when another field has the word “pending” in it.If there is a work around for this I would be happy to hear of it.  Best regards,Randy MorganAll Service Musical Electronics Repair617 SE MorrisonPortland, Oregon  97214503-231-6552  Voice503-239-7157  faxservice@asmusic.org (e mail)www.all-service-musical.comEXPERT REPAIR ON ALL ELECTRONICMUSICAL EQUIPMENT ... SOLID STATEAND TUBE, HOME & PROFESSIONAL.FOR 23 YEARS AND COUNTING.In shop and in home service available.  “I dont think I can replicate your issue. The only thing is if it pastes into a field, and you do not have select entire contents option on, it will paste it after existing value, so if you already have a value, it will look like it has it twice. Also instead of copy and paste, you should probably use Set Field [] instead.”  No the entire field that the information goes into is cleared in the first step of the script.What this scripts does is take all the pertinent information from a parts order such as quantity &  description and paste it all into a temporary field one line at a time, then that entire field is copied and pasted into an email. The scrip worked dandy until I applied the conditional formatting as described. Then it started duplicating anything that was conditionally formatted via a formula when it is pasted into the temporary field. I can format the same fields with the contains, equals etc and the duplication does not occur. Unfortunately doing that way does not accomplish what I need in the end which is total automation of the text color in one field when a particular word is placed in another field.  I know of two basic ways to do what you describe: Use the Copy and Paste steps to move the data. Use set field and/or set variable to move the data. The second method is strongly recommended as it does not require the referenced fields to be present on the current layout and does not change the contents of the system clipboard. Which method did you use when you encountered this bug?    Copy and paste. I am not sure I understand how the process I have described above could be accomplished with the set field command. Please enlighten me.    

        • 1. Re: conditional formatting
          mrvodka
             I dont think I can replicate your issue. The only thing is if it pastes into a field, and you do not have select entire contents option on, it will paste it after existing value, so if you already have a value, it will look like it has it twice. Also instead of copy and paste, you should probably use Set Field [] instead.
          • 2. Re: conditional formatting
            philmodjunk
              

            I know of two basic ways to do what you describe:

             

            Use the Copy and Paste steps to move the data.

             

            Use set field and/or set variable to move the data.

             

            The second method is strongly recommended as it does not require the referenced fields to be present on the current layout and does not change the contents of the system clipboard.

             

            Which method did you use when you encountered this bug?

            • 3. Re: conditional formatting
              dontneedanotherstinkingname
                

              Just a quick update. If I do the same process and change the background color I still get duplicated values when I run my script. Is there a way to change the field background or text color dependant on the value in another field other than using conditional formatting?  Just a note the text is variable so the TEXTCOLOR function as far as I can tell is not an option.

               

              Regards,

              Randy

              • 4. Re: conditional formatting
                mrvodka
                   Did you try using Set Field [] as suggested?
                • 5. Re: conditional formatting
                  dontneedanotherstinkingname
                    

                  Yes. Unless I am missing something set field allways overwrites the existing information in the field. I am taking information from 45 feilds alltogether, as well several lines of text, spaces & carraige returns for formatting purposes. This is then pasted into a feild and then that field is copied and pasted into an e mail. 

                  Funny thing is when I make a short test version of the script I do not get the duplications of information when conditional formatting wth a fourmula is used.

                   

                  Regards,

                  Randy

                  • 6. Re: conditional formatting
                    philmodjunk
                      

                    The details here are important. Please spell out in detail exactly what you are doing and what platform you are using.

                     

                    Perchance you are using "copy all records"?

                    • 7. Re: conditional formatting
                      dontneedanotherstinkingname
                          

                      Carefull what you ask for :smileyhappy:

                       

                      Hopefully this shows up OK once I post it.

                       

                      Regards,

                      Randy

                       

                       

                       

                      • 8. Re: conditional formatting
                        philmodjunk
                          

                        I'm getting empty boxes on my end. :smileysad:

                         

                        Some people use Print to make a PDF of their script and then copy/paste the text into their forum post. Since I have FMP adv, I sometimes copy from the database design report script listing.

                        • 9. Re: conditional formatting
                          dontneedanotherstinkingname
                            

                          Okay that last attemt did not work so well. Lets try this one.

                           

                          Freeze Window

                          Go to Layout [ "Layout #1" ]

                          Insert Text [ parts::EMAIL; "PLEASE FIND BELOW A COPY OF THE ORDER OR REQUEST THAT WE PREVIOUSLY SENT YOU.

                          IMPORTANT .... THIS IS NOT A NEW ORDER ... WE ARE FOLLOWING UP ON PREVIOUSLY PLACED ORDER OR REQUEST!!

                          " ]

                          Insert Current Date [ parts::Last date ]

                          [ Select ]

                          Go to Field [ parts:: DATES FAXED: ]

                          Insert Text [ " E/M " ]

                          Insert Current Date [ ]

                          Insert Text [ "-" ]

                          Insert Current Time [ ]

                          Insert Text [ " " ]

                          Go to Field [ parts::EMAIL ]

                          Insert Text [ "

                          < < < < < < < < < < < < < <

                          " ]

                          Insert Current Date [ ]

                          Insert Text [ " " ]

                          Insert Current Time [ ]

                          Insert Text [ " " ]

                          Insert Text [ " REFERENCE / OR PO#: " ]

                          Copy [ parts:: PO# ]

                          [ Select ]

                          Go to Field [ parts::EMAIL ]

                          Paste [ ]

                          [ No style ]

                          Insert Text [ "

                          > > > > > > > > > > > > > > ORIGINAL ORDER DATE: " ]

                          Copy [ parts:: ORDER DATE: ]

                          [ Select ]

                          Go to Field [ parts::EMAIL ]

                          Paste [ ]

                          [ No style ]

                          Insert Text [ "Please fill the following parts order / or provide information as requested, Ship orders to : All Service Musical at 617 SE

                          Morrison ... Portland, Oregon 97214.

                          Please remember, we do not accept COD shipments without our express consent.

                          If this request was not sent to the correct email address please forward it to the proper department .... Thanks

                          " ]

                          Insert Text [ "ORDERED FROM: " ]

                          Go to Field [ parts:: ORDERD FROM: ]

                          Copy [ ]

                          [ Select ]

                          Go to Field [ parts::EMAIL ]

                          Paste [ ]

                          [ No style ]

                          Insert Text [ "

                          " ]

                          EMAIL PARTS ORDER CHECK

                          Insert Text [ "

                          PLEASE SHIP THIS ORDER VIA:" ]

                          Go to Field [ parts::SHIP VIA: ]

                          Copy [ ]

                          [ Select ]

                          Go to Field [ parts::EMAIL ]

                          Paste [ ]

                          [ No style ]

                          Insert Text [ "

                          QUANTITY DESCRIPTION

                          " ]

                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                          section below repeats 15 times

                          Go to Field [ parts::QUANTITY ]

                          Copy [ ]

                          [ Select ]

                          Go to Field [ parts::EMAIL ]

                          Paste [ ]

                          [ No style ]

                          Insert Text [ " " ]

                          Copy [ parts:: DESCRIPTION ]

                          [ Select ]

                          Paste [ parts::E mail ]

                          #X

                          Insert Text [ parts::EMAIL; " ....." ]

                          Copy [ parts::Recieved ]

                          [ Select ]

                          Paste [ parts::EMAIL ]

                          Insert Text [ "

                          " ]

                          above section repeats 15 times with field names

                          incrementing ( Quanity1, Quantity2 etc )

                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                           

                          #Email above <<<<<<<<<<<< Email Temp below >>>>>>>>>>>>>>>>>>>

                          Cut [ parts::Email temp ]

                          [ Select ]

                          Insert Text [ parts::Email temp; "PLEASE FIND BELOW A COPY OF THE ORDER OR REQUEST THAT WE PREVIOUSLY SENT YOU.

                          IMPORTANT .... THIS IS NOT A NEW ORDER ... WE ARE FOLLOWING UP ON PREVIOUSLY PLACED ORDER OR REQUEST!!

                          " ]

                          Insert Text [ parts::Email temp; "

                          " ]

                          Go to Field [ parts::Email temp ]

                          Insert Text [ "

                          EMAIL PARTS ORDER CHECK

                          < < < < < < < < < < < < < <

                          " ]

                          Insert Current Date [ ]

                          Insert Text [ " " ]

                          Insert Current Time [ ]

                          Insert Text [ " " ]

                          Insert Text [ " REFERENCE / OR PO#: " ]

                          Copy [ parts:: PO# ]

                          [ Select ]

                          Go to Field [ parts::Email temp ]

                          Paste [ ]

                          Insert Text [ parts::Email temp; "

                          " ]

                          Insert Text [ "

                          > > > > > > > > > > > > > > ORIGINAL ORDER DATE: " ]

                          Copy [ parts:: ORDER DATE: ]

                          [ Select ]

                          Go to Field [ parts::Email temp ]

                          Paste [ ]

                          Insert Text [ parts::Email temp; "

                          " ]

                          Insert Text [ parts::Email temp; "

                          " ]

                          Insert Text [ "Please fill the following parts order / or provide information as requested.

                          Ship orders to : All Service Musical at 617 SE Morrison ... Portland, Oregon 97214.

                          Please remember, we do not accept COD shipments without our express consent.

                          If this request was not sent to the correct email address please forward it to the

                          proper department .... Thanks

                          " ]

                          Insert Text [ "ORDERED FROM: " ]

                          Go to Field [ parts:: ORDERD FROM: ]

                          Copy [ ]

                          [ Select ]

                          Go to Field [ parts::Email temp ]

                          Paste [ ]

                          Insert Text [ "

                          " ]

                          Insert Text [ "

                          PLEASE SHIP THIS ORDER VIA:" ]

                          Go to Field [ parts::SHIP VIA: ]

                          Copy [ ]

                          [ Select ]

                          Go to Field [ parts::Email temp ]

                          Paste [ ]

                          Insert Text [ "

                          EMAIL PARTS ORDER CHECK

                          QUANTITY DESCRIPTION

                          " ]

                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                          THIS SECTION REPEATS 15 TIMES AS WELL

                          Go to Field [ parts::QUANTITY ]

                          Copy [ ]

                          [ Select ]

                          Go to Field [ parts::Email temp ]

                          Paste [ ]

                          Insert Text [ " " ]

                          Copy [ parts:: DESCRIPTION ]

                          [ Select ]

                          Paste [ parts::Email temp ]

                          Insert Text [ parts::Email temp; " ....." ]

                          Copy [ parts::Recieved ]

                          [ Select ]

                          Paste [ parts::Email temp ]

                          #X

                          Insert Text [ "

                          " ]

                          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

                          Send Mail [ Send via E-mail Client; To: parts::E mail; Subject: parts:: PO#; Message: parts::Email temp ]

                          Commit Records/Requests

                          [ No dialog ]

                           

                          Okay why have some of the parts of this post converted to emotions! Can I turn them off or what?

                          • 10. Re: conditional formatting
                            philmodjunk
                              

                            First the simple bit: you can edit your post and kill off all those @#$%@% emoticons by selecting edit from the options menu just above the Kudos control on the upper right. Insert a space after the second colon. You can double check your message before posting by clicking preview. You can even delete your earlier post that overwhelms my browser with empty boxes.

                             

                            At first glance, I don't see why conditonal formatting should affect the function of your script.

                             

                            What I am seeing is a great deal of Insert, copy and paste steps that are no longer needed in the latest versions of filemaker. All of those steps, (and Go TO field) only work as expected if they are on the current layout. Subsequent layout modifcations, can thus "break" your script if they inadvertantly remove one of the referenced fields.

                             

                            Use Set Field instead.

                             

                            If you need to assemble several different items in a single field, you can use one of the following expressions:

                             

                            Set Field [YourTable::YourField; YourTable::YourField & YourTable::SecondField]

                            Set Field[YourTable::YourField; table::fld1 & table::fld2 & table::fld3]

                             

                            Now the presence or absence of any conditional formatting should not in anyway affect the outcome of your script.

                            • 11. Re: conditional formatting
                              philmodjunk
                                

                              For what it's worth I opened a sample database file

                               

                              And defined a simple color change conditional format for one text field: Text1. Some of the records show red text others black depending on the value of the copied field.

                               

                              I then set up a simple test script:

                               

                              Loop

                                Copy[Select; MainTable::Text1]

                                Paste[select; MainTable::Text2]

                                Go To Record/Request/Page [Next; Exit after last]

                              End Loop

                               

                              I ran the script with the first record selected and each copy/paste correctly pasted the expected text into text2.

                               

                              Using FMP 10 v2 on Windows XP SP3 on a List View Layout.

                              • 12. Re: conditional formatting
                                dontneedanotherstinkingname
                                  

                                Okay I see where you are going with the set feild. It will be a lot of work to redo the script, but I will give it a shot. One thing I am stuck on though. Is there an easy way to paste the current date and time into the formula? Hopefully in the end I don't end up with the same issue .. that would be a bummer.

                                 

                                Regards,

                                Randy

                                • 13. Re: conditional formatting
                                  mrvodka
                                    

                                  Set Field [ YourDateField; Get (CurrentDate) ]

                                  Set Field [ YourTimeField; Get (CurrentTime) ]

                                   

                                  As we both stated earlier, using Set Field [] is the way to go. Copy and Paste not only require the field to be on the layout, but it also kills a user's clipboard... not ideal.

                                  • 14. Re: conditional formatting
                                    dontneedanotherstinkingname
                                      

                                    Well I got the new script completed and everything works. I am still not sure why there was an issue with the old script as you said looks like it should work. Thanks for your help in getting the matter resolved.

                                    Do you know if there is a way to send the field data over to an email so it apears in nice neat colums?

                                     

                                    Like this:  Quantity                     Description      

                                     

                                                       1                Left handed widget                            Received           

                                                       10              Right handed special wiget                 Pending

                                     

                                    As opossed to this:

                                     

                                                   Quantity                   Description

                                            

                                                        1               Left handed widget                             Received

                                                        10               Right handed special widgets                           Pending

                                     

                                     

                                    Regards,

                                    Randy

                                    1 2 Previous Next