Hello all,

How to display Data List in Email Template ? i used bpm ver. 7.12

Thanks

Like 1

Like

8 comments

Dear Vidya,

Since templates are based on HTML you can use HTML coding to form the template as you want. Below you may find more information about tables and lists in HTML:

https://www.w3schools.com/html/html_tables.asp

https://www.w3schools.com/html/html_lists.asp

To add HTML code to your template go to template designer -> HTML code (http://prntscr.com/m1ir8g)

Best regards,

Angela

Dear Angela,

I means how to retrieve looping a data from multiple row data to email template, maybe this picture can describe what i want...

That section show 6 row data, and than i want to show that all data in email template.. and configuration email template :

But the result is only last record showed in email. please advise...

vidya.dharma,

Hello,

We can recommend you to setup a printable with the data from a detail and then send it with the help of a business process. The example of the implementation is described below:

https://community.bpmonline.com/articles/generate-printable-and-send-it…

You can modify the process ,so it meets your requirements.

Best regards,

Matt

Hi everyone,

Vidya question is very important to us... and for most of the cases, a printable it's not the solution. Can you give us some more tips on HTML?

@vidya.dharma - did you find another solution?

Thanks,

Luis

 

 

luis.goncalves@imdigital.pt,

 

You can implement you business task by the means of business process. The idea is to add read data elements, which would retrieve needed data from particular records. Afterwards, use “send email” business element to combine data into email and send it. You can add a button on the section, or action to trigger the process. 

 

Please see the following article. You can use this example to select needed records and pass this info to business process to send email.

 

https://academy.bpmonline.com/documents/technic-sdk/7-13/how-add-section-action-handling-selection-several-records

 

Regards, 

Anastasia

luis.goncalves@imdigital.pt,

One other way, although it's a bit more complicated, is by using a custom macro (https://academy.bpmonline.com/documents/technic-sdk/7-13/adding-macro-h…).

For example, I made this a while back to show a filtered list of products on an order; the HTML is very simple, as it was a demonstration, but that can easily be edited with CSS as necessary.  You can see that 'arguments' is passed the record ID if you link the template to a record; the macro is then called by including [#@Invoke.UsrEmailProducts#] in your template.

namespace Terrasoft.Configuration
{
	using System;
	using Terrasoft;
	using Terrasoft.Common;
	using Terrasoft.Core;
	using Terrasoft.Core.Entities;
	using Terrasoft.Core.DB;
	using Newtonsoft.Json;
 
	public class UsrEmailProducts : IMacrosInvokable
    {
        public UserConnection UserConnection {
            get;
            set;
        }
        public string GetMacrosValue(object arguments) {
        	var sjson = JsonConvert.SerializeObject(arguments);
        	var templ = new {Key = String.Empty, Value = String.Empty};
        	var args = JsonConvert.DeserializeAnonymousType(sjson, templ);
        	var orderId = args.Value;
        	var esq = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "OrderProduct");
            var colCode = esq.AddColumn("Product.Code");
            var colDescription = esq.AddColumn("Product.Name");
            var colQty = esq.AddColumn("Quantity");
            var colSpecs = esq.AddColumn("UsrSpecifications");
            var colColour = esq.AddColumn("UsrColour");
            var OrderFilter = esq.CreateFilterWithParameters(
			    FilterComparisonType.Equal, "Order", orderId);
			var ModifiedFilter = esq.CreateFilterWithParameters(
			    FilterComparisonType.Equal, "UsrModified", true);
            esq.Filters.LogicalOperation = LogicalOperationStrict.And;
            esq.Filters.Add(OrderFilter);
            esq.Filters.Add(ModifiedFilter);
            EntityCollection entities = esq.GetEntityCollection(UserConnection);
            var html = "<table><tr><td>Code</td><td>Description</td><td>Quantity</td><td>Specifications</td><td>Colour</td></tr>";
            foreach (Entity entity in entities) {
            	html += "<tr>";
            	html += "<td>" + entity.GetColumnValue(colCode.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colDescription.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colQty.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colSpecs.Name).ToString() + "</td>";
            	html += "<td>" + entity.GetColumnValue(colColour.Name).ToString() + "</td>";
            	html += "</tr>";
            }
            html += "</table>";
            return html;
        }
    }
}

Edit: All the </> should be proper lt/gt characters, that's just the forum software replacing them.

Hi Darian Lewis,

I'm working together with Luis Gonçalves, and we finally had some time to test your sugestion.

It is actually working perfectly, the table is created in the email in the context of the record ID and there isn't even any need to replace the "</&gt".

Thank you very much.

I've got one more question for you: this works fine if I start an email from the Case and the ID is passed perfectly.

But if I try to reply to an email that was sent by a costumer and the email is linked with that same Case. Then the conection does not work and the recordID is not retrieved. Any idea how I could make the conection between the macro and the case that is linked with the email that I'm replying to?

 

Once again thanks for the help.

Luis

Luis Tinoco Azevedo,

I'm afraid that's more of a back-end BPM thing; to the best of my knowledge, the 'arguments' argument ought to hold the current record, but as I'm not a BPM employee, I don't know what the mechanics behind it are.  It may be that the 'current record' when you're replying to an email is the Activity object representing the email instead of the Case object, but that's just a guess.  I don't know to what extent you're comfortable with the code, but have you tried temporarily returning the contents of the arguments variable (instead of the table) to see what's being passed in?

Show all comments

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 need to edit organizational roles and show some additional fields in its page. can we do this by replacing object ? or what is the best approach and how can we do it?

Like 0

Like

1 comments

Dear Ayman,

Unfortunately as for now there is no possibility to change the org.role page with the help of out-of-the-box tools of the application and we do have a correspondent problem registered on our side.

As for now theoretically the only one way to change them is with the help of the replacing object, but we should warn you that it is risky to do, because roles like "All employees" and "System administrators" are used almost everywhere in the application and making some changes to them can lead to some new errors. Actually we don't recommend performing changes to this object, but if you want to try - please use dev-instance or local instance.

Best regards,

Oscar

Show all comments

I created a custom service following this guide: https://academy.bpmonline.com/documents/technic-sdk/7-12/how-create-custom-configuration-service. The GET method works as expected but when I created a POST endpoint, the only response I get is 403. Actually sending POST request to any endpoint ends up with this error. My class looks like this:

[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UsrCustomService: BaseService
{
	[OperationContract]
	[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
	public bool PostTest()
	{
		return true;
	}
 
	[OperationContract]
	[WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)]
	public string GetTest()
	{
		return "Hello world";
	}
}

Do you know how can I fix it?

Like 0

Like

7 comments

Dear Carlos,

This error indicated that you are forbidden to insert into the object. This usually happens, when the user, whose login details you are using to connect does not have rights to write to the indicated object.

Please double check the rights for the object per user you are authenticating with.

Regards,

Anastasia

Anastasia Botezat,

Hm, I'm not inserting into any objects here, the service just returns constant values (for now). I'm also authenticating with Supervisor account.

Carlos,

Please check the CSRF header in your request. Probably, you don't pass CSRF cookie and therefore get the error - https://academy.bpmonline.com/documents/technic-sdk/7-12/protection-csrf-attacks-during-integration-bpmonline

If this won't help. please contact our support at support@bpmonline.com, since it's hard to say what's wrong with the request as we don't see the request body and the request headers. Please, use Fiddler as a proxy and send us a full text of the request from Fiddler. This way we will be able to find the cause of issue.

Regards,

Anastasia

Carlos Zaldivar Batista,

How are you calling the configuration service? Is it from within a client schema or from externally using code or something like postman? 

Ryan 

Ryan Farley,

Postman. And before making request to UsrCustomService I first make a request to /ServiceModel/AuthService.svc/Login to obtain authentication cookies.

Carlos Zaldivar Batista,

Are you also copying the contents of the BPMCSRF cookie on the call to AuthService.svc/Login to the CSRF header for the request to the config service? 

This article in the academy outlines the steps for making this call via Postman https://academy.bpmonline.com/documents/technic-sdk/7-13/how-call-confi…

Ryan Farley,

Nope, that's what I was missing. Thanks!

Show all comments

I am using the Update Query to save an object programmatically. I also created a business process that is triggered when this object is updated.

After updating the object programmatically using Update Query, the process is not triggered.

Is there any methods on the business layer that i can use for this purpose?

Like 0

Like

2 comments

Hello.

The business process cannot be triggered after the direct update in the database. That is done on purpose. You can create another process that would do the update for you, the updates made by the business process trigger other business processes. However, we do not recommend you to do this for large batches of records.

Best regards,

Matt

We used Entity.Save() method and it worked. https://academy.bpmonline.com/api/SDKNETAPI/7.7.0/Terrasoft.Core~Terras…;

 

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

Hi Community,

 

How can i create radio button field like in opportunity page

 

Like 0

Like

1 comments

Hi Community,

 

I want to create a PAGE, this page can add record but instead of adding one record at a time I want its behavior like in adding product in order page (all products were listed already, you can enter multiple records and save).

 

Like 0

Like

1 comments

Hello.

You can use a detail with the selection from a lookup for this purpose. The step by step guide is available in the article below:

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

Best regards,

Matt

Show all comments