0

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 

27 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    Can you post the code you are using?

      • Sam.1
      • 1 yr ago
      • Reported - view

      Fred let newRec := (create Article);
      openRecord(newRec)

      and

      let newRec := (create Invoice);
      openRecord(newRec)

      let newRec := (create Article);
      PopupRecord(newRec)

    • Fred
    • 1 yr ago
    • Reported - view

    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.
    • Sam.1
    • 1 yr ago
    • Reported - view

    Are you able to choose an existing item?

    • Fred
    • 1 yr ago
    • Reported - view

    I am not sure what you mean by that. When I create a new record it opens a new record to add data.

    Are you asking if I can exit the new record and select an existing records?

    • Sam.1
    • 1 yr ago
    • Reported - view

    I can exit and select an existing record too. If you select an existing item and then click the + button at the bottom it will clear the reference field and allow for selection without going back to the line items.

    • Fred
    • 1 yr ago
    • Reported - view

    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.

    • Sam.1
    • 1 yr ago
    • Reported - view

    I’m using the iPad at the moment. I’ll check it out on the windows server and my Mac in about 20 minutes. I’ll let you know.

    thanks Fred!

    • Sam.1
    • 1 yr ago
    • Reported - view

    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.

    • Sam.1
    • 1 yr ago
    • Reported - view

    Same on the Windows version, Mac and IPad.

    • Fred
    • 1 yr ago
    • Reported - view

    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.

    • Sam.1
    • 1 yr ago
    • Reported - view

    That’s what I get too. But, how can we make a button to behave as the + create record? To hold the current page and enter another reference item without going back

    • Sam.1
    • 1 yr ago
    • Reported - view

    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.

    • Fred
    • 1 yr ago
    • Reported - view

    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.

    • Sam.1
    • 1 yr ago
    • Reported - view

    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 

    • Sam.1
    • 1 yr ago
    • Reported - view

    Sometimes I hit the duplicate button on my iPad. So, I’d like to place a button near the field 

    • Sam.1
    • 1 yr ago
    • Reported - view

    In regard to your question: it would be a variation of number 2.

    3) be in invoice and add new article  but not  return 

    • Sam.1
    • 1 yr ago
    • Reported - view

    Until all the items have been added

    • Fred
    • 1 yr ago
    • Reported - view

    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.

      • Sam.1
      • 1 yr ago
      • Reported - view

      Fred I was just now play with the InvoiceItem.

    • Sam.1
    • 1 yr ago
    • Reported - view

    Close! Thanks. 
    I had this same basic code a couple weeks ago but configure out how to make it close without hitting the X.

    I play with this some kore and let you know if I get lucky.

    • Sam.1
    • 1 yr ago
    • Reported - view

    I can use this! Spacing the pages let me see my last entry. The way I had it before it would also bring up the invoice Item lines. Which was a pain.

    Do you know if there is a way to close all the pages at once?

    • Fred
    • 1 yr ago
    • Reported - view

    I do not know how to close all subwindows. Maybe someone smarter than me will have an answer.

    • Sam.1
    • 1 yr ago
    • Reported - view

    The close search I could find was by Birger 2 years ago. Not possible as each is an instance

    • Sam.1
    • 1 yr ago
    • Reported - view

    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

Content aside

  • 1 yr agoLast active
  • 27Replies
  • 231Views
  • 2 Following