newbie question: creating a new record in a related file

Ask a Question related to FileMaker, Design and Development.

  1. #1

    Default Re: newbie question: creating a new record in a related file



    somaBoyMX wrote:
    >
    > Hello all,
    >
    > I've got one file named contacts.fp5, which contains people info and another
    > named invoices.fp5, containg, well... invoices.
    >
    > The invoices file has a field "invoice_custid" (unique), which I
    > successfully related to field "contact_id" (unique) in my contacts file.
    > When I enter the invoice_custid, it automatically fetches the related data
    > (name, address, etc) from the contacts file
    >
    > I want to be able to add a button to my contacts file which instantly
    > creates a new record in the invoices file related to the current contact
    > record.
    >
    > I guess I need some kind of button script to do this, but I'm new to FMP,
    > coming from MySQL (which has a completely different interface).
    >
    > All help is much appreciated.
    >
    > .soma

    You can do it with a Portal in the Contacts file. First, the
    relationship from the Contacts file as Master to the related Invoice
    file has to be defined to allow creation of related records. See File>>
    Define relationships in the Contacnts file to do this. Then put a portal
    from the Invoices file into a layout of the Contacts file. Put suitable
    fields from the Invoices file into the portal, such as date, amount, etc.

    Now when you go to the portal, click in the first empty row, and enter
    data. That will create a new related Invoice record, related to the
    contact. Done. No need for a script.

    Bill
    B Collins Guest

  2. Similar Questions and Discussions

    1. Creating directories... : Newbie Question
      Hey all I have this is a script: <?php $city = $_GET; $state = $_GET; if($file_name !="") {
    2. Creating Function Newbie question
      Hi I have written a small bit of code for my web site that basically is anti hack code. $checking = ($HTTP_GET_VARS); if (ereg ("+",...
    3. Newbie question: how can decide if there is any records in record set
      hi, I am new to asp. I need to check if the query returns any records, how to do it?. I run the sql in Query Analyzer it returns nothing. but...
    4. Runtime CD query (not the simle read-only file question, but related)
      I'm a newbie, publishing my first DB on CD for a client. The DB is large (several hundred Meg), so the client feels the main DB should stay (as...
    5. Go to related record creates new record?
      In a portal I have a button that with Go to related record attached (it also sets some globals in the related file, and goes to a layout in there...
  3. #2

    Default Re: newbie question: creating a new record in a related file

    > You can do it with a Portal in the Contacts file. First, the
    > relationship from the Contacts file as Master to the related Invoice
    > file has to be defined to allow creation of related records. See File>>
    > Define relationships in the Contacnts file to do this. Then put a portal
    > from the Invoices file into a layout of the Contacts file. Put suitable
    > fields from the Invoices file into the portal, such as date, amount, etc.
    >
    > Now when you go to the portal, click in the first empty row, and enter
    > data. That will create a new related Invoice record, related to the
    > contact. Done. No need for a script.
    >
    > Bill
    Thanks for the help Bill, very useful. But I think I wasn't specific enough.
    I need users to be able to:
    * click somewhere in the contacts file (perhaps a button that says: <<make
    new invoice for customer>>)
    * the invoice file should automatically open, showing a new record tied to
    the contacts record
    * the user then can fill out this invoice and print it immediately in the
    layout specified in the invoice file

    I know your way will work, but then the user would need to open the invoice
    file, search for the record and print it.

    Any hints?



    somaBoyMX Guest

  4. #3

    Default Re: newbie question: creating a new record in a related file

    On 7/30/03 5:31 AM, in article
    3f27bb47$0$273$ba620e4c@reader0.news.skynet.be, "somaBoyMX"
    <nosuch@fakemail.net> wrote:
    >
    >> You can do it with a Portal in the Contacts file. First, the
    >> relationship from the Contacts file as Master to the related Invoice
    >> file has to be defined to allow creation of related records. See File>>
    >> Define relationships in the Contacnts file to do this. Then put a portal
    >> from the Invoices file into a layout of the Contacts file. Put suitable
    >> fields from the Invoices file into the portal, such as date, amount, etc.
    >>
    >> Now when you go to the portal, click in the first empty row, and enter
    >> data. That will create a new related Invoice record, related to the
    >> contact. Done. No need for a script.
    >>
    >> Bill
    >
    > Thanks for the help Bill, very useful. But I think I wasn't specific enough.
    > I need users to be able to:
    > * click somewhere in the contacts file (perhaps a button that says: <<make
    > new invoice for customer>>)
    > * the invoice file should automatically open, showing a new record tied to
    > the contacts record
    > * the user then can fill out this invoice and print it immediately in the
    > layout specified in the invoice file
    >
    > I know your way will work, but then the user would need to open the invoice
    > file, search for the record and print it.
    >
    > Any hints?
    >
    >
    >
    Use a hidden layout with the invoice portal on it. Make sure that the
    invoice::customer_id is in the portal.

    Now create a "create invoice" button on the customer screen.

    The script should look something like this...

    Go to layout "myHiddenLayout"
    Go to field (invoice::customer_id)
    Go to portal row (last row)
    Set field (invoice::customer_id = customer_id)
    Go to related record (invoice)

    There are some hastles doing it this way though. Like making sure that the
    correct layout is there for the user. You may need to add an extra step
    like...
    Perform script (external invoice::myLayoutSwitch)


    Matt Revenaugh




    Matt Revenaugh Guest

  5. #4

    Default Re: newbie question: creating a new record in a related file

    On 7/30/03 8:26 AM, in article [email]ypq2he54nihy.fsf@sdf.lonestar.org[/email], "Lou
    Lesko" <lou@NOSPAMlouislesko.com> wrote:
    >
    > No offense to Matt but there is a much better way to handle your needs.
    >

    No offense taken, I just was not sure of the abilities of SomaBoy. A global
    field works well too, if you have your ducks lined up. A newbie may be
    confused easily.

    The problem with your solution is that in the step

    SetField[invoice_custid, relationship_to_customer_db::global_cust_id]

    there is no relationship_to_customer_db yet!

    So, do you need to create a secondary customer relationship to get to the
    globals? Or will FileMaker retrieve global_cust_id without a valid
    relationship to CUSTOMER?


    Matt Revenaugh

    Matt Revenaugh Guest

  6. #5

    Default Re: newbie question: creating a new record in a related file

    > Good point! I thought he had a relation set up already so that he could
    > display the customer info on the invoice?
    I have. Anyway, thanks for both you guys efforts, with your advise I'm sure
    I can handle it from here.
    As to my "abilities": this is my first fmPro db, and although I know my fair
    share of SQL and relational database theory, it doesn't seem to do much good
    on this one. Why did they have to go and call tables "files" and rows
    "records"? Why do you have to build "scripts" instead of regular queries and
    table joins? Is it supposed to be "user friendly"? Well to me it sure isn't.

    I don't think I'll be dabbling with this freak of an rdbms again...

    thanks, again,


    ..soma


    somaBoyMX Guest

  7. #6

    Default Re: newbie question: creating a new record in a related file

    "somaBoyMX" <nosuch@fakemail.net> wrote in message
    news:3f280c71$0$284$ba620e4c@reader0.news.skynet.b e...
    > > Good point! I thought he had a relation set up already so that he could
    > > display the customer info on the invoice?
    >
    > I have. Anyway, thanks for both you guys efforts, with your advise I'm
    sure
    > I can handle it from here.
    > As to my "abilities": this is my first fmPro db, and although I know my
    fair
    > share of SQL and relational database theory, it doesn't seem to do much
    good
    > on this one. Why did they have to go and call tables "files" and rows
    > "records"? Why do you have to build "scripts" instead of regular queries
    and
    > table joins? Is it supposed to be "user friendly"? Well to me it sure
    isn't.
    >
    Not unsual. It is "user friendly" for people who know little or nothing
    about database design...and for people who are willing (or able) to "forget"
    how [insert your favorite rdbms name here] works when they are using
    FileMaker.
    > I don't think I'll be dabbling with this freak of an rdbms again...
    Your loss. It's always good to have as many tools in your belt as possible.
    >
    > thanks, again,
    >
    >
    > .soma
    >
    >

    Glenn Schwandt Guest

  8. #7

    Default Re: newbie question: creating a new record in a related file

    "somaBoyMX" <nosuch@fakemail.net> writes:
    >
    > I don't think I'll be dabbling with this freak of an rdbms again...
    >
    > thanks, again,

    Oh whatever!

    loulou
    Lou Lesko Guest

  9. #8

    Default Re: newbie question: creating a new record in a related file

    Maybe the solution will more easy if you make a script that copy the ID
    CLIENT (client database) , then perform an external script in the INVOICE
    database that makes a new record and then paste the ID CLIENT in the ID
    CLIENT field (invoice database).

    Also the solution made by Bill is also a solution but the only thing you
    have to do is to put a little button (right side p.e.) in the portal with
    the script "go to related record".

    regards and sorry for my english.

    Juan

    "somaBoyMX" <nosuch@fakemail.net> escribió en el mensaje
    news:3f27bb47$0$273$ba620e4c@reader0.news.skynet.b e...
    >
    > > You can do it with a Portal in the Contacts file. First, the
    > > relationship from the Contacts file as Master to the related Invoice
    > > file has to be defined to allow creation of related records. See File>>
    > > Define relationships in the Contacnts file to do this. Then put a portal
    > > from the Invoices file into a layout of the Contacts file. Put suitable
    > > fields from the Invoices file into the portal, such as date, amount,
    etc.
    > >
    > > Now when you go to the portal, click in the first empty row, and enter
    > > data. That will create a new related Invoice record, related to the
    > > contact. Done. No need for a script.
    > >
    > > Bill
    >
    > Thanks for the help Bill, very useful. But I think I wasn't specific
    enough.
    > I need users to be able to:
    > * click somewhere in the contacts file (perhaps a button that says: <<make
    > new invoice for customer>>)
    > * the invoice file should automatically open, showing a new record tied to
    > the contacts record
    > * the user then can fill out this invoice and print it immediately in the
    > layout specified in the invoice file
    >
    > I know your way will work, but then the user would need to open the
    invoice
    > file, search for the record and print it.
    >
    > Any hints?
    >
    >
    >

    JC Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139