0 votes

Hi.

In project consult page, I customised the tab where linked oppos are displayed.

For each oppo linked, I had to display relation values between a custom entity and oppo.

It look like this:

relation between proj and oppo

The custom:
MacroConsult:

DetailGrid.Proj.Oppo {[
    <%GetDetailGrid(columndefs="GridColumns", entity="$DETAIL$", columns="%%Macro('DetailGridColumns')", sum="%%Macro('DetailGridSum')", group="NAME")%>
<%Macro("DetailMenu")%>
]}
DetailGridColumns.Proj.Oppo {[NAMEINDICATOR,F_TOTAL]}

NAMEINDICATOR is a field given by the customized SYS_QUERY

Then to display the icon to get the edit relation menu:
GridColumn:

group {[
<tr class="group">
<td colspan="$COLUMNCOUNT$">
<span class="dropdown no-pip i-menu small" data-dropdown="detail-menu" data-args="<#G=$KEY$>"></span>
<i class="i-<#ACTION>" data-msg="group;<#ACTION>;<#HASH>"></i>
<#F;context=TEXT>
</td>
</tr>
]}

And, once again in MacroConsult:

DetailMenu.Proj.Oppo {[<%GetPopupMenu(id="detail-menu", class="has-icons small", ulargs='data-channel="detailmenu"', count="4",
text1="Edit #DETAIL", image1="i-edit",
message1="consult;{dropdownKey};#DETAIL",
text2="Duplicate", image2="i-Dupl",
message2="duplicateOppoFromProj;{dropdownKey}",
text3="Edit relation", image3="i-edit",
message3="editRelation;#ENTITY;#KEY;#DETAIL;{dropdownKey}",
text4="Delete relation", image4="i-delete",
message4="deleteRelation;#ENTITY;#KEY;#DETAIL;{dropdownKey}"
)%>]}

I have the menu:
relation menu

And when I click on "Edit relation", I have this error message:

error message

And here is what I have in the url:
http://127.0.0.1:5112/crm/edit?page=edit/Relation&action=refreshOpener&entity=Proj&key=3316&detail=Oppo&detailkey=%3C#G=K_OPPORTUNITY%3E

asked in Efficy/ Client side by (111 points)
edited by

1 Answer

0 votes

The grid tag <#G> returns the extended relation key. When multiple relations are allowed between two entities (presence of K_RELATION field), the returned value is "DetailKey_KRelation". Otherwise, it just returns the detail key.

When you use this tag to a group header, there is no key information available.

It's not clear to me what relation you are trying to open...

answered by (7.4k points)
Hello Kristof, thank you for your answer.

About the relations in this project: one project can be linked to multiple opportunities, and an opportunity can be linked to multiple records from a custom entity (called "financement").

I try to list all opportunities linked to a project, and under each opportunity, all the "financement" linked
If you group on K_OPPORTUNITY, you can use it as DetailKey argument
Yes, I saw it, but when I group on K_OPPORTUNITY, I lose the display of the opportunity name
1,248 questions
1,518 answers
1,858 comments
328 users