I would like to know how to obtain the data that my apex method is generating step by step, system debugs. I have not seen any documentation on the internet which has some information of what I need.
In aura it's easy, you open the developer console and you get all the apexlogs in the "log section".
I only found examples for javascript on the internet and not for apex
Thank you.
EDIT:
validarContratoJS(){
this.contract = this.getSObject(this.contract);
this.camposFormularioWrapper = { tipoConfiguracion : 'validarContrato', contrato : this.contract };
validarContrato({camposFormulario: this.camposFormularioWrapper })
.then(result => {
if(!result.success){
console.log('error: '+ JSON.stringify(result));
this.contratoValido = true;
this.contratoCortable = result.contratoCortable;
console.log('codigo tipo contrato: '+this.contract.ATN_Codigo_Tipo_Contrato__c);
this.codTipoContrato = this.contract.contratoCortableATN_Codigo_Tipo_Contrato__c;
if(this.contratoValido && result.fechaVencimientoProducto){
this.fechaVencimientoProducto = true;
}
if(this.contratoValido && result.solicitudModificado){
this.solicitudModificado = true;
//falta poner disabled boton modificacion economica
//falta poner disabled boton tecnicas siempre que la linea negocio sea distinto de Gas
}
this.spinner = false;
console.log('he puesto el spinner a false');
}else{
this.spinner = false;
this.mensajeError = result.mensaje;
this.contratoValido = false;
console.log('mensajeError pero bien: '+this.mensajeError);
}
})
.catch(error => {
console.log('Error mensaje: '+JSON.stringify(error));
let message = 'Unknown error';
if (Array.isArray(error.body)) {
message = error.body.map(e => e.message).join(', ');
} else if (typeof error.body.message === 'string') {
message = error.body.message;
}
console.log('Error mensaje detallado: '+message);
});}
This javascript function calls the apex method "validarContrato", but the console does not throw any debug log to know why it has returned the value in one way or another.
aura
logs in developer console.