Developer forum

Forum » Development » User index builder

User index builder

Mark Preisler
Reply


Hi

I'm having trouble with a UserIndexBuilder I'm trying to extend. I would like to get VatRegNumber included in my indexed, but when I call User.GetUsers () in the extender, I get the following error.

object reference not set to an instance of an object

   at Dynamicweb.Security.UserManagement.Common.CustomFields.CustomField.GetCustomFields()

   at Dynamicweb.Security.UserManagement.Common.CustomFields.CustomField.GetCustomFields(String tableName)

   at Dynamicweb.Security.UserManagement.Common.CustomFields.CustomFieldValue.GetCustomFieldValuesFromContainer(String tableName, Object container)

   at Dynamicweb.Security.UserManagement.User.Fill(IDataReader reader)

   at Dynamicweb.Security.UserManagement.User.GetUsers(CommandBuilder commandBuilder)

   at Smartpage.Indexing.UserIndexBuilderExtender.get_Users() in C:\Workspace\Dansk Bilglas\Main\Source\Smartpage.Indexing\UserIndexBuilderExtender.cs:line 24

   at Smartpage.Indexing.UserIndexBuilderExtender.ExtendDocument(IndexDocument indexDocument) in C:\Workspace\Dansk Bilglas\Main\Source\Smartpage.Indexing\UserIndexBuilderExtender.cs:line 49

   at Dynamicweb.Security.UserManagement.Indexing.UserIndexBuilder.WriteDoc(IndexDocument doc, Int64 currentAutoId)

   at Dynamicweb.Security.UserManagement.Indexing.UserIndexBuilder.ProcessUsers()

   at Dynamicweb.Security.UserManagement.Indexing.UserIndexBuilder.Build(IIndexWriter writer, Tracker tracker)


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply
This post has been marked as an answer

Hi Mark,

You might be able to get that field in the index without an Index Builder.

The filed is not available to add manually from the interface, but if you add it directly in the XML of the index it might work.

It does not solve the error you mention above but it might get you the filed in the index.

Adrian

Votes for this answer: 1
 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

You can add the field manually from the interface. Add a new index field and click on the plus sign next to source and enter "AccessUserVatRegNumber".

Best regards,
Morten

userindex_vatregnumber.png
Votes for this answer: 1
 
Mark Preisler
Reply

Thanks, that solved the problem with getting AccessUserVatRegNumber into the index.

 

You must be logged in to post in the forum