1 Reply Latest reply on Apr 17, 2012 9:22 AM by philmodjunk

    Relationships

    JosahMower

      Title

      Relationships

      Post

      I am driving myself mad trying to understand this simple little detail. I have a table / layout "Req" that has:

      __pkReqIndex
      RequestNo
      PO
      User
      Department
      ect.

       

      What I am doing is create another table and layout NoteReq. Fields are:

      __pkNoteReqIndex
      _fkReqIndex
      _fkReqestNo
      _fkPO
      subject
      body
      ect.

      I have a button that has a script that copies __pkReqIndex, RequestNo and PO from Req and paste them into NoteReq. Then in Req I have a portal to see all notes attach to Req. and click to read the note.

      But do I need to copy all that data over to the notes field or can it be linked. I am pretty sure it can be linked but not understanding how. How do I actually link them together and beable to see what PO Request No and such on the Note Layout pertaining to the note?

       

      (Button Script)

      Set var [$$RQ; value:tblReq::__pkReqIndex]
      Set var [$$RN; value:tblReq::RequestNo]
      Set var [$$PO; value:tblReq::PO]
      New Window
      Go to Layout ["NoteReq" (tblReq)]
      New Record/Request
      Set Field [NoteReq::_fkReqIndex; $$RQ]
      Set Field [NoteReq::_fkRequestNo; $$RN]
      Set Field [NoteReq::_fkPO; ::$$PO]



        • 1. Re: Relationships
          philmodjunk

          You only need:

          et var [$$RQ; value:tblReq::__pkReqIndex]
          New Window
          Go to Layout ["NoteReq" (tblReq)]
          New Record/Request
          Set Field [NoteReq::_fkReqIndex; $$RQ]

          The relationship:

          tblReq::__pkReqIndex = NoteReq::_fkReqIndex

          is all that you need.

          On a layout based on NoteReq, you can just add the RequestNo and PO fields from tbleReq to your layout and they will display that data from the related record in tblReq.