Question

Column Summation - Printables

Hi All,

Please i need your help. I just created a printable that displays product summary but i need to add the totol price of all product listed on the page. Also I tried to use this function to get current date plus 30day but didn't get any result.  Any idea will be highly appreciated.

GetCurrentDateTime.AddDays(30).Date.ToString("d MMM yyyy");

Thanks,

File attachments

Like

5 comments

Dear Adebola,

 

Unfortunately, at the moment there is no option to make any calculations within the printable itself. We have this suggestion in mind for the further releases, but now we suggest the following workaround. 

You can create a custom total field on the page and have the business process that would calculate the total of all the products listed there. This process should populate the field and then you'll be able to display the value on the printable. 

As for the function, make sure you use the first part of the suggested function as well as the last one:

 

Lisa

Hi Lisa,

Thanks for the tips, i just create a process and it runs correctly but not displaying any value.

Could you please check this code, just to be sure i did everything correctly

var userConnection = Get<UserConnection>("UserConnection");

var esq = new EntitySchemaQuery(userConnection.EntitySchemaManager,"Opportunity");

esq.PrimaryQueryColumn.IsAlwaysSelect=true;

esq.AddColumn("AtsTotalCostofProductInOpportunity");

var entities = esq.GetEntityCollection(userConnection);

foreach(var entity in entities){

    var productEsq = new EntitySchemaQuery(userConnection.EntitySchemaManager, "OpportunityProductInterest");

    var amountColumn = productEsq.AddColumn(productEsq.CreateAggregationFunction(AggregationTypeStrict.Sum,"AtsLineTotal"));

    var filter = productEsq.CreateFilterWithParameters(FilterComparisonType.Equal, "Opportunity.Id", entity.PrimaryColumnValue);

    productEsq.Filters.Add(filter);

    var totalAmount = productEsq.AddColumn("AtsLineTotal").Name;

    var productEntities = productEsq.GetEntityCollection(userConnection);

    if(productEntities.Count > 0){

        var accountAmount = productEntities[0].GetTypedColumnValue<decimal>(totalAmount);

        var update = new Update(userConnection, "Opportunity")

        .Set("AtsTotalCostofProductInOpportunity",Column.Parameter(accountAmount))

        .Where("Id").IsEqual(Column.Parameter(entity.PrimaryColumnValue)) as Update;

        update.Execute();

    }

    

}

return true; 

 

We have checked your code – you did everything correctly.

For further investigation on the issue I suggest you to create a ticket (write to support@bpmonline.com )

Lisa Brown,



Any update for the Math functionality in Printable?



BR,

Bhoobalan Palanivelu.

Bhoobalan Palanivelu,

 

As I can see this idea has been accepted by our R&D team but it has a rather low priority due to a low demand for this kind of functionality. However,  it may still appear in future.

Show all comments