6 Replies Latest reply on Mar 2, 2017 5:21 PM by rouelf

    Enlarge document with a button

    glenngrankvist

      HI

      I am more or less ready with my customised CRM and start to work really good.

       

      My issue is that i have arrange a container field for document and picture so far so good, i even did a button to delete the doc
      But i also did a button to be able to enlarge document, but can not get it work.
      As i see it i don't get the connection between the button and the container in the same raw.

       

       

       

      thanks for the suport

       

      Mikael

        • 1. Re: Enlarge document with a button
          coherentkris

          The enlarge button could open a popover with an extra large container control in it to display the container contents "larger"

          • 2. Re: Enlarge document with a button
            glenngrankvist

            Thanks
            for you answer but i have a button and the idee is that if i press it the document would open up as PDF, word or JPG

            I don't know if i have to use a special script ?

             

            Thanks

            • 3. Re: Enlarge document with a button
              philmodjunk

              export field contents can export a copy to the temporary folder and open it.

              • 4. Re: Enlarge document with a button
                rouelf

                Attach a script to Open Button:

                Set Variable [ $file; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( Your_Table::Your_Container ; "Filename" ) ]

                Export Field Contents [ Your_Table::Your_Container; “$file”; Automatically open ]

                • 5. Re: Enlarge document with a button
                  philmodjunk

                  But keep in mind that this opens a copy  of the file. That may work exactly as you need it. But if users need to modify the now open file and have those changes saved back into the original document, that will no longer happen automatically when the user selects "Save" in the default application that launched when this file opened.

                   

                  You could, in such cases, make the path variable a global variable, add a save button to your layout and give it a script that uses the $$Path variable to re-insert the now modified copy of the file back into its original container.

                   

                  Or

                   

                  With some storage/insertion options and container fields, the field stores a reference (file path) to the original file instead of the file. In those cases, it is possible to open and modify the original copy of the file and any changes made will be automatically retained. This can encounter other issues for your container files for hosted solutions, but it does work.

                  • 6. Re: Enlarge document with a button
                    rouelf

                    My Apologies, had to edit what I posted:

                    One Can also use Open Url; Or if desired instead of Temporary Path, use DocumentPath. With DocumentPath a copy of the doc will be saved in the Documents folder.

                     

                    Script To Open (Button) file in Container:

                    If [ not IsEmpty ( Your_Table::Your_Container ) ]

                    # For Windows and OS X

                    If [ Get ( Device ) = 1 or Get ( Device ) = 2 ]
                    Set Variable [ $path; Value:"file:/" & Get ( TemporaryPath ) & GetContainerAttribute ( Your_Table::Your_Container ; "Filename" ) ]

                    Set Variable [ $path1; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( Your_Table::Your_Container ; "Filename" ) ]

                    Export Field Contents [ Your_Table::Your_Container; “$path1” ]

                    Open URL [ $path ] [ No dialog ]

                    # For iOS

                    Else If [ Get ( Device ) > 2 ]
                    Set Variable [ $path; Value:"file:" & Get ( TemporaryPath ) & GetContainerAttribute ( Your_Table::Your_Container ; "Filename" ) ]

                    Export Field Contents [ Your_Table::Your_Container; “$path” ]

                    Open URL [ $path ] [ No dialog ]

                    End If

                    End If

                    GotoField[ ]

                    Script To Save (Button) file in TempFolder to Container:

                    Set Variable [ $Path; Get ( TemporaryPath ) & GetAsText ( Your_Table::Your_Container ) ]

                    Set Variable [ $Path1; Value:"file:" & $Path ]

                    Insert File [ Your_Table::Your_Container; “$Path1” ] [ Storage method: Insert ] [ Display content ] [ Compression: Never compress ]

                    1 of 1 people found this helpful