8 Replies Latest reply on Jan 5, 2013 7:26 PM by listen2earth

    Pass a Container Field to Unrelated File

    JFWX5

      Hi All,

       

       

      Here is a script I have in my main file "ME":

       

       

       

      Export pdf to Snap2FM

      Open File [ “snap2fm” ] [ Open hidden ]

      Set Field [ ME::GlobalSnap2FM; ME::UniqueID ]
      Perform Script [ “get global id from ME With Out Scan” from file: “snap2fm”; Parameter: ME::GlobalSnap2FM ] Go to Layout [ “ME Certificate” (ME) ]
      Set Variable [ $Desktoppath; Value:Get ( DesktopPath ) ]
      Set Variable [ $filepath; Value:$Desktoppath & ( Funeral::Full Name & " " & ME::UniqueID) & ".pdf" ]

      Which Calls in Snap2FM

       

       

      get global id from ME With Out Scan


      If
      [ not IsEmpty ( Get ( ScriptParameter ) ) ]

      Set Field [ Documents::GlobalSnap2FM; Get ( ScriptParameter ) ]

      Go to Layout [ “Documents” (Documents) ]
      Perform Script [ “Create New Document from ME” ]

       

      End If



       

      Which Calls

       

      Create New Document from ME


      New Record/Request

      Set Field [ Documents::UniqueID; Documents::GlobalSnap2FM ]

      #This next step inserts the document type into the record.
      Set Field [ Documents::Type of Document; "RIMECC" ]
      #This next step inserts the Sub document type into the record.

      Set Field [ Documents::Type of Sub Document; "DCME" ]

       



      How would I modify the above script(s) to have the pdf created in the 1st script placed in the Document::Document field of Snap2FM


      Please note the files are not related and I don't wish to relate them, they are setup as external data sources.



      Thank you & Happy New Year,

       

       

      John

        • 1. Re: Pass a Container Field to Unrelated File
          gdurniak

          Temporarily set a Global Container

           

          This can be seen by non related files

           

          greg

           

           

          > How would I modify the above script(s) to have the pdf created in the 1st  script placed in the Document::Document field of  Snap2FM


          Please note the files are not related and I don't wish to relate them, they are setup as external data sources

          1 of 1 people found this helpful
          • 2. Re: Pass a Container Field to Unrelated File
            JFWX5

            Greg,

             

             

            I've been banging my head against the wall trying to set the global container and pass it to the other file with no luck!

             

            Could you show me what has to be changed?

             

             

            Happy New Year,

             

            John

            • 3. Re: Pass a Container Field to Unrelated File
              gdurniak

              The "other" file must appear somewhere on your graph, and can be un-attached

               

              and a Global must be set in the "other" file ( and can be set by calling a script in the "other" file, if required )

               

              That should work

               

              greg

               

              > I've been banging my head against the wall trying to set the global container and pass it to the other file with no luck!

              • 4. Re: Pass a Container Field to Unrelated File
                RubenVanDenBoogaard

                Hi John,

                 

                An other aproach could be to send the pdf as script parameter to the Snaps2FM file

                 

                something like:

                 

                Perform Script [ “set document” from file: “snap2fm”; Parameter: ME::container with PDF ]

                 

                and ons snap2FM

                 

                set document:

                If [ not IsEmpty ( Get ( ScriptParameter ) ) ]

                Set Field [ Documents::document; Get ( ScriptParameter ) ]

                End If

                 

                Hope that helps;

                 

                Best regards,

                 

                Ruben van den Boogaard

                Infomatics Software

                ruben@infomatics.nl

                1 of 1 people found this helpful
                • 5. Re: Pass a Container Field to Unrelated File
                  JFWX5

                  Greg & Ruben

                   

                   

                  After doing some research I don't want to use globals as too many add to the tables.  I have so many now I'm going to go back and change them to script parameter's

                   

                   

                  But as for Ruben's idea of passing it over I have a couple of problems:

                   

                   

                  1 The ME.pdf does not reside in a container it's in a variable and I don't want to store it in ME container I want to cut down on bloat.

                   

                  2  How would I pass both script parameters from ME over to the Snap2FM?

                   

                   

                  Thanks

                   

                  John

                  • 6. Re: Pass a Container Field to Unrelated File
                    RubenVanDenBoogaard

                    Hi John,

                     

                    Use a separator to send more then one parameter to Snap2FM

                     

                    you could use _  so UniqueID_PathToPDF

                     

                    and extract the data in Smap2FM by using

                     

                    $UniqueID= leftwords(Get ( ScriptParameter );1)

                    $PathToPDF=middlewords(Get ( ScriptParameter );2;100)

                     

                    When the parameters might contain word separators you could use more advanced separators like the pipe |

                    ore even high ascii, or XML, but those are harder to split at the reciever side.

                     

                    Hope that helps,

                     

                    Best regards,

                     

                    Ruben van den Boogaard

                    Infomatics Software

                    ruben@infomatics.nl

                    • 7. Re: Pass a Container Field to Unrelated File
                      JFWX5

                      Ruben,

                       

                      I don't seem to understand what you wrote.  I don't seem to be able

                       

                      to get things working correctly!

                       

                       

                      Any way you could write out scripts, taking into account that I

                       

                      want to get rid of using globals in these scripts?

                       

                       

                      Thanks,

                       

                       

                      John

                      • 8. Re: Pass a Container Field to Unrelated File
                        listen2earth

                        Someone told me long ago that Global Fields are accessable from between any file any tables without relationships.

                        i not ever implemented this.

                        i not read all whats going on but thought to pass this on to you by chance it may point a direction ??

                         

                        robert