I'm trying to create with a workflow Laserfiche User in LFDS and assign them a Participant licenses.
Any one has a sample code that I can use and expand to accomplish this?
Thanks,
Pedro
I'm trying to create with a workflow Laserfiche User in LFDS and assign them a Participant licenses.
Any one has a sample code that I can use and expand to accomplish this?
Thanks,
Pedro
Hi Pedro,
Participant licenses are a type of restricted license that does not have a fixed GUID. The easiest way to assign this license is to open your primary license file and find the GUID associated with the Participant license. Then you can use the LFDS SDK code example below, replacing the placeholder GUID with the one you see in the primary license.
LaserficheUser lfUser = LaserficheUser.Create(db); lfUser.Name = "exampleName"; lfUser.Password = "examplePassword"; lfUser.ContainerID = db.GetRootContainer().ID; // Set their organization to Root Guid participantLicense = new Guid("{00000000-0000-0000-0000-000000000000}"); lfUser.Licenses = new Guid[] { participantLicense }; lfUser.Register();
Hi Chase,
I have a couple of questions, sorry for my lack of knowledge:
1. How I can add the group that the users will belong to? like lfUser.Group = "Onboarding"; ?
2. When you mentioned the primary License Key, that is LF Forms? when the system activates the LFDS, there is no lf.licx created on LFDS
3. I copied your code to a Csharp script but received 2 errors: Invalid expression term '=' and ; expected. Those errors are in the line of Guid participantLicense = =.
Note for #1: if you don't have the group object handy and want to look for it by name, you can create a method that looks up a group by name like this
foreach (Group group in db.GetAllGroups()) { if (group.Name == "myGroup") return group; }
I have a question: How can I get the SIDString of an already existing LFDS user account (not a Windows user account)?
When I try to create an LFDS user account and it reports the object already exists, then I try to add this account to a group where I pass the SIDString of this user account, I get an exception: Value cannot be null.
Parameter name: key