0

Maybe the last question of the year, cough,cough.

Ok, so l,m now looking for a button script to add a record to linked customer. So let newRec :=(create Payment); newRec.(Payment.this id.......have no clue    OpenRecord(newRec).            
If l hit the add record icon in the top bar it does what l want but the icon is too small and l want it to be in a button so it“s obvious. Thank you. 

3 replies

null
    • Central Park Furnishings
    • Michael_McKenna
    • 3 yrs ago
    • Reported - view

    Forget about the plus record bit, It does not work . It“s the create new pop up record with the id linked, then l will add another piece to the script to self populate some fields , on creation. 

    • Central Park Furnishings
    • Michael_McKenna
    • 3 yrs ago
    • Reported - view

    Further to my question for clarification...  At the moment my script is . let newRec:=(create Payments); openRecord(newRec);Current_Bal:= “Balance Owing” ; Balance :=Balance Owing“      The script after (newrec) is on a trigger on creation script I have on another table and works well so I thought I could incorporate into this new button script but it doesn”t work. I think it needs a popuprecord something and a this Id something. Just don“t know how to realize it. Hope this helps you with my question. Thank you Steven in advance :) I know you can do it.  

    • Ninox partner
    • RoSoft_Steven.1
    • 3 yrs ago
    • Reported - view

    Michael,

    Suppose your form(table) where you want the button is Customers and you have a subtable(child) called Payments...

    You can make a button to create a subrecord like this:

    let currRec := Id; (here you pick the Customers ID, where you push the button)
    let CB := Balance_Owing; (optional code line where you pick an existing field from your current customer)
    let i := (create Payments); (here you create a new line in the Payments table but is not yet linked to the right customer)
    i.(Current_Bal := CB);  (optional code line where you put that existing field in a field of your subtable)
    i.(Customers := currRec); (here you make the link from the just created new line to the customer where you pushed the button)
    popupRecord(i) (this opens the new created record in your subtable)

    Hope this helps a little.

    Steven

Content aside

  • 3 yrs agoLast active
  • 3Replies
  • 308Views