1 Reply Latest reply on Nov 7, 2011 12:08 PM by philmodjunk

    Design Functions are not complete

    DavidSimmons

      Title

      Design Functions are not complete

      Your post

      I have been looking for a way to find fields and Layouts that are not use in my solution. I know about th Database Design Report and find it a pain in the as I was saying. It does not really tell me what I want to know. So started creating some scripts to do what I needed. My Goal was to create something I could use to search for anything in my design to see were and how it was used.

       

      1.) First I created a table "dbSchema" with the folowwing fields

      Table, Layout, FieldName, ValueList, ScriptName, Script, and Comment

      Next I created the included scripts in the dbSchema folder. Then started to see the incomplete functionality. 

      2.) I could get all tables but could not get all fieldname for table.

      3.) I could get all Layouts and then get field names but could not link them to a table.

      4.) I could get all script names but could not get the script content.

      Sometimes Filemaker developers just don't make any since. They just frustrates me. They obviously do it the Database Report. Why not in the design scripts.

      Maybe someone knows a way to get the script content so I can insert into my dbSchema table, if I would really appreciate it.

      Scripts ----->

      dbSchema: Tables

      Set Error Capture [ On ]

      Close Window [ Name: "Log"; Current file ]

      New Window [ Name: "Log"; Height: WindowScreenHeight; Width: WindowScreenWidth; Top: WindowTopOffScreen ]

      Go to Layout [ “dbSchemaTable” (dbSchema) ]

      Delete All Records

      [ No dialog ] Show Custom Dialog [ ] Set Variable [ $TableNames; Value:TableNames ( $$Database ) ] If [ $TableNames ≠ "" ]

      Set Variable [ $counter; Value:1 ] Loop

      Exit Loop If [ GetValue ( $TableNames ; $counter ) = "" ] New Record/Request Set Field [ dbSchema::Table; GetValue ( $TableNames ; $counter ) ]

      Set Field [ dbSchema::Comment; Get ( ScriptName ) ]

      Commit Records/Requests

      [ No dialog ] Set Variable [ $counter; Value:$counter + 1 ]

      End Loop End If

      Perform Script [ “Layouts” ] Perform Script [ “Scripts” ] Perform Script [ “ValueList” ]

       

      dbSchema: Layouts

      Set Variable [ $LayoutNames; Value:LayoutNames ( $$Database ) ] If [ $LayoutNames ≠ "" ]

      Set Variable [ $counter; Value:1 ] Loop

      Exit Loop If [ GetValue ( $LayoutNames ; $counter ) = "" ] New Record/Request Set Field [ dbSchema::Layout; GetValue ( $LayoutNames ; $counter ) ]

      Set Field [ dbSchema::Comment; Get ( ScriptName ) ]

      Commit Records/Requests

      [ No dialog ] Perform Script [ “LayoutFieldNames”; Parameter: GetValue ( $LayoutNames ; $counter ) ] Set Variable [ $counter; Value:$counter + 1 ]

      End Loop End If


      dbSchema: LayoutFieldNames

      Set Variable [ $FieldNames; Value:FieldNames ( $$Database ; GetValue ( Get ( ScriptParameter ); 1 ) ) ] If [ $FieldNames ≠ "" ]

      Set Variable [ $counter; Value:1 ] Loop

      Exit Loop If [ GetValue ( $FieldNames ; $counter ) = "" ] New Record/Request Set Field [ dbSchema::Layout; GetValue ( Get ( ScriptParameter ); 1 ) ]

      Set Field [ dbSchema::FieldName; GetValue ( $FieldNames ; $counter ) ]

      Set Field [ dbSchema::Comment; Get ( ScriptName ) ]

      Commit Records/Requests

      [ No dialog ] Set Variable [ $counter; Value:$counter + 1 ]

      End Loop End If


      dbSchema: ValueList

      Set Variable [ $ValueList; Value:ValueListNames ( $$Database ) ] If [ $ValueList ≠ "" ]

      Set Variable [ $counter; Value:1 ] Loop

      Exit Loop If [ GetValue ( $ValueList ; $counter ) = "" ] New Record/Request Set Field [ dbSchema::ValueList; GetValue ( $ValueList ; $counter ) ]

      Set Field [ dbSchema::Comment; Get ( ScriptName ) ]

      Commit Records/Requests

      [ No dialog ] Set Variable [ $counter; Value:$counter + 1 ]

      End Loop End If


      dbSchema: Scripts

      Set Variable [ $ScriptNames; Value:ScriptNames ( $$Database ) ] If [ $ScriptNames ≠ "" ]

      Set Variable [ $counter; Value:1 ] Loop

      Exit Loop If [ GetValue ( $ScriptNames ; $counter ) = "" ] New Record/Request Set Field [ dbSchema::ScriptName; GetValue ( $ScriptNames ; $counter ) ]

      Set Field [ dbSchema::Comment; Get ( ScriptName ) ]

      Commit Records/Requests

      [ No dialog ] Set Variable [ $counter; Value:$counter + 1 ]

      End Loop End If




       

        • 1. Re: Design Functions are not complete
          philmodjunk

          While I aggree that the DDR could be improved, everything in your process, IS listed in the DDR and text searches of the DDR can be a fairly simple way to check and see if a particular object is still in use or "deadwood" that can also be pruned from your current system. There are several third party developer tools you can investigate via a web search that may offer better approaches if you want to explore them.

          BTW, why is this posted in the FM Server Forum?

          Seems like one that should be in the FM Pro Forum...