Assigning a record owner to my online customer Booking Form

Hi guys

Love the product! I have one challenge - My customers access my custom booking object (via VisualForce) to make a booking. I allow them to select their Account from a picklist.

What I am trying to do, is set the ‘Record Owner’ of the Booking to be the Account Owner already assigned under the Account (not the current user that’s set for the page). I have tried setting as reference (MyCustomObject__c.OwnerId = Account__r.OwnerId) but no luck.

Could you tell me how I can achieve this?

Many thanks in advance.

Regards

Alex

Hey @Rob_Hatch

I have figured out how to do this now just manually allowing the user to select an account owner from a picklist. However, I am now facing an issue as follows:

‘insufficient access rights on cross-reference id’

After googling, it seems that it is a Salesforce error related to the following:

Scenario: When creating a record and attempting to assign it to a new user in the same call

Possible Cause: Create a record first, and in a separate call update the record with a new OwnerId.

How can I do this with Skuid - ie. Save the record and then update it after with a changed Owner?

Thank you

Alex

Is anyone able to assist me with this enquiry??

Hey @awebsterx ,

Sorry for the delay. Question, do your user have access to that record/object? it is possible it’s not visible because of its record type.

Thanks,

Hi @Germany

Yes the user has access to that user record. The issue is that Skuid complains trying to update the ownership of the record on save.

Regards

Alex

A couple things come to mind:

  1. Use a salesforce process or flow to update the record owner following save. This would bypass any permissions issues as you would run the process/flow as admin.

this would solve your problems if there was an issue with the user not having permission to assign an owner other than themselves to the record.

  1. in Skuid, you might be able to use a model action. You could set it to trigger based on model save and have it then update the record owner and re-save. You would have to put it in a branch though to only run the update if the owner is not the owner of the account otherwise it will create a never ending update loop.

based on your error, I’m not sure #2 will work, but I’m pretty sure #1 will.

Im still having trouble exposing the internal users in a picklist… Would it be because they are internal users of SF and the guest account is running Skuid?

As above, will only show the Guest User

Hey @awebsterx ,

What happened when you implemented #1 as @Skuidward_Tentacles said? Also, what are the internal user’s permissions set to?

Thanks,

Worked thank you. Used a workflow to update the user once record is created. Thanks for your help team!