Hi,
I am trying to update the ‘Ends on’ column in the IAM under period group, to stop the user from logging in the application.
The postman API when tested for this works as expected :
sending the url with format: {iam_link}iam/iam/usr(tenant_id={tenant_id}, usr_id='{email_id}')
Process flow :
subflow :
input for the HTTP connector :
The update iam parameter updates the process parameter for the http connector : email_id and tenant_id
The update job_details updates the SF db columns.
Please note that the SF DB columns are getting updated correctly, however the IAM DB for end_on date is not.
Below is the code for update_iam_parameter control procedure :
set @email_id = null select top 1 @email_id = ed.email_id, @tenant_id = ed.tenant_id, @current_date = (select CONVERT(VARCHAR,GETDATE(),120) ) from resignation r join employee_detail ed on ed.employee_detail_id = r.employee_detail_id where r.last_working_day = CONVERT(DATE, GETDATE()) and r.inactive_in_iam is null if @email_id <> null begin set @update_iam_parameter_iam_update = 1 --action will be executed. set @update_iam_parameter_stop = 0 end else begin set @update_iam_parameter_stop = 1 end
Below is the code to update the columns in SF DB :
/* to update the deactivate field as 1*/ UPDATE job_detail SET employee_status = 1 FROM job_detail jd JOIN employee_detail ed ON jd.employee_detail_id = ed.employee_detail_id WHERE ed.email_id = @email_id update resignation -- updating the resignation after the user is disabled in IAM set inactive_in_iam = 0 from resignation r join employee_detail edON ed.employee_detail_id = r.employee_detail_id WHERE ed.email_id = @email_id
I am getting below error in the log :
2023-03-14T15:15:00.8242996+00:00 1ERR] Error in process procedure of process action "iam_update" in process flow "employee_last_working_date" of application 4. (b2ae20de)
2023-03-14T15:15:00.8270264+00:00 :ERR] Process action "execute_sub_flow_employee_last_working_date" in processflow "employee_last_day_system_flow" in application 4 threw an exception. (571360e4)
Indicium.Shared.TSF.FatalDbException (0x80004005): The following query failed with an exception: 'prc_employee_last_working_date_iam_update'
---> Microsoft.Data.SqlClient.SqlException (0x80131904): Procedure or function prc_employee_last_working_date_iam_update has too many arguments specified.
at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at Microsoft.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at Microsoft.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader(Boolean isInternal, Boolean forDescribeParameterEncryption)
at Microsoft.Data.SqlClient.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, Boolean isInternal, String endMethod)
at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location ---
Please help what I am missing?