Question

Display only distinct records on detail

Hi Community,

Good Day

I have a detail on my edit page which displays the records coming from another object, this records contains some duplicate records. Now I want to group these duplicate records so that only one distinct record will show on the detail list. Is there a way that I can compose my own query lets say "select distinct(code) from product" and display the result as detail list. How can I achieve this?

 

 

Like 0

Like

5 comments

Hello Fulgen,



If I understood you right, the idea is to use the custom entity schema query to get distinct values of detail. Please, check the links below:



https://academy.bpmonline.com/documents/technic-sdk/7-13/creating-detai…



https://academy.bpmonline.com/documents/technic-sdk/7-13/building-paths…



Best regards,

Alex

Alex_Tim,

 

Thanks Alex for your reply, do you have any idea how can i override the existing query of detail and put my own query?

Fulgen Ninofranco,

1. Create a replacing client module for the detail. Or just click on "Detail setup" and then click on "Save". This way the system will create the module in the custom package automatically. 

2. Override the getGridDataESQ method in the module. Please use the code below as an example.

define("OpportunityContactDetailV2", [], function() {

    return {

        entitySchemaName: "OpportunityContact",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,

        methods: {

            getGridDataESQ: function() {

                var esq = this.callParent(arguments);

                esq.isDistinct = true;

                return esq;

            }

        }

    };

});

Please note that the "Distinct" property works for all visible columns so you need to hide the columns with different values.

 

Eugene Podkovka,

Hi Eugene, thanks for your reply,

I have alreday added the code on my detail, below is the complete code



define("UsrSchema16Detail", [], function() {

    return {

        entitySchemaName: "InvoiceProduct",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/{}/**SCHEMA_DIFF*/,

        methods: {

            getGridDataESQ: function() {

                var esq = this.callParent(arguments);

                esq.isDistinct = true;

                return esq;

            }

        }

    };

});

I already hide the columns with different values in column setup but unfortunately it does not display the unique records.

Hello Fulgen,



Unfortunately, bpmonline has no functionality that you have requested, so you can display distinct records in the detail only via developing some custom functionality.



It seems that code above is right and should work in appropriate way but if you have difficulties with that you should debug the code to understand how it works. https://academy.bpmonline.com/documents/technic-sdk/7-13/client-code-de…



If you have further questions about implementing such functionality, please send a video where it`s clear that the detail isn`t working. Please note, that it`s necessary to demonstrate entire screen and devtools with opened network tab. Also, you should find the request to the server from this detail to make sure that it`s built in right way.



In addition, if you are unable to achieve the task you can contact your account manager to use the paid service and developer will help you to implement the desired detail.



Best regards,

Alex

Show all comments