Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: ArturoRobles

#828069
Hi Team

Seeking assistance with this 2 issues am facing in a process am designing.
1.
I have 2 grids in my dynaform, grid 1 is named as debitData and Grid 2 is named creditData, these are for submitting debit and credit entries to a team for processing. In the grids I have amount fields separately for debits and credits, the sum is currently being compared with a code which advises the user with a pop up whether the entry is balanced or unequal when 'Submit' button is clicked, but the case does route to the next step even if the entry is not balanced.
I want to restrict submission to the next step if sum of debit amount does NOT equal sum of credit amount. Is this possible, any ideas please?

2.
Related to the same above issue, I need to allow submission to the next step if sum of debit amount does NOT equal sum of credit amount for only certain GL numbers. Both grids have a GL number text field so for example if a user selects GL number 111 on either grid, on click of submit the case should route to next step even if it is not balanced, but if GL number 222 is selected on either grid, the case should not be able to go to the next step if entry is not balanced.

Any ideas to make this possible please.

Many Thanks
Sarah.
#828154
Hi,
When you use submit button for check you form you must write your code like this:
Code: Select all
$("document").ready( function(){
	getFormById(dyn_uid1).setOnSubmit(function() {
		if($('#error').getValue() != ''){
			return false;
		}
	});
});
Please check the following link:
http://pmlearning.info/plugins.php
Last edited by programerboy on Thu Nov 12, 2020 2:49 pm, edited 1 time in total.
#828174
I use Library https://sweetalert2.github.io/ to display notifications
Step 1: add lib sweetalert2 to the dynaform(external libs)
Step 2: Drag and drop the button onto the dynaform, id: btnComplated
Step 3: Click the event button:
Code: Select all
function checkBalance(){
    //your code
    //...
    //if ok return true   
    return true; 
}
$("#btnComplated").on("click", function() {
    if(!checkBalance()){
        Swal.fire({
                title: 'Are you sure?',
                text: "Are you sure you want to finish?",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Yes, Completed!'
            }).then((result) => {
                if (result.value) {
                    $('#' + frames.dyn_uid).showFormModal();
                    $('#' + frames.dyn_uid).submitForm();
                    $('#' + frames.dyn_uid).showFormModal();
                }                
            });
        return false;
    }
    $('#' + frames.dyn_uid).showFormModal();
    $('#' + frames.dyn_uid).submitForm();
    $('#' + frames.dyn_uid).showFormModal();
});

Excellent read, Positive site, where did u come up[…]

Hello ProcessMakers! We are extremely proud to an[…]

How processmaker load cases on home page of user? […]

Hey everyone, I'd appreciate any help you might be[…]