0

How do I copy some certain fields when creating an invoice?

Hello everyone,
I am looking to find a way how to copy some certain fields when creating an invoice.

The problem is this:

I made a formula that creates an invoice with a click of a button, but the problem is that I can't copy some fields from the report, to the invoice. 

Below is the screenshot attached, with the problem that I have.

All the best,
AM

3 replies

null
    • Fred
    • 3 yrs ago
    • Reported - view

    Hi Art -

     

    They say pictures are worth a thousand words. Unfortunately in database work that does not hold true. Can you post your button code so we can see what is going on.

     

    Or here is some basics on creating new records and copying data if you want to play around first.

     

    let curRec := this; <--gathers data from the current record you are on

    let newRec := (create 2ndTable); <--starts to create a new record in another table

    newRec.Field1 := curRec.Field1 <--tells Ninox to set Field1 in the new record to the value of Field1 in the current record

     

    Let us know how it goes.

    • AAAA
    • Art_Morina
    • 3 yrs ago
    • Reported - view

    Hi, it works pretty well, but the issue is that the expression returns multiple values, how do I get it to return only one value that I need? Here is the code below

     

    let myID := this;
    let Kontakt := Auftraggeber;
    let Objekt := Objekt;
    let 'Eigentümer' := 'Eigentümer';
    let cre := (create Rechnung);
    let Rapporte := this;
    Rapporte.Auftraggeber.Firmenname := Rechnung.Kontakt;
    popupRecord(cre)
     

     

    All the best to you,
    AM

    • John_Halls
    • 3 yrs ago
    • Reported - view

    Hi Art

     

    In your code your let statements are creating variables, not updating fields. Using Fred's example, your code becomes

     

    let myID := this;

    let cre := (create Rechnung);
    cre,Kontakt := myID.Auftraggeber;
    cre.Objekt := myID.Objekt;

    cre.Eigentümer := myID.'Eigentümer';
    popupRecord(cre)

     

    With the rest of your code

     

    let Rapporte := this; <- There's no need for this
    Rapporte.Auftraggeber.Firmenname := Rechnung.Kontakt; <- This is where you are getting multiple records. Can you say what you are trying to do here.

     

    Regards John

Content aside

  • 3 yrs agoLast active
  • 3Replies
  • 348Views