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

Dear Team,

                   Here, I currently working fine with any format is attached in a section. But I need to format validation example like only upload (.doc ) format. How to do this functionality?. Please guide me.

Regards,

Sekhar.

Like 0

Like

1 comments

Hello Sekhar,



To achieve it you should check extension when the file uploads. Please note on the "FileDetailV2" client module, more specifically, on methods that are responsible for file uploading. The idea is to create replacing client module where additional upload logic can be put.



In that case you will face with client code debugging:

https://academy.bpmonline.com/documents/technic-sdk/7-13/client-code-de…



Best regards,

Alex

Show all comments

I created three new details in the Order page on a new tab.  When I add a new record it shows a list of all records in the table instead of being filtered out by the Order.  If I refresh the page, it looks fine (only showing the records associated with that Order).  I checked over the instructions online and didn't find anything obvious that could be causing it.  Does anyone have an idea what I should look at?

 

 

When I refresh the page the highlighted item goes away.

Like 0

Like

1 comments

Hello Timothy,



The problem can cause overridden methods of basegriddetail, or incorrect filters. More about details and working with them you can find by following the link: https://academy.bpmonline.com/documents/technic-sdk/7-13/details-0



If you will have further questions, please attach the code to the message



Best regards,

Alex

 

Show all comments

Is there a way to prevent incoming and outgoing emails from generating all of the tiny image file attachments in the linked records attachments tab?  For example, I receive and mark as processed an email from a vendor.  That email has a dozen image files attached to it for all of their social media links, website links, photos etc.  It also has one actual word file that I need but I don't even see that file in the attachments tab unless I keep scrolling down past the other 12 image files.

Is there a filter or business rule that would allow me to stop certain file extensions or file types or set a minimum file size from becoming bpm attachments to stop all of the attachment clutter?

Like 0

Like

1 comments

Hello Scott,



If I understood you right, the you need to achieve is to create size limit for files that you can attach to entity. One of the ways to do it to create event subprocess on "inserting" where the size should be checked:

 

int size = Entity.GetTypedColumnValue<int>("Size");

if (size > 1048576)

    throw new Exception("Размер вложенного файла превышает 1 Мб");

return true;



Also, Size can be limited by web server itself.

In the application configuration file

Terrasoft.WebApp \ Web.config

see the <requestLimits maxAllowedContentLength = "104857600" />

This is the limit for the any data downloaded to the server in bytes.



Best regards, 

Alex

 

Show all comments

Hello,

I have an enquiry regarding parsing a collection of records. The idea is I want to read a number of records "Read Data" (a collection of them) and want to pass their email addresses and Names into the "Send To" field of the "Send Email" process element and their name into the merging "Email body content". 

In what way would I be able to do that?

 

Thank you

Like 1

Like

1 comments

Hello Thanos,



Unfortunately, it`s not possible to send email to many participants using "Send email" process element. You can achieve via using script task. The idea is to read collection of contacts via Read data process element and then to send email to each contact from the collection using Script task.



FYI: To read collection of elements that "Read data" retrieved from the database use the following code: 

var entities = Get&lt;ICompositeObjectList&lt;ICompositeObject&gt;("ReadDataUserTask1.ResultCompositeObjectList");

The example of implementation of script task that sends email you can find in "SendEmailToCaseContactProcess", "SendMailScriptTask" element. 

Also, check the link below:

https://community.bpmonline.com/questions/email-attachments-business-pr…



Best regards,

Alex

Show all comments

Hi Community,

 

How can I sort the the records in detail using the client code

Like 0

Like

3 comments

Dear Fulgen,

You may use and example described here: https://community.bpmonline.com/articles/how-sort-records-date-modifica…

Angela Reyes,

Hi Angela,

Thanks for your answer, but I don't need to create a query anymore since I am using already a detail, is there any property under it that can sort the list by column

Fulgen Ninofranco,

I recommend you to use entityschemaquery like Angela said, but if it`s not an option there is one more way to achieve it.



Also, please note on attributes of GridDetail: sortColumn, sortColumnDirection, sortColumnIndex.

