0

How to auto-fill the relationship field choice?

How to auto fill this relationship field when I create new record, instead of click into the field and choose what record. I want it auto fill because the date is just the latest date, so I don't have to click on it 2 times. can someone help me with this please?

28 replies

null
    • Fred
    • 8 mths ago
    • Reported - view

    In the Shipping table, you can add a button with the following code:

    let selectNGAY := first(select 'THU/CHI' where NGAY = today())
    'NGAY THU/CHI' := selectNGAY
    

    This is link the first record in THU/CHI that has today's date to the current record in Shipping.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 8 mths ago
      • Reported - view

       

      I send my db 

      Now my Main DB have the Documents and the data on the same Table, but need split into two tables once for Documents and other for Control for each Document.

      • Fred
      • 8 mths ago
      • Reported - view

      Just to clarify. You want to take a record in Documents and you want to create a new record in the Control table that links to the Documents record?

      We have gone over how to create and link records, can you give a try and write a script that you think would work? You can check out this post of yours where you do something very similar.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 8 mths ago
      • Reported - view

       

      Thanks Fred Resolve.

      I import all Documents from excel, but when need to add some news I use this way.

      let xResponse := dialog(" ADD Document  -> ", "Do you want to ADD Document To Control ?", ["Yes", "NO"]);
      if xResponse = "Yes" then
          let me := this;
          let newR := (create Control);
          newR.(
              'Documents_>' := me;
              let nameDoc := me.'Name Document';
              let coddoc := me.CodDOC;
              newR.('Name Document' := nameDoc);
              newR.(CodDOC := coddoc);
              last(popupRecord(newR))
          )
      end
      

Content aside

  • Status Answered
  • 8 mths agoLast active
  • 28Replies
  • 180Views
  • 3 Following