
Invoice item button
Hi All,
I am trying to use a button formula to mimic the + add new record. When using the Ninox template invoice, creating a new record opens to a page to enter the article/item. When the + at the bottom is chosen the article/item selected clears and a new item can be entered.
My current button will create a new invoice but will not mimic the Ninox + create new record button at the bottom of the page.
A button to create a new article/item opens the option to make a new item but not clear the current item and then choose an existing one.
thanks in advance
-
I guess I'm not understanding your issue.
I'm in the invoice template and in the Article table. I've create a button and put:
let newRec := (create Article); openRecord(newRec)
It creates a new record with all fields empty.
I'm confused about:
Sam said:
A button to create a new article/item opens the option to make a new item but not clear the current item and then choose an existing one.
-
What platform are you on? On the macos app the + button is in the upper right corner.
When I click on it a new record appears with empty fields. That happens if I use the + button or my formula button with the create code.
The default Invoice template has no fields that allow for selection. There are only three fields Article No, Article and Price and they are all basic data entry fields.
-
The Mac computer behaves like the iPad in regard to the native + create record button. The button made with your code behaves exactly as mine did. The formula buttons do not mimic the native + create button. The formula button allows for a new invoice record if it is placed in the invoice table. It allows for a new article to be made when placed where one chooses the referred item.
The native + button behaves the same as on the Mac and iPad. -
It sounds like we are talking about different things.
I have a button in the Articles table. You are talking about a button in the Invoice table.
If you are in a Invoice record and under Invoice Item you click on Create Record it will create a new record in the Invoice Item table and show you the record so you can add data. When you close the record it returns you to the Invoice record you where in.
Your button that creates a new record in Article then open that record will take you out of the Invoice table and take you to the Article table.
-
Without closing the record. The native button allows me to stay in the article table. The code we/I an using either closes the record to the invoice table, allows for making a new article or creates a new invoice depending on where the button is located.
Im trying to stay in the article table and enter a subsequent item as the native button in the article table allows.
-
To be clear, you are not in the Articles table. You are in the Invoice table and adding records to the Invoice Item table. You are not adding new articles that is another table and another process.
So you what do you want to do?
1) be in invoice and add new invoice items
2) be in invoice and add new article and return to invoice.
-
Thanks for clarifying!
I meant the invoice item to article reference.
That reference table is populated when an article is chosen. When the native button is used the fields are empty in the article reference and a new one can be chosen.
I can attach some screenshots if that’s not a good enough description.I do not want to return
thanks again
-
Try this in a button on the Invoice Item table:
let t := this; let newInvoiceItem := (create 'Invoice Item'); newInvoiceItem.(Invoice := t.Invoice); popupRecord(newInvoiceItem)
It will open another sub window so it is not quite the same as the Create Record button at the Invoice table, but it is closer to what you want.
-
openRecord(recordId) - opens the record and jumps to therelated table
openRecord(record(Invoices, 1))popupRecord(recordId) - opens the record in a popup form without switching to another table
popupRecord(record(Invoices, 1))openTable(tableName, viewName - opens a table view
openTable("Invoices", "All Invoices")closeRecord() - closes the top-most record form
closeAllRecords() - closes all record forms