Question

reg difference between fields

Hi Team,

I am attempting to perform Summation of values of a text field in a detail, and I am attempting to compare the summation value and another field in another detail.

For Example.

 

 

 

 

 

 

Here I want to compare the sum on column assigned number field and the number of vacancies.if the sum on column assigned number exceeds the number of vacancies, then it should show a prompt.

Sum on column assigned number is the summation of the Assigned number.

Can u please tell me the procedure how to do this.

Hoping for a positive reply.

Like 0

Like

1 comments

Dear Manikanta,

You can achieve such task in the following way:

1. When opening a record run custom method, which will be comparing the values in two details. You can use onEntityInitialized method. Please remember to call parent realization firstly (this.callParent(arguments))

2. The custom method should run two queries to the database for each detail. You can use ESQ function to run queries to the database. Please see the article on how to create ESQ funtions:

https://academy.bpmonline.com/documents/technic-sdk/7-13/use-entitysche…

3. Create two virtual attributes to store results to. This should be integer or float type attributes; Here is an example of virtual attribute:

            "ESQCompleted": {

                dataValueType: Terrasoft.DataValueType.BOOLEAN,

                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN

                value: false

            },

4. Each ESQ should be directed to the details' objects. You set filter to the needed column. Process the result collection to sum the quantity. In the callback of ESQ set the result to the virtual attribute.

5. Compare the values of attributes and show information dialog when needed.

Regards,

Anastasia

Show all comments