I was able to make it work using workflow....
But when I checked the workflows some of it failed.
I check the work flow and found an error: Invalid Argument
message: Incorrect attribute value type System.Int32
Error Message:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Incorrect attribute value type System.Int32Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220989</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Incorrect attribute value type System.Int32</Message>
<Timestamp>2018-04-04T07:16:59.3462734Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220989</ErrorCode>
<ErrorDetails xmlns:d3p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Incorrect attribute value type System.Int32</Message>
<Timestamp>2018-04-04T07:16:59.3462734Z</Timestamp>
<InnerFault>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d4p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>System.ArgumentException: Incorrect attribute value type System.Int32
Parameter name: msi_msiecsservicebranch</Message>
<Timestamp>2018-04-04T07:16:59.3462734Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<TraceText i:nil="true" />
</InnerFault>
<TraceText>[Microsoft.Xrm.Sdk.Workflow: Microsoft.Xrm.Sdk.Workflow.Activities.UpdateEntity]
[UpdateStep5]