| « Creating Objects in JScript | Hiding button on a form in CRM 4.0 » |
Hiding fields in CRM and getting the userid in jscript
I was looking around the trying to figure out how to get the id of the current user when working with the CRM WebServices through JScript or Javascript and I came across this article. It didnt really give me the solution I was hoping for but it did show me how to hide a field which I didn't know how to do. And he even had a whole little post on that as well here.
What I think is a better solution for getting the userid using javascript can be found here. It's still a lot of overhead but it doesn't making an unsupported customization to CRM.
I was working on the same thing today and found that there is even a better solution then the one above in the CRM 4.0 SDK. There is a message called WhoAmI that Responds with the calling user's BusinessUnitId, OrganizationId, and UserId. The XML for the request is... <Request xsi:type="WhoAmIRequest" />
Helpful details can be found in the SDK.