Can you explain what you mean by "each a separate ID"?
You can add a status field to your table defined with a check box group so that you can select any combination of Quote, Order and Invoice, to avoid creating separate records in separate layouts for each, but I don't follow what that has to do with "each a separate ID".
WhenI sell toacompany I createaninvoice for individuals proof of payment .
invoices, it is importantthat thenumbersalwaysfolloweach other
so that is why I thoughteach order quote invoice needs an id generated when one is checked
I can see the need for an ID for when the invoice box is clicked but why do you need separate ID's for quote and order?
I worked out a safe for shared database "on demand" serial numbers a while back:
Define an auto-entered serial number field in this table if you have not already done so. This field will NOT be your invoice ID, but will serve as a needed primary key for your table. I'll call your table "Orders" in this example and call the primary key "__pk_OrderID".
Add a new table, InvoiceSerialNumbers with two fields: _fk_OrderID , __pk_InvoiceSerialNumber. Define __pk_InvoiceSerialNumber as an auto-entered serial number.
Create this relationship between the two tables and enable "allow creation of records via this relationship" fo rthe InvoiceSerialNumbers table:
Orders::__pk_OrderID = InvoiceSerialNumbers::_fk_OrderID
Write this script to generate a new serial number for the current record in Orders each time it is performed if the record does not already have an Invoice serial number:
If [Not IsEmpty ( Orders::InvoiceStatusCheckBox )]
Set Field [InvoiceSerialNumbers::_fk_ORderID ; Orders::__pk_OrderID ]
You can use an OnObjectModify script trigger on your InvoiceStatusCheckbox field to perform this script. This assumes you use separate single value checkbox fields for order, quote and invoice. If you choose to use a single field with three checkbox values, use this expression inside the If step's brackets: ValueCount ( FilterValues ( Orders::Status ; "Invoice" ) )
You can display this number on your Orders layout by adding the InvoiceSerialNumbers::_pk_InvoiceSerialNumber field directly to the layout.
You can add additional tables and relationships to generate separate "on demand" serial numbers for Orders and Quotes if you want.
thank you that works so good now i am wondering if i can adjust the script so when invoice is selected it also pront the invoice layouts ?
thank for that great solution phill whitout you i would gived up a long time ago ...
including steps to preview and/or print your invoice could easily be added inside the same If - End IF block.
thx again phill think i can figure that out :p thx for the help