AnsweredAssumed Answered

Create a LREL for CHG to CHG

Question asked by ConanLam on Oct 28, 2016
Latest reply on Oct 28, 2016 by Jon_Israel

Hi all,

 

I am trying create a many to many relationship between change order and change order itself.

The Doc from cdtj helps, but I am stuck at modifying the htmpl files.

 

Here are what I did so far:

 

  1. Create a lrel table z_lrel_chg_chg
    • field 1: parent
      • type: SREL
      • table: chg
    • field 2: child
      • type: SREL
      • table: chg
  2. Add two fields to table chg
    • field 1: z_parent
      • type: BREL
      • table: z_lrel_chg_chg
      • BREL Query Information: parent { LREL child; }
    • field 2: z_child
      • type: BREL
      • table: z_lrel_chg_chg
      • BREL Query Information: child { LREL parent; }
  3. Update HTMPL
    1. list_chg.htmpl
      • Added 
        var enableExtraBtn = true;  
        cfgExtraButton = new Array("Update LREL", "zCreateNew()", enableExtraBtn); 
        function zCreateNew() { 
          update_with_lrel_style('chg', ahdframe.argPersistentID, 'chg', 'z_child',  'Change', 'Added Change', '', 'KEEP.ForChild=1+KEEP.exclude_chg_ref_num=1'); 

         

    2. detail_chg.htmpl
      • Added
        <PDM_MACRO name=tab title="CHANGE" height=600 id=chg src="OP=SEARCH+FACTORY=chg+QBE.EQ.z_child.parent.id=$args.id+KEEP.ForChild=1">

 

But in the detail_chg tab, I would have a normal list of change order instead of list of child change and the 'Update LREL' is missing.

 

Best regards,

Conan

Outcomes