how can i stop people from adding lines to the invoice when they are allowed to create invoices & inv lines

Posted on 2006-04-07
Last Modified: 2012-05-05
I was able to create a privilage to stop anyone from editing an invoice or an invoice line once a field on the invoice is changed to done. but they can still add invoice lines because they are creating a record and I need to allow them that privialge. how can i stop people from adding records to an invoice once it's marked done.
Question by:RALPHQC
    LVL 28

    Assisted Solution

    disable "new record" from menu (minimum menus in privileges or custom menus), and new records creation though the relationship if you use a portal.
    and make a script to create a new line in the related table which will check the invoice 'done' field before generating the new related record.
    to get the invoice ID written to the line ID, you can use a subscript with an argument to carry the invoice ID or use a variable like:

    if (invoice::done<>"done")
     set variable ($ID=invoice:ID)
     goto layout (lines layout)
     new record
     set field lines:invoiceID = $ID
     goto layout (original)
     custom dialog (invoice is closed!)

    this is not the real syntax, just the principle, you had guessed it!
    LVL 4

    Accepted Solution

    I suppose that you look at your invoice lines through a portal on the invoice layout.

    You can simply change the settings of the relationship with the invoice lines table, to disable "allow creation of new records" and from then on it is not possible to add new rows to the portal that shows the invoice lines.

    Now add a button to your layout that says "create new invoice line". The button triggers a script that checks if the invoice is completed, after which it exits. If not, then it goes ahead and creates a new related record in the invoice_lines table (or file).

    This is actually the strategy lesouef proposes, I just decided to comment to clarify things a little. Hope you don't mind, lesouef!
    LVL 28

    Expert Comment

    please do! I absolutely don't care!

    Author Comment

    I was looking for a script to create a new portal record if ; (like delete portal record script step) so i didn't understand the original ans.
    I was able to workit in the solutions.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
    Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now