0 votes

Hi,

I have a custom entity (BILL) with custom details.

enter image description here

The badge only appears when I'm on the detail.

I would like the "2" to be displayed all the time as is the case in standard on the actions.

enter image description here

can you tell me what I miss?

Here is the code:

In MacroInvoiceCustom

BillQueriesCustom{[
<%RunQuery(id='DetailBadgeWaitingForMe', master='95', detail='5', param1='%%GetUserName()%', store='50000') %>
<%RunQuery(id='DetailBadgeMyInvoiceReadyToSent', master='95', detail='9', param1='%%GetUserName()%', store='50001') %>
]}

In MacroBadgesCustom

DetailBadgeKeys {[
<%OnArgument('BADGEKEYS',
then=|<%Delay(0)%>GetDataGrid(query='DetailBadge$DETAIL$', count='-1', templatetext=`<#repeat><#F=<%Macro(BadgeKeyField,entity=$DETAIL$)%>><#S=;SEPARATOR=,></#repeat>`, nolinefeed=T)%>|,
else=|%%GetArgument("BadgeKeys",context=JS)|)
%>
]}

DetailBadge.Bill.WaitingForMe,
DetailBadge.Bill.MyInvoiceReadyToSent {[
data-badge-detail='$DETAIL$' data-badge-keys="<%Evaluate(|<%Macro('DetailBadgeKeys', detail='$DETAIL$')%>|,context=ATTR)%>"
]}

DetailBadgeDisplay.Bill.WaitingForMe,
DetailBadgeDisplay.Bill.MyInvoiceReadyToSent
{[
<%Evaluate(|<%GetRecordCount(query="DetailBadge$DETAIL$")%>|)%>
]}

BadgeKeyField.WaitingForMe,
BadgeKeyField.MyInvoiceReadyToSent {[K_DOCUMENT]}

DetailBadgeBillKeys {[<%Evaluate(|<%Macro('DetailBadgeKeys', detail='$DETAIL$')%>|, context=ATTR)%>]}

Thanks for your help

asked in Efficy/ Client side by (103 points)

1 Answer

0 votes

It looks like you are at least missing the DetailBadgesQueries macro. Maybe more...

DetailBadgesQueries.Bill {[<%Macros('DetailBadgeQueryWaitingForMe;DetailBadgeQueryMyInvoiceReadyToSent')%>]}

In order to test your question on standard entities, I tried to enable the details badge for Documents on company consult. These were the macros that I added to MacroBadgeCustom.txt

The badge remains in all cases visible on the documents detail tab.

DetailBadgeDisplay.Comp.Docu

DetailBadgesQueries.Comp {[<%Macros('DetailBadgeQueryActi;DetailBadgeQueryOppo;DetailBadgeQueryDocu')%>]}

DetailBadgeQueryDocu.Comp {[<%RunQuery(id='DetailBadgeDocu', param1='%%GetUserKey()', param2='%%GetKey()', store='101', querytext="[Select]
DOCUMENTS.K_DOCUMENT
DOCU_USER.K_USER hidden
DOCU_USER.ISACTIVE hidden
DOCU_COMP.K_COMPANY hidden

[From]
DOCUMENTS
DOCUMENTS DOCU_COMP
DOCUMENTS DOCU_USER

[Where]
DOCU_USER.K_USER = userkey
DOCU_USER.ISACTIVE = 1 [fixed]
DOCU_COMP.K_COMPANY = key
<#SkipAppendSecurityClause>
")%>]}

DetailBadgeWidget.Comp.Docu {[
<%Macro('BadgeGrid',
$KEYS$=|%%Evaluate('<%Macro("DetailBadgeKeys",detail="$detail$")%>', context=TAG)|,
entity='$detail$',
$columns$='%%Macro("BadgeWidgetColumns",entity="$detail$")',
$columndefs$='BadgeColumns.txt',
$detailwidget$='T'
)%>
]}

DetailBadge.Comp.Docu {[
data-badge-detail='$DETAIL$' data-badge-keys="<%Evaluate(|<%Macro('DetailBadgeKeys', detail='$DETAIL$')%>|,context=ATTR)%>"
]}

DetailBadgeDisplay.Comp.Docu
{[<%Evaluate(|<%GetRecordCount(query="DetailBadge$DETAIL$")%>|)%>]}
answered by (6.8k points)
1,165 questions
1,423 answers
1,713 comments
325 users