Jump to content

Way to handle new records


This topic is 2499 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a layout that you enter data in. As you enter the layout a script triggers to create a new record. Two buttons on the top "save" and "do not save" have scripts attached to them. "Save" takes you to the main layout and "do not save" deletes the newly created recorded and takes you to the main layout.

 

Is there a better way to handle this?

This layout is a form and the idea is not to see the other records created.

 

Cheers.

Link to comment
Share on other sites

In such a scenario, I use a  Temp table with the same fields as the target table, with a Cartesian (X) relationship to the target.  If the user hits the Save button,  a script creates a new main table record, does all the Set Field [] steps, deletes the Temp record, and  goes to the main layout.  The Do Not Save button does the same thing without creating a new record and saving the data.

 

In fact, the same script would work for both cases if you passed which button was pressed as a script parameter.

Link to comment
Share on other sites

Is there a better way to handle this?

 

Maybe. You're not telling as what exactly "this" is. If you want users to fill out a "scratch"record first and only then make up their mind about posting it "for real" or abandoning it, then you should [1] give them the opportunity to either commit the record or revert it, and [2] make sure they cannot commit the record other than by using the 'Save' button.

 

Although deleting the "canceled" record would work too, reverting has several advantages, for example keeping the serial number IDs consecutive (provided they are set to generate on Commit).

  • Like 1
Link to comment
Share on other sites

I use a  Temp table with the same fields as the target table

 

And thus have to maintain two parallel tables instead of just one, plus a relationship and a script, times the number of tables you want to implement such mechanism - all for no good reason that I can see.

Link to comment
Share on other sites

  • 3 months later...

Maybe. You're not telling as what exactly "this" is. If you want users to fill out a "scratch"record first and only then make up their mind about posting it "for real" or abandoning it, then you should [1] give them the opportunity to either commit the record or revert it, and [2] make sure they cannot commit the record other than by using the 'Save' button.

 

Although deleting the "canceled" record would work too, reverting has several advantages, for example keeping the serial number IDs consecutive (provided they are set to generate on Commit).

 

Hi comment, thanks for your answers.  Can you describe a better way to approach this?  I have read some recommend creating an identical layout but using global fields to store values and to set those values to corresponding fields after a user clicks a scripted Save Button.  If a user clicks Cancel or Don't Save, then I imagine we would run a script to clear those global fields.

Link to comment
Share on other sites

