//Add Data from above collection into the Dataverse Timesheet Table
Patch(
Timesheet,
Defaults(Timesheet),
{
//included fields from the form
Timesheet_WeekStartDate_ID: ddTSStartDate.Selected.crb01_dateid,
Timesheet_StartDate: DateValue(ddTSStartDate.Selected.WeekStartDate),
Resource_Name: ddEmployeeSelection.Selected.'Last Name, First Name',
Resource_ID: ddEmployeeSelection.Selected.'Network ID',
Resource_Email: ddEmployeeSelection.Selected.Email,
Resource_ManagerName: ddEmployeeSelection.Selected.Manager,
Timesheet_Approval_ApproverName: ddEmployeeSelection.Selected.Manager,
Resource_CostCenter: ddEmployeeSelection.Selected.'Home Cost Center',
Resource_Vendor: ddEmployeeSelection.Selected.Vendor,
Resource_Role: ddEmployeeSelection.Selected.Role.Value,
//custom fields with static values relating to timesheet processing
Resource_Rate: 50.00,
Resource_Type: ddEmployeeSelection.Selected.'Resource Type'
}
);
I have attempted the line using:
- Resource_Type: ddEmployeeSelection.Selected.'Resource Type'
- Resource_Type: {Value: ddEmployeeSelection.Selected.'Resource Type'}
The first one indicates that OptionSetValue is expected and type is text. The second indicates OptionSetValue is expected and type is record.
Here is the field, from the Timesheet table, it needs to patch to, for reference. I have external values for the options also set to Contractor and Employee respectively.