cancel
Showing results for 
Search instead for 
Did you mean: 

User Object and Userfields

Former Member
0 Kudos

Hi,

I am playing around with the User Object, and I made an observation that I was hoping that maybe some of you gurus out there could shed some light on.

After I've loaded a User from the Database using GetByKey, I am able to manipulate various aspects of the User, such as name, email, phone number etc.

However, I wanted to see if I could lock or unlock a user using this object. I made the observation that there was no public member directly that could be used to control the lock status of a user. So I noticed the UserFields subclass in the User Object. However here I quickly realised that the "Locked" field was not loaded in there as well. It dawned on me, there are probably other fields not loaded into object, and if the problem exists in this Object, it may well exist in other types of business objects.

So I submit this question:

How can I manipulate fields of a given object if it is not loaded into it? (In this case the User Object). Is this a limitation that will be changed in the future or is it deliberate?

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Check out the help file for DI it has all the information of each and every object its properties etc.. it will be very helpful.

U can find the file at the following location.

C:\Program Files\SAP\SAP Business One SDK\Help\REFDI.chm

Vasu Natari.

Former Member
0 Kudos

I did. This was how I found out about the UserFields, but it's also here that I noticed that not all fields were loaded.

Former Member
0 Kudos

Hello Shahbaz Ahmed,

maybe I don't understand your question correctly (what do you mean with "not all fields were loaded"?)

You can access the UserFields of a SAP-Object as follows (e.g. BusinessPartner):

oBp.UserFields.Fields.Item("U_YOURUSERFIELD").Value = "L"

If Not oBp.Update = 0 Then

' GetLastError and so on...and exit

End If