Hi all,
I have a Dynamics 365 instance with a custom entity. I want to create a PowerApps form that patches to the entity. The entity contains a look field named "Team" that links to the "System Teams" entity. There's also another lookup field that links with "Account". Below is my code:
ClearCollect(
Submission,
{
BSC_Name : Name.Text,
BSC_Customer : SelectedAccount.Account,
BSC_Background : Background.Text,
BSC_Scope : Scope.Text,
BSC_ExpectedCloseDate : Deadline.SelectedDate,
BSC_RaisedBy : Value(Department.Selected.ID),
BSC_SuggestedTeam : Team.Selected.'System Teams'
}
);
Set(LocalSubmission, First(Submission));
Set(TeamRecord, LookUp('System Teams', 'System Teams' = LocalSubmission.BSC_SuggestedTeam));
Patch(
'Records',
Defaults('Records'),
{
Name : LocalSubmission.BSC_BluespaceName,
testexc_bluespacename : LocalSubmission.BSC_Name, //Legacy Field
Customer : GUID(LocalSubmission.BSC_Customer),
'Opportunity Background (Include contact name)' : LocalSubmission.BSC_Background, //Legacy Field
Background : LocalSubmission.BSC_Background,
testexc_opportunitydescription : LocalSubmission.BSC_Scope, //Legacy Field
Scope : LocalSubmission.BSC_Scope,
testexc_estclosedate : LocalSubmission.BSC_ExpectedCloseDate,
testexc_departmentraisedby : LocalSubmission.BSC_RaisedBy, //Legacy Field
testexc_destinationteam : TeamRecord
}
);
Navigate(Complete,ScreenTransition.None)It appears that if I exclude "testexc_destinationteam : TeamRecord" everything works okay. If I configure in the same form as the "Account" entry it states a record is expected not a GUID. If I keep it like the above it states that a value must be provided for item.
Does anyone have any idea why this is happening?
Thanks,
J