This topic is 2499 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Similar Content

    • By H
      Hi
      Wondering whether this is one of Filemakers limitation and/or there are any ways round it.
      i have a portal which displays my related records to a customer . These records are split down to two sections (Two options) i had created a slider that on slide 1 it displays option 1 and on slide two option two.
      However the slider only seams to show up on the top portal row.
      i would appreciate if anyone could explain me if this is not possible or something was just set out wrong.
    • By kfeete
      I've just started using MirrorSync to sync our production iPads with our FileMaker server, and overall I am thrilled with the functionality. I do have one weird little issue, though, that I'm hoping someone can help me with.
      I have a table called Step Intervals, and none of the records from this table appear on the iPads after sync. It's not for any of the obvious reasons: I do have the Step intervals table checked in the MirrorSync setup, all the fields I want synced are on the sync layout, etc.
      However the table itself contains a self-join. Without getting into a ton of extraneous detail, it's meant to record the ideal interval between two steps of my production process happening (stored in the Steps table). So Steps Interval looks something like this:
      Step Interval ID
      ID_Beginning_Step
      ID_End_Step
      Where the beginning and end fields both contain foreign keys for different instances of the Steps table.
      I did try adding a layout for the second Steps instance to my MirrorSync setup, but got the message "Node FileMaker Server has dependencies from other nodes, but it was never added to the NodeConfiguration with addGroup". So I know I'm doing something wrong, but if the solution is in the documentation I'm missing it.
      Any pointers much appreciated!
    • By teganthomas
      Change of Ownership
       
      I have written a database which manages my dog breeding activities, I am not great with databases - it was never my day job - and I have have hit a snag with which I would be grateful for some help.
       
      I have a three tables; 
      One contains all the dog's (puppy's) details that I need (Dog's Unique ID No., DoB, Sex, `Sire, Dam, etc...). 
      One contains all the Owner's details ( Owner's Unique ID No., Name, Address, Phone Nos, Emails address, etc...
      One Join Table which uses the  Dog's Unique ID No. and the Owner  Unique ID No. as foreign keys and links the two tables together using a DogOwner Unique ID No. 
       
      This works fine when I sell a puppy or dog and I have no problem with assigning more than one dog to an owner (some owners have several of my dogs) but...
      Sometimes a new home doesn't work out and I buy the puppy or dog back and resell it to different owner.
       
      What I can't work out is how I can keep records of all the owners (active or not) whilst transferring a dog from one to the other, I don't want to delete an owner as I need to keep a record who has owned my dogs in the past but I also need to produce a file of information for the new owner using layouts for Insurance Cover Notes, Microchipping, Registrations etc.
       
      i have tried deleting the  DogOwner Unique ID No. from the record (which I thought was the only link between dog and owner) but somehow all layouts still display the original owner.
       
      I just can't get the database to recognise the new owners - the old owner's data is displayed on every layout - including the new Agreement of Sale which I need to send to the new owner.
       
      It is rather like a serial numbered product being returned and resold so there must be a way of doing it.
       
      I have just installed (yesterday) FMP 16 - upgrading from FMP 12, running on a Mac.
       
      Sorry if I haven't explained this very well.
    • By Mel617
      I am new to filemaker and am using Filemaker 14 with starting point.  I am connected remotely to my network.
      I am in the account section of starting point and for some reason when I click the create new record button it is randomly adding data from another record in the database and linking a contact to it. Specifially in the Tabs at the bottom "contacts" "projects"
      Does anyone know how to change this and make the new record completely blank?  
    • By AGilek
      Hi, everyone!
      In my database of weekly music charts (FMPro14) there are 4 linked tables:
       
      [Hits] - list of the hit singles
      [Entries] - list of different entries, remixes, reissues
      [Runs] - list of chart placings for every week
      [Dates] - list of dates of the weekly charts
      ——————————————————————————————
      [Hits] contains:
      <idHits>     index field
      <Title>        text field
       
      [Entries] contains:
      <idEntries>    index field
      <Title>        text field
      <idHits_fk> number field, a foreign key which links [Hits] table with [Entries] table
       
      [Runs] contains fields as below:
      <idRuns>       index field
      <Place>         number field, position on the chart
      <LastWeek> number field, last week position 
      <idDates_fk> number field, a foreign key which links [Dates] table with [Runs] table
      <Title>           text field, title of a single
      <Name>        text field, name of the artists
       
      [Dates] contains:
      <idDates>    index field
      <Date>        date field
      ——————————————————————————————
      Relations are as follows.
       
      [Hits] & [Entries] are linked by the relation:
      Hits.<idHits> = Entries.<idHits_fk>
       
      [Entries] & [Runs] are linked by the relation:
      Entries.<idHits> = Runs.<idEntries_fk>
       
      [Dates] & [Runs] are linked by the relation:
      Dates.<idDates> = Runs.<idDates_fk>
      ——————————————————————————————
       
      Two years ago, on this forum, with a Consultant help, I have defined the self-join as:
      Runs::idEntries_fk = Runs 2::idEntries_fk
      AND
      Runs::idDates_fk ≥ Runs 2::idDates_fk
       
      where Runs 2 is a new occurrence of the Runs table. Then define a calculation field (result is Number) = Count ( Runs 2::idRuns )
      This will return the number of times the entry has appeared in the Runs table before (and including) the current week.
       
      So this allows counting chart weeks for every record in [Entries]. 
      Now, I’d like to also count TOTAL number of weeks, for [Hits], not [Entries], something like:
       
      Runs.<Place>; Runs.<LastWeek>; Entries.<Title>,  TotalWeeksCount for main record in [Hits]
      ——————————————————————————————
       
      Example. Let’s say there is a hit single titled „Purple Rain”. Looking at its chart history we should get something like:
       
      Purple Rain - original entry - 10.10.1984 - 10 (0) 1 week
      Purple Rain - original entry - 17.10.1984 - 8 (10) 2 weeks

      Purple Rain - original entry - 14.12.1984 - 43 (33) 10 weeks
      — out of chart —
      Purple Rain - re-entry - 08.07.2008 - 56 (Null) 11 weeks *** 11 weeks, NOT 1st week of this new entry! ***
      Purple Rain - re-entry - 15.07.2008 - 48 (56) 12 weeks 
       
      How can I get such results? Help needed, thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.