I have integrated SOAP service in trial version of Sales Creatio. The test request was successful and returns the response parameters correctly, but when I'm trying to call the webservice in business process and bind the response parameter to auto-generated page, it shown only "Response body" in Process Elements parameter.

 

Please, refer the screenshots attached.

 

 

 

Any guidance would be appreciated!

Like 0

Like

3 comments

My guess is that it is because the web service is returning an array of records and the MemberNumber is from an element in the array/collection. If the web service is really just returning one record, but wrapping it in an array, you could map the field in the web services setup in Creatio as something like (you might need to modify this to match the structure of the json returned from the API):

$.[0].MemberNumber

To specifically get the value from the record at index 0 of the array.

Ryan

How to bind all the records from array/collection in grid from web service response without entity?

Revathi,

You’ll need to use a subprocess and pass each item returned to the sub process. See an article on that here https://customerfx.com/article/working-with-collections-from-a-web-service-element-in-a-process-in-creatio/

Ryan

Show all comments

Dear colleagues,

 

If have a couple of process calls in a client module, very similar, one works and the another ones fails before to call the process getting a "400 (Bad Request)" error

 

Here is the code, the first one fails:

OnGeneraDetalleContratoBtnClick: function() { 
	// Guarda el registro, por si hubo cambios
	this.save();
 
	const RunProcessRequest = Ext.create( "Terrasoft.RunProcessRequest", { 
		// El nombre del Proceso
		"schemaName": "NdosCreaDetalleContrato", 
 
		// Parámetros de entrada
		"parameterValues": { 
			"NdosGrupoEconomicoID": this.get( "NdosGrupoEconomico" ),
			"NdosContratoID": this.get( "Id")
 
		},
 
		// Parámetros de Salida - True => Hay sucursales
		"resultParameterNames": [ 
			"NdosReturn"
 
		]
	} ); 
 
	// Ejecuta el proceso
console.log( RunProcessRequest );
// THIS gets error "400 (Bad Request)" here in the execute	//ERROR ERROR HERE HERE			
	RunProcessRequest.execute(function(response) { 
		// Si OK, actualiza el valor en funcion de la salida
		if (response.isSuccess()) { 
			// Actualiza la cantidad de meses que dura el contrato
			if ( response.resultParameterValues[ "NdosReturn" ] === true ) {
				// Tiene sucursales, inhablitita el boton...
				this.set( "NdosDetalleContratoGenerado", true );		
 
				}
		} 
	}, this ); 
},

 

This another wroks fine and are (as I saw identical!!)

// Jalcon - NoCode-Services - 20240110 - 
// Cambia alguna de las fechas del Contrato, debe ajustar la duración en meses del mismo
updateDuracionContratoMeses: function() { 
	const runProcessRequest = Ext.create("Terrasoft.RunProcessRequest", { 
		// El nombre del Proceso
		"schemaName": "Jfl_MesesEntreDosFechas", 
 
		// Parámetros de entrada
		"parameterValues": { 
			"NdosFechaInicial": this.get( "NdosFechaInicio" ), 
			"NdosFechaFinal": this.get( "NdosFechaFinContrato" )
		},
 
		// Parámetros de Salida
		"resultParameterNames": [ 
			"NdosCantidadDeMeses"
 
		] 
	}); 
 
	// Ejecuta el proceso
	runProcessRequest.execute(function(response) { 
		// Si OK, actualiza el valor en funcion de la salida
		if (response.isSuccess()) { 
			// Actualiza la cantidad de meses que dura el contrato
			this.set( "NdosMesesDuracionContrato", response.resultParameterValues[ "NdosCantidadDeMeses" ] ); 
 
			// Si el contrato ya tiene importe, cctualiza el importe del Contrato
			if( this.get( "NdosImporteMensualContrato" ) > 0 ) {
				this.set( "NdosMontoContrato", this.get( "NdosImporteMensualContrato" ) * this.get( "NdosMesesDuracionContrato" ) );
				}
 
		} 
	}, this); 
} 

 

This is part of the error, console log

 
       POST https://XXXXXX.creatio.com/0/ServiceModel/ProcessEngineService.svc/RunProcess 400 (Bad Request)
 
all-combined.js?v=8.1.1.3635:41 Error al enviar solicitud 
	estado de respuesta: 400 (Bad Request)
	url de solicitud: ../ServiceModel/ProcessEngineService.svc/RunProcess

Some ideas? please help

 

regards,

 

Julio Falcón

Like 0

Like

3 comments
Best reply

Hi Julio,

 

Just guessing, is "NdosGrupoEconomico" a lookup? The parameter is named with an Id, so assuming it is. If that is the case, you need to get it's value, right now it's sending the entire object from the lookup. 

For example (note, the .value at the end): 

"NdosGrupoEconomicoID": this.get("NdosGrupoEconomico").value

However, if it's possible that the lookup can be blank, might be a good idea to check for that as well.

Ryan

Hi Julio,

 

Just guessing, is "NdosGrupoEconomico" a lookup? The parameter is named with an Id, so assuming it is. If that is the case, you need to get it's value, right now it's sending the entire object from the lookup. 

For example (note, the .value at the end): 

"NdosGrupoEconomicoID": this.get("NdosGrupoEconomico").value

However, if it's possible that the lookup can be blank, might be a good idea to check for that as well.

Ryan

Hello Julio,

 

Can you please share the RunProcess request body (from the network tab in the console)? We can compare it to the successful calls and see the difference. Additionally you need to check if both retrieved values (using this.get getters) are strings.

Ryan Farley,

Thanks Ryan, you are right. Fortunately I had already found my mistake... almost a beginner's mistake :-(

Show all comments