Hi @hi , this error occurs when you try to call SetLabel() with a labelId that does not have an associated templateId. The label requires ad-hoc protection, but protection has not yet been set. To resolve this error, you need to call FileHandler::SetProtection with ad-hoc protection settings before calling FileHandler::SetLabel. This will associate a templateId with the labelId and allow you to set the label successfully. Please let me know if you have any questions and I can help you further. If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James