I'm using the CDS and custom tables: Customers and Sites.
Sites has a lookup column to Customers and I am having issues patching a record to Sites that references Customers.
Screenshot 1: The form. All fields are directly included in the Patch function on the Save button
Screenshot 2: The ComboBox for Customer has Items set to Customers.Name
The OnSelect of the Save button is set to (line generating error bolded):
Patch(
Sites,
Defaults(
Sites
),
{
Name: Concatenate(SiteStreetTextInput.Text, ", ", SiteCityTextInput.Text, ", ", SitePostalTextInput.Text),
'Street Address': SiteStreetTextInput.Text,
City: SiteCityTextInput.Text,
'Postal Code':SitePostalTextInput.Text,
Customer: SiteCustomerComboBox.Selected
}
);
Screenshot 3: Error text
I am vaguely familiar with polymorphic lookups (IsType/AsType) but unable to mentally wrap my head around what I need to do in this situation.
Greg