When a users creates a record using a form (Manufacturers in my example), the CreatedBy field of the record in DataVerse table needs to show the Portal user, instead is says System. All the users for this site I am building are authenticated using Azure B2C and I really need to have that information.
This is really basic and I cannot get around it. I did try to get to the information of the logged in user with Javascript and it does not work. var userId = Xrm.Utility.getGlobalContext().userSettings.userId; will trigger an error saying Xrm is undefined. I did try to use the form additional setting feature "Associate Current Portal User on Insert ", this does not work as well. How do I get this to work? Thank you for your help. I do not have any Dynamics 365 app instance created for this portal, I do not need it for this project, only DataVerse.
My only workaround for now and it's pretty ugly is to use Liquid to define hidden fields on the footer or header snippet of the page and access them using JavaScript after. Then created a new field for CreatedBy and UpdatedBy and put these values there. I only use Azure B2C, no other method, all users need to be authenticated. Reproducing the basic functionality that already exists in this way is very time consuming. I hope it is a setting I might have overlooked.
Thank you for your input.
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43