You are viewing limited content. For full access, please sign in.

Question

Question

Create user in LFDS with Forms Participant Licenses

asked on May 26, 2022

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

0 0

Replies

replied on May 31, 2022 Show version history

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();

 

0 0
replied on May 31, 2022

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 = =. 

 

0 0
replied on May 31, 2022 Show version history
  1. You can do so like this: myGroup.SetMembers(new List<string>() { lfUser.SIDString });
    1. See below if you need help getting myGroup
  2. When you activate LFDS you have the option to receive the primary license file that was used. If you don't have it, you can grab it by running this query on your LFDS database: SELECT CAST(license AS XML) FROM [yourDBname].[dbo].[master_license]
  3. My apologies, I made a typo on that line. There should only be one "=" as we're setting the value of 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;
}

 

0 0
replied on November 29, 2022

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

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.