Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i am tryiing to create a Document CALs Releaser service using the .NET SDK.
The code is running fine but the result is not like I expect it :-). No CAL get deleted or put in quarantine!
It is quite urgent 😕
Look the attached Example:
What is wrong in this implementation?
Code snippet:
for (int i = 0; i < allDocs.Length; i++)
{
//PAM: Get the meta data for the current document
Meta = Client.GetDocumentMetaData(allDocs, DocumentMetaDataScope.Licensing); //PAM: Extract the current list of Document CALs
List<AssignedNamedCAL> currentCALs = Meta.Licensing.AssignedCALs.ToList();
bool hasCALs = false;
for (int x = 0; x < currentCALs.Count; x++)
{
hasCALs = true;
list.Add(currentCALs
.UserName); //PAM: TODO => Logic Handle CAL's that are not used
currentCALs.Remove(currentCALs
); }
if (hasCALs) {
//Add the updated CALs list back to the meta data object
Meta.Licensing.AssignedCALs = currentCALs.ToArray();
//Save the ma back to the server
Client.SaveDocumentMetaData(Meta);
}
}
Debug:
QMC after => DIM Cal still available and allocated
Thanks for your feedback!
Guys i solved it!
It seems that the API changed with the new version.
RemovedAssignedCALs was added, so the removed CAL's should be assigned here and the the still valid one to AssignedCALs !!!
Meta.Licensing.AssignedCALs = currentCALs.ToArray();
Meta.Licensing.RemovedAssignedCALs = removedCALs.ToArray();
Guys i solved it!
It seems that the API changed with the new version.
RemovedAssignedCALs was added, so the removed CAL's should be assigned here and the the still valid one to AssignedCALs !!!
Meta.Licensing.AssignedCALs = currentCALs.ToArray();
Meta.Licensing.RemovedAssignedCALs = removedCALs.ToArray();
Hi patric.
Is it possible to unallocate Named CALs using the API ?
Thanks