Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By heemalkumar
#815060
Hi Guys,
I have Grid1 and Grid2.
In Grid1, I have a field named as Amount1 and in Grid2 I have a field as Amount2.

On clicking of the submit button, I want processmaker to go and validate that Sum of Amount1 = Sum of Amount2.

How do I go about doing that.
By andreaadamczyk
#815067
Dear heemalkumar,

You can use the next jquery function to reach what you want to do:
Code: Select all
$( "#submit0000000001" ).click(function() {
	var sum1 = $('#sum-gridVar005-Amount1').val();
        var sum2 = $('#sum-gridVar006-Amount2').val();
	if(sum1 == sum2)
    	    alert("equal");
        else
            alert("Non-equal");
});
Where "submit0000000001" is the ID of the submit button, the variable "sum1" stores the value of the sum in the grid1 (look that you can get the value of the sum field using the next syntax: sum-grid_id-field_id) , the variable "sum2" stores the value of the sum in the grid2, finally you can compare if both sums are equal or not.

I also have attached the JSON file of the Dynaform in case you want to test this function yourself.

I hope have clarified all your doubts.

Regards.
Attachments
(2.31 KiB) Downloaded 211 times

If you're seeking to maximize gains and minimize r[…]

Embark on your virtual journey with Dappsfirm! Our[…]

Unleash your creativity with us! Dive into the wor[…]

Most entrepreneurs would pick the crypto exchange […]