1 Reply Latest reply on Jul 10, 2012 6:25 AM by philmodjunk

    Using one portal to add info to different existing records???



      Using one portal to add info to different existing records???


      Hi There,


      I'm trying to use Filemaker pro to build a database that records projects in our metal fabrication workshop. So far I have a clients table with a portal that creates a record in the projects table. I also have a purchase orders table for ordering materials. Sometimes we use a purchase order to order from only one supplier but for different projects. I want to use the project ID in the purchase orders table so that the information is added to the relevant project record and expenditure can be tracked. I am currently trying to use a portal for this, but can only get the portal to create a whole new project record rather than add info to an existing one. I'm not sure if I can get a portal to do this or if there is a different method I should be using, or a combination of methods.


      I am VERY new to this so please let me know if you require more info than this. I am slowly getting used to the filemaker jargon but may need some things explaining in simpler ways- sorry!


      Any help at all would be really appreciated.


      Many many thanks.

        • 1. Re: Using one portal to add info to different existing records???

          While it's certainly possible to set up a script that updates your existing Project table with data from your Purchase Orders table, I don't think that this is your best option here as you might have any number of Purchase Orders for one Project and items on same order purchased for any number of projects.

          I suggest the following relationships:


          PROJECTS and lineItemPROJECTS would be two occurrences of the same Projects table.

          Clicking a button in the row of the portal to PROJECTS should be set up to do one of these options, depending on your preferences:

          1) Loads a global variable with the ProjectID such that the next new LineItem Record auto-enters the projectID from this variable.

          Set Variable [$$ProjectID ; PROJECTS::ProjectID // an auto enter calculation in LineItems::PRojectID must be set up to copy from variable]

          2) Updates the last record in the portal, (The most recently added one), to receive the ProjectID of the clicked portal row.

          Set Variable [$ProjectID ; PROJECTS::ProjectID ]
          Go To Object ["LineItemsPortal" ] //In layout mode, give lineitems portal this object name
          Go to Portal Row [last]   // last portal row is blank "add" row if "allow creation via this relationship" is enabled in the portal's relationship
          Go to Portal Row [Previous]
          Set Field [LineItems::ProjectID ; $ProjectID ]

          3) Creates a new record in LineItems with the selected ProjectID (This may be best).

          Set Variable [$ProjectID ; PROJECTS::ProjectID ]
          Set Variable [$POID ; PO's::POID ]
          Freeze Window
          Go to Layout [LineItems]
          New Record/Request
          Set Field [LineITems::POID ; $POID]
          Set Field [LineItems::PRojectID ; $ProjectID]
          Go To Layout [original layout]