0

Automatically link record from one table to open record in another table using a button

In Audits Plan I have the field 'Audit Code' and need to open on 'Non Conformity' field the same 'Audit Code'  on the 'Non Conformity' table the 'Audio Code' is a N1.

7 replies

null
    • Fred
    • 9 mths ago
    • Reported - view

    The reference field 'Audit_Code_>' in Non Conformity is a reference field to which table?

    How do you know which record in Non Conformity you want to open since multiple records can be linked to the same Audit Code?

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

       

      The ,'Audit_Code_>' is Link to Audit Plan table N1

      The 'Audit_Code_>' and 'Audit Code' a I like if I on The AU005 go to The same register in The other table.

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

       

      Hi Fred, I have found one of your solutions, there is no improved version.

      let a := 'Audit Code';
      (select 'Non Conformity')[Subset != null].(Subset := null);
      '<_Non Conformity'.(Subset := a);
      openTable("Non Conformity", "by Audit Code")
    • Fred
    • 9 mths ago
    • Reported - view

    So there is a Non Conformity table in Audits Plan?

    Is there only ever going to be 1 Non Conformity record related the Audits Plan record?

    If so then you can do something as simple as this in a button:

    openRecord(first('Non Conformity'))
    

    If not then you need to figure out a way to specify which record you want.

    • Mel_Charles
    • 8 mths ago
    • Reported - view

    If i have understood this correct then

    this is similar to something I use....

    so in my image i have a quote ref field and prev ref field

    with buttons next to each

    code in prev ref button is

    let xCopy := 'Prev Ref';
    let i := first(select JobDockets where 'Job Bag' = xCopy);
    popupRecord(i)

    code on quote ref button

    let xCopy := 'Quote Ref';
    let i := first(select Quotes where QteNum = xCopy);
    popupRecord(i)

    so in my jobs record

    if the quote ref field is greater than null it will go and open the quote table record that matches the number

    is that what you want?

    like so

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

       

      Hi Mel Yes this is exactly what I needed. Excelent. 

      Thanks Mel.

      • Mel_Charles
      • 8 mths ago
      • Reported - view

       You  are welcome sir ! 🙂

Content aside

  • Status Answered
  • 8 mths agoLast active
  • 7Replies
  • 63Views
  • 3 Following