Jump to content

LREL BREL calling list form instead of update lrel form


Recommended Posts

Hi experts, I need some help to conclude a custom... Can someone help me to understand what is wrong and how I can fix this? I appreciate any help.

I have a custom object (z_objeto_automatizacao) and I need to relate it to pcat object. Almost everything is working properly execpt when I click on Search Button it opens the list form of custom object,

image.png.c0c9cbb2fbd105c877dac9b3b8cdeed8.png

instead of update_lrel form. It should open my update_lrel form (update_z_lrel_pcat_objautom.htmpl), like this example of update_lrel_pcat

image.png.d127d5999b234e88b2b91387c5e3fa7a.png

To get to this point I create a LREL table (z_lrel_pcat_objautom) with a SREL to PCAT and other SREL to z_objeto_automatizacao.

This is how my maj file looks like to create BREL:

OBJECT z_objeto_automatizacao {
    ATTRIBUTES z_objeto_automatizacao {
        z_brel_pcat_objautom BREL z_lrel_pcat_objautom z_srl_objautom DYNAMIC { LREL z_srl_pcat; };
    } ;
} ;

OBJECT pcat {
  ATTRIBUTES pcat{
    z_brel_pcat_objautom BREL z_lrel_pcat_objautom z_srl_pcat DYNAMIC { LREL z_srl_objautom; };
  } ;
} ;

This is the tab in detail_pcat.htmpl

<PDM_MACRO name=tab title="Objeto de Automatização" src="OP=SEARCH+FACTORY=z_objeto_automatizacao+QBE.EQ.z_brel_pcat_objautom.z_srl_pcat.id=$dob.id+KEEP.PERSID=$args.persistent_id+KEEP.forObjautom=1">
 

This is the button 'Relacionar Objeto de Automatização' in my custom list_form:

image.thumb.png.5dc8ccc8f81ce90832dafffc97437691.png

<PDM_IF "$args.KEEP.forLREL" == "1">
    document.writeln('<INPUT TYPE=hidden NAME=HTMPL VALUE=update_z_lrel_pcat_objautom.htmpl>');
</PDM_IF>

<PDM_IF "$args.KEEP.forObjautom" == "1">
    var cfgCanEdit = false;
    var cfgCanCopy = false;
    var enableExtraBtn = false;

    <PDM_IF "$args.KEEP.forObjautom" == "1">
        var enableExtraBtn = true;
    </PDM_IF>    
    
    cfgExtraButton = new Array("Relacionar Objeto de Automatização", "zCreateNew()", enableExtraBtn);
    function zCreateNew() {
        update_with_lrel_style('pcat', '$args.KEEP.PERSID', 'z_objeto_automatizacao', 'z_brel_pcat_objautom',  'Objeto de Automatização', 'Objetos de Automatização relacionados', '', 'KEEP.forLREL=1+KEEP.lrelOBJAUTO=YES');    

    }
</PDM_IF>

NOTE: If I invert 'pcat' with 'z_objeto_automatizacao' like bellow, it works properly and call update_lrel_pcat.htmpl form, but I need the opposite.

//     update_with_lrel_style('z_objeto_automatizacao', '$args.KEEP.PERSID', 'pcat', 'z_brel_pcat_objautom',  'Objeto de Automatização', 'Objetos de Automatização relacionados', '', 'KEEP.forLREL=1+KEEP.lrelOBJAUTO=YES');   

image.png.1cfeac473aac6100c5a08289ebdfb7f9.png
 

Thanks in advance.

image.png

Edited by isaque.almeida
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...