Bonjour,
Version=5.0.60
J’utilise une requête pour définir les destinataires d’une alerte par email (EVL_Eval_LackInfos_Resp) :
"select usr_email from m_user where row_id=[VALUE:evlValInvId.evlFndId.EvlFund_User_id]"
Seulement, la valeur “[VALUE:evlValInvId.evlFndId.EvlFund_User_id]” ne remonte pas alors qu’elle remonte correctement sur la fiche de l’enregistrement (champ ramené par double jointure :
FUND (qui contient Fund_User_Id ) 1-* INVESTISSEMENT *- 1 VALUATION (table qui nous intéresse) ).
Logs :
2021-08-10 10:13:30,034 WARN [com.simplicite.bpm.Alert] SIMPLICITE|http://demo.simplicite.io:20128||WARN|designer|com.simplicite.bpm.Alert|send||Evénement: There is no mail recipient in the alert EVL_Eval_LackInfos_Resp.
2021-08-10 10:13:30,032 ERROR [com.simplicite.util.engine.ProcessLoader] SIMPLICITE|http://demo.simplicite.io:20128||ECOREDB001|system|com.simplicite.util.engine.ProcessLoader|query||Error SQL query: select usr_email from m_user where row_id=''
java.sql.SQLDataException: data exception: invalid character value for cast in statement [select usr_email from m_user where row_id='']
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
Si j’appelle cette même valeur par javascript, elle remonte bien :
public void notifyManagerFund(){
//test
String content = HTMLTool.getResourceHTMLContent(this, "EVL_ManagerFund_Notify");
// remplacer les valeurs
// envoyer
MailTool mail = new MailTool(getGrant());
String mailManager = getGrant().simpleQuery("select usr_email from m_user where row_id="+getFieldValue("evlValInvId.evlFndId.EvlFund_User_id"));
AppLog.info("===================emailtest="+mailManager, Grant.getSystemAdmin());
mail.addRcpt(mailManager);
mail.setSubject("Test Mail");
// mail.addAttach(obj, myObjectFile);
mail.setBody(content);
mail.send();
}
Logs :
2021-08-10 10:16:22,329 INFO [com.simplicite.objects.Evaluator.EvlValuation] SIMPLICITE|http://demo.simplicite.io:20128||INFO|system|com.simplicite.objects.Evaluator.EvlValuation|notifyManagerFund||Event: ===================emailtest=mymail@yopmail.com
Merci pour votre aide,