0 votes

Hi all!

EDIT : I tried but it don't works
When you click a button that call that /commit WebRequest, the application is not able to find some PROD_OPPO relations. It works if I remove the filter params in the GetRelationGrid(Prod).

The problem is that the last call of GetRelationGrid(Prod) filters the Dataset of EditHandle and on commit Efficy can not see the filtered relations.
I tried to unfilter the dataset after (RunScript) but it don't works

MacroEditCustom.txt :

TabContentProds.Oppo {[
    <div class="content tabs-content-item" id="tab-prod">
        <div class="row">
            <div class="small-12 medium-1 columns">
                <button type="button" class="icon i-add <%IfReadOnly(detail='Prod', then='disabled')%>" title="<%GetLabel('Add Link to Product')%>" data-msg="addProduct"></button>
                <%AddRelationButton(entity='Prod')%>
            </div>
            <div class="small-12 medium-11 columns">
                <h3 class="section-title"><%GetLabel("Linked BATCHES")%></h3>
            </div>
        </div>
        <%Macro('CommonProdRelationFields')%>
        <%OnMultiCurrency(0=, else=|<div id="currcyError"><span class="error"><%GetLabel("Warning: The currency must be set before adding products")%></span></div>|)%>
        <%Delay(1)%>GetRelationGrid(entity="Btch", template="pages/grid/BtchProdEditGrid.htm", count="-1")%>
    </div>
]}

pages/grid/BtchProdEditGrid.htm :

<#repeat>
    <div class="batch">
        <table class="batchData">
            <tbody>
                <tr>
                    <td class="batchName">
                        <a href="javascript:Consult('Btch',<#F=K_BATCH>)" class="RelationFullName <#I=OPENED;0=Inactive>" title="<#F=NAME>"><#F=NAME></a>
                    </td>
                    <td>
                        <#H=K_SORT>= <#F=K_SORT>
                    </td>
                    <td>
                        <#H=PRICE> <input name="DETAIL-BTCH-<#G>-PRICE" value="<#F=PRICE;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                    <td>
                        <#H=F_CUSTOMER_PRICE> <input name="DETAIL-BTCH-<#G>-F_CUSTOMER_PRICE" value="<#F=F_CUSTOMER_PRICE;nospace=T>" size="6" onchange="ComputeAll()>" readonly>
                    </td>
                    <td>
                        <#H=DISCOUNT> <input name="DETAIL-BTCH-<#G>-DISCOUNT" value="<#F=DISCOUNT;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                    <td class="hidden">
                        <#H=VAT> <input name="DETAIL-BTCH-<#G>-VAT" value="<#F=VAT;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                    <td>
                        <#H=TOTAL> <input name="DETAIL-BTCH-<#G>-TOTAL" value="<#F=TOTAL;nospace=T>" size="6" onchange="ComputeAll()>" readonly>
                    </td>
                    <td>
                      <ul class="small-12 columns button-group">
                        <li>
                            <button class="i-add icon narrow <%IfReadOnly(detail='Prod', then='disabled')%>" title="<%GetLabel('Add Product to Batch')%>" type="button"
                            data-msg="addProdBtch;<#F=K_BATCH;nospace=T>"></button>
                            <%AddRelationButton(entity='Prod')%></li>
                      </ul>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td>
                        <#H=F_RISKS><input name="DETAIL-BTCH-<#G>-F_RISKS" value="<#F=F_RISKS;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                    <td>
                        <#H=F_EQUIPMENT><input name="DETAIL-BTCH-<#G>-F_EQUIPMENT" value="<#F=F_EQUIPMENT;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                    <td>
                        <#H=F_PARTNERS><input name="DETAIL-BTCH-<#G>-F_PARTNERS" value="<#F=F_PARTNERS;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                    <td>
                        <#H=F_SUBCONTRACTOR><input name="DETAIL-BTCH-<#G>-F_SUBCONTRACTOR" value="<#F=F_SUBCONTRACTOR;nospace=T>" size="6" onchange="ComputeAll()>">
                    </td>
                </tr>
            </tbody>
        </table>
        <%Delay(1)%>GetRelationGrid(columndefs="GridEditColumns.txt", entity="Prod", filter='F_BATCH=K_BATCH'
            columns="FULLNAME,K_RELATION{DISPLAY},K_SORT{DISPLAY},F_BATCH{DISPLAY},PRICE,QUANTITY,F_CUSTOMER_PRICE{TOTAL},DISCOUNT,VAT{HIDDEN},COMMENT,TOTAL,CONSO_RATE{HIDDEN},CONSO_TOTAL{HIDDEN},<%IfReadOnly(else=|SORTDELETE|)%>")%>
    </div>
    <!-- try to unfilter, but don't not works -->
    <%LoadScript('Special')%>
    <%RunScript('UnfilterDataSet')%>
</#repeat>
related to an answer for: Favorites management
asked in Efficy/ Client side by (245 points)
edited by

Please log in or register to answer this question.

1,167 questions
1,425 answers
1,717 comments
325 users