Site users not able to create Work orders which have Work type with Skills Requirement/Product Required associated with them
Last updated 2021-02-16 ·Reference W-8037420 ·Reported By 12 users
Summary
Site users not able to create Work orders which have Work type with Skills associated with them
Actual Result :
Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception (Guest users cannot be record owners.): []
Expected Result :
WorkOrder record should get inserted without error.
Repro
1. Create an apex class with the following code
public class testFsl {
public void insertWO() {
WorkOrder wo = new WorkOrder();
wo.ContactId = 'contactID';
wo.WorkTypeId ='WorkTypeId';
system.debug('>>>>>>' + wo);
insert wo;
}
>> Make sure the WorkType recordId that you provide has at least 1 skill Requirement or product required.
2.Create a Visualforce page with the following code
<apex:page controller="testFsl" >
<apex:form >
<apex:commandButton value="testFsl" action="{!insertWO}" />
</apex:form>
</apex:page>
4.Create a Site that has this Visualforce page. Make sure the site has "Assign new records created by guest users to the default owner" checked and also provide Default owner in the Sites edit page.
5.Click on the testFSL button.
Workaround
Do not use the skills in Work type but rather link them to Work order through apex code
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.