Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#823194
The easiest way to do that is to include the other forms as subforms in one Dynaform, then use JavaScript to show or hide the subforms.

You can use this JavaScript code:
Code: Select all
function showHideForms(newVal, oldVal) {
  if (newVal == 'None') {
    $("#2422049205c776b71e64a77031427074").hide(); 
    $("#7046511145c799fadb6a353004929903").hide();
  }
  else if (newVal == 'client_form') {
    $("#2422049205c776b71e64a77031427074").show(); 
    $("#7046511145c799fadb6a353004929903").hide();
  }
  else if (newVal == 'product_form') {
    $("#2422049205c776b71e64a77031427074").hide(); 
    $("#7046511145c799fadb6a353004929903").show();
  }
}

$("#selectForm").setOnchange(showHideForms); //execute when dropdown's value changes

showHideForms( $("#selectForm").getValue(), '' ); //execute when form loads
Where "selectForm" is your dropdown box, 2422049205c776b71e64a77031427074 is the ID of the Client Form and 7046511145c799fadb6a353004929903 is the ID of the Product Form.

Here is an example:
(44.14 KiB) Downloaded 227 times
#823414
You probably don't need to use PMFSendMessage() in a trigger. There is an option in the Properties of tasks to send an email to the next assigned user. See:
https://wiki.processmaker.com/3.2/Tasks#NOTIFICATIONS

If you do need to use PMFSendMessage(), then you should run a case with Debug Mode enabled to see if there is an error message in the __ERROR__ variable. If not, then go to Information > Notifications to see if the email was created. If you see the email in the list, but you didn't receive it, then you probably need to set up a cron job in Linux or Scheduled Task in Windows to periodically execute your cron.php script to send out emails.

Also check the return value of PMFSendMessage():
@@ret = PMFSendMessage(...);
If set to 0, then the email wasn't set, then you have a problem in your parameters. It could be many things, such as:
1. bad email addresses,
2. wrong spelling of the email template filename,
3. the email in the $from parameter isn't the same as the email account you used under Admin > Settings > Email Server,

If you still can't figure it out, then export your process and post the .pmx file here, and I will look at it.
#823434
Another concern, I have a form that loads data from a database. Within a grid subtotal is calculated per row, in the same grid I can change a value and immediately change the value of the total but it is not updated with the following code in javascript.
Code: Select all
var numeroFilas = $("#gridDetalleRequerimiento").getNumberRows();  

for (var i = 1; i <= numeroFilas; i++) {

   function actualiza(newval, oldval) {
      var newVal = parseFloat( $("#txtGridCantidadApr").getText(i,7) ) * parseFloat( $("#txtGridCosto").getText(i,5) );
      $("#txtGridSubtotal").setText("grid",i,8);
   }
   
   $("#txtGridCantidadApr").setOnChange(actualiza);
   actualiza( $("#txtGridCantidadApr").getText(i,7), ' ');
}
#823436
XimenaCampania wrote: Mon Mar 18, 2019 5:59 pm Another concern, I have a form that loads data from a database. Within a grid subtotal is calculated per row, in the same grid I can change a value and immediately change the value of the total but it is not updated with the following code in javascript.
Code: Select all
var numeroFilas = $("#gridDetalleRequerimiento").getNumberRows();  

for (var i = 1; i <= numeroFilas; i++) {

   function actualiza(newval, oldval) {
      var newVal = parseFloat( $("#txtGridCantidadApr").getText(i,7) ) * parseFloat( $("#txtGridCosto").getText(i,5) );
      $("#txtGridSubtotal").setText("grid",i,8);
   }
   
   $("#txtGridCantidadApr").setOnChange(actualiza);
   actualiza( $("#txtGridCantidadApr").getText(i,7), ' ');
}
1. It should be spelled as setOnchange(), not setOnChange().

2. You can't use setOnchange() with grids and fields inside grids. You have to use form.setOnchange(), as explained here:
https://wiki.processmaker.com/3.1/Grid_ ... s_in_grids

3. Is "txtGridCantidadApr" a field inside a grid or is it a grid? If it is a field inside the "gridDetalleRequerimiento" grid, then you need to access its text as:
$("#gridDetalleRequerimiento").getText(i, 7)

4. If you are trying to calculate the subtotal in a grid row, then you should set the following formula in the properties of your "txtGridSubtotal" field:
txtGridCantidadApr * txtGridCosto
That way you don't need to use JavaScript code. You can use the "sum" function to calculate the total for the entire grid.


PS: In the future, please create a new thread when you have unrelated questions. It gets very confusing for me and other people will never find this if they are looking at the post titles.
#823437
XimenaCampania wrote: Mon Mar 18, 2019 5:40 pm Thanks for the indications. I would greatly appreciate your help.
I was testing with the configuration in different triggers without having a positive result. in the emails option the message "The default configuration was not the default one" appears.
I don't know where the "emails option" is. Can you provide a screen shot of the message "The default configuration was not the default one" or explain clearly where you see that?

I don't see any errors in your trigger code, but I can't check very much.
* Did you receive the test email when you configured your account at Admin > Settings > Email Server?
* Do you receive the email when you use the option to send an email to the next assigned user in task properties?
* Is there an error message in the __ERROR__ variable?
* Does the email appear in the list when you go to Information > Notifications ?
* Is wxzumba@uce.edu.ec the same email as you used when you configured your account at Admin > Settings > Email Server?

Web3 development encompasses creating decentralize[…]

The Upland Clone Script, offered by Dappsfirm, rep[…]

Dappsfirm offers a bet365 clone script that mirror[…]

🚀 Tauchen Sie mit Immediate Alora AI in die Welt d[…]