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

Question

Question

Is there an equivalent of Field.GetInfo in LFSO?

SDK
asked on December 4, 2019

I'm using LFSO for a project and I'm trying to get a field definition so I can adjust it's properties and add it to a template. In RA, you have the command Field.GetInfo to get a field directly, as below.

FieldInfo fi = Field.GetInfo("Document", mySess);

I can't seem to find anything in LFSO that works the same way. The documentation only discusses getting a field definition after it's been assigned to a template. I can iterate through the collections produced by GetAllTemplateFields and GetAllUnassignedFields until I find the name of the field that I'm looking for, but I'm wondering if there's a more efficient way.

I'm not trying to get the data from a particular field on a particular document. Rather, I'm trying to change and add the field definition to a template definition.

0 0

Answer

SELECTED ANSWER
replied on December 4, 2019

Use LFDatabase.GetTemplateFieldByName:

// db is your LFDatabase object

LFTemplateField field = (LFTemplateField)db.GetTemplateFieldByName("MyField");

 

1 0

Replies

replied on December 4, 2019

Thank you. I just assumed that method required the field to be attached to a template. Should've probably tried it first.

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

Sign in to reply to this post.