It will look something like this: 

"sortColumn": {"bindTo": "sortColumn"},
"sortColumnDirection": {"bindTo": "GridSortDirection"},
"sortColumnIndex": {"bindTo": "SortColumnIndex"}

Also, more about details you can find here:

https://academy.bpmonline.com/documents/technic-sdk/7-13/details-0

Best regards,

​​​​​​​Alex

 

 

Show all comments

Hello,

I'm trying to get the list of OpportunityFile associated with an Opportunity with no success.

I tried the following requests:

1.Using the link Url I'm getting a "Not Implemented" exception.

https://.bpmonline.com/0/ServiceModel/EntityDataService.svc/Opportunity…

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<script/>
<code>4

Not Implemented

Not Implemented
System.Data.Services.DataServiceException

at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
at System.Data.Services.DataService`1.HandleRequest()

Method 'SelectMany' not supported
System.NotSupportedException

at Terrasoft.Core.Entities.EntityQueryProvider.VisitMethodCall(MethodCallExpression node)
at Terrasoft.Core.Entities.EntityQueryProvider.Build(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.LoadEntityCollection(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.ExecuteEnumerable(Type elementType, Expression expression)
at Terrasoft.Core.Entities.EntityQuery`1.GetEnumerator()
at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)

2. Using the $filter based on OpportunityId I'm receiving an exception saying the "OpportunityId not found".

https://.bpmonline.com/0/ServiceModel/EntityDataService.svc/Opportunity… eq guid''

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<script/>
<code>1

Collection item with name OpportunityId not found.

Collection item with name OpportunityId not found.
Terrasoft.Common.ItemNotFoundException

