Thanks for your reply.
Could you please help me with the code below. I am getting error on the line highlighted in red, Idpair and GetLifeCycleStateIdsByFileMasterIds were in the namespace for Vault 2014 but no longer exist in Vault 2017. what would be the replacement for this code. TIA
public void ChangeState(List<long> selectedMasterFileIds, string projectValue, long releaseState)
{
try
{
List<File> updatedFileIds = new List<File>();
List<long> filesWithNoOrDifferentLifecycle = new List<long>();
List<long> filesWithBasicLifecycle = new List<long>();
IdPair[] states = util.DocSvcExt.GetLifeCycleStateIdsByFileMasterIds(selectedMasterFileIds.ToArray());
foreach (IdPair idpair in states)
{
if (util.FileLifeCycleStateMap().ContainsKey(idpair.ValId))
{
filesWithBasicLifecycle.Add(idpair.EntityId);
}
else
{
filesWithNoOrDifferentLifecycle.Add(idpair.EntityId);
}
}
long[] lifecycleStateIds = new long[filesWithNoOrDifferentLifecycle.Count];
long[] lifecycleDefinitionIds = new long[filesWithNoOrDifferentLifecycle.Count];
File[] newVersions = new File[0];
File[] moreNewVersions = new File[0];
if (filesWithNoOrDifferentLifecycle.Count > 0)
{
#region updating files that don't have a lifecycle definition or have a different one from the basic
for (int z = 0; z < lifecycleStateIds.Length; z++)
{
lifecycleStateIds[z] = releaseState;
lifecycleDefinitionIds[z] = util.FileLifeCycleDefinitionMap()["Project Design Lifecycle"].Id;
}
newVersions = util.DocSvcExt.UpdateFileLifeCycleDefinitions(filesWithNoOrDifferentLifecycle.ToArray(), lifecycleDefinitionIds, lifecycleStateIds, projectValue);
#endregion
}
if (filesWithBasicLifecycle.Count > 0)
{
#region updating files that already belong to the basic lifecycle definition or have a different one from the basic
lifecycleStateIds = new long[filesWithBasicLifecycle.Count];
for (int z = 0; z < lifecycleStateIds.Length; z++)
{
lifecycleStateIds[z] = releaseState;
}
moreNewVersions = util.DocSvcExt.UpdateFileLifeCycleStates(filesWithBasicLifecycle.ToArray(), lifecycleStateIds, projectValue);
#endregion
}
}
}