at Terrasoft.Core.Entities.EntitySchema.GetSchemaColumnByPath(String columnPath)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.CreateExpression(Expression node)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.CreateSimpleFilter(BinaryExpression binary)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.CreateFilter(Expression node)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.BuildBlock(MethodCallExpression node)
at Terrasoft.Core.Entities.EntityQueryProvider.VisitMethodCall(MethodCallExpression node)
at Terrasoft.Core.Entities.EntityQueryProvider.Build(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.LoadEntityCollection(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.ExecuteEnumerable(Type elementType, Expression expression)
at Terrasoft.Core.Entities.EntityQuery`1.GetEnumerator()
at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
at System.Data.Services.DataService`1.HandleRequest()

How can I get the list and avoid the exceptions? 

Thanks in advance. 

Like 0

Like

3 comments

Hello Radu,

You can use the following filter to accomplish this: 

https://<server>.bpmonline.com/0/ServiceModel/EntityDataService.svc/OpportunityFileCollection?$filter=Opportunity/Id eq guid'<opportunity_id>'

Note, the filter itself is as follows (forward slash between the Opportunity and Id): 

Opportunity/Id eq guid'someguid'

Ryan

Ryan Farley,

Thanks Ryan. It works.

Hello Radu,



You are experiencing such difficulties cause request is built in wrong way.

Also, check Ryan`s answer above, it seems that it`s correct.



How to create request with filter to ODATA service you can find here:

https://academy.bpmonline.com/documents/technic-sdk/7-13/examples-reque…

Show all comments

Hi,

I'm trying to get a list of OpportunityFile associated with an OpportunityId and it's seems it's not possible using ODATA.

1. If I'm using this Url https://server.bpmonline.com/0/ServiceModel/EntityDataService.svc/Oppor… I'm getting a "Not Implemented" exception

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<script/>
<code>4

Not Implemented

Not Implemented
System.Data.Services.DataServiceException

at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
at System.Data.Services.DataService`1.HandleRequest()

Method 'SelectMany' not supported
System.NotSupportedException

at Terrasoft.Core.Entities.EntityQueryProvider.VisitMethodCall(MethodCallExpression node)
at Terrasoft.Core.Entities.EntityQueryProvider.Build(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.LoadEntityCollection(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.ExecuteEnumerable(Type elementType, Expression expression)
at Terrasoft.Core.Entities.EntityQuery`1.GetEnumerator()
at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)

2. If I'm using this Url https://server.bpmonline.com/0/ServiceModel/EntityDataService.svc/Oppor… eq guid'e14b9eb7-99ff-43a6-bf26-a60b23b3ec12') I'm getting the following exception:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<script/>
<code>1

Collection item with name OpportunityId not found.

Collection item with name OpportunityId not found.
Terrasoft.Common.ItemNotFoundException

at Terrasoft.Core.Entities.EntitySchema.GetSchemaColumnByPath(String columnPath)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.CreateExpression(Expression node)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.CreateSimpleFilter(BinaryExpression binary)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.CreateFilter(Expression node)
at Terrasoft.Core.Entities.EntityQueryWhereBlockBuilder.BuildBlock(MethodCallExpression node)
at Terrasoft.Core.Entities.EntityQueryProvider.VisitMethodCall(MethodCallExpression node)
at Terrasoft.Core.Entities.EntityQueryProvider.Build(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.LoadEntityCollection(Expression expression)
at Terrasoft.Core.Entities.EntityQueryProvider.ExecuteEnumerable(Type elementType, Expression expression)
at Terrasoft.Core.Entities.EntityQuery`1.GetEnumerator()
at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable)
at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
at System.Data.Services.DataService`1.HandleRequest()

3. Also, if I'm using this Url https://server.bpmonline.com/0/ServiceModel/EntityDataService.svc/Oppor… eq guid'b3427cc4-3b20-4c16-8d2a-058ada7e7631') I'm getting a different error.

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<script/>
<code>4

Syntax error at position 1.

Syntax error at position 1.
System.Data.Services.DataServiceException

at System.Data.Services.Parsing.ExpressionLexer.ValidateToken(TokenId t)
at System.Data.Services.Parsing.ExpressionLexer.ReadDottedIdentifier(Boolean allowEndWithDotStar)
at System.Data.Services.RequestQueryProcessor.ReadExpandOrSelect(String value, Boolean select, IDataService dataService)
at System.Data.Services.RequestQueryProcessor.ProcessSelect()
at System.Data.Services.RequestQueryProcessor.ProcessQuery()
at System.Data.Services.RequestQueryProcessor.ProcessQuery(IDataService service, RequestDescription description)
at System.Data.Services.RequestUriProcessor.ProcessRequestUri(Uri absoluteRequestUri, IDataService service, Boolean internalQuery)
at System.Data.Services.DataService`1.HandleRequest()

It seems the filtering is not working on associated collection entities. Do you have any ideas?

Regards,

Radu

Like 0

Like

1 comments

Dear Radu,

Please see the example below. Draw your attention to the column OpportunityId syntax - Opportunity/Id

 

http://localhost:8006/0/ServiceModel/EntityDataService.svc/OpportunityF… = Opportunity/Id eq guid'410006e1-ca4e-4502-a9ec-e54d922d2c00'

 

Regards, 

Anastasia

Show all comments

I'm not sure if I'm just doing something wrong with formatting, etc., or if this simply won't work using the standard Word Printables functionality, but I am trying to create a document (as a PDF) that makes internal decisions using the Word IF statements and information fed to the printable via the printables mergefields.

 

For example, I have one value that I want to have calculated based upon the DownPayment mergefield.  If the DownPayment is greater than a certain amount, additional language is added to the document  (i.e. {IF {MERGEFIELD <>}>=10000,"Amount shall be wired directly to...",""}   This works in the document before making it a printable, but once I make it a printable this functionality no longer works.

Thoughts?

Like 0

Like

2 comments

Yes. That's how it works smiley The report generator will be modified in the further versions. 

There are 2 options on how to handle the situation now:

1. You can create a new field on the related page and calculate it with a business process before creating the printable. 

2. You can create a new view in the database. The view will contain all fields with the calculations. Then create a new object based on the view and use the object for the printable. 

https://community.bpmonline.com/questions/bpm-75-sales

 

 

Eugene Podkovka, rhis still is not working in the nee versions. im trying to do a if condition as well

Show all comments

Hi Community,

 

How can i create radio button field like in opportunity page

 

Like 0

Like

1 comments