verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
94 stars 70 forks source link

Microsoft Dynamics 365 CRM: Invalid property (Does not support untyped value in non-open type) #1251

Closed jamesmacwhite closed 1 year ago

jamesmacwhite commented 1 year ago

Describe the bug

The following error occurred when attempting to create a contact on a form that has the Microsoft Dynamics 365 CRM integration enabled on the contact entity.

For context, this field is set to ApplicationRequired and is a Picklist with "Required" and "Not Required" values, in the mapping, "Not required" is selected.

API error: “{"error":{"code":"0x80048d19","message":"Error identified in Payload provided by the user for Entity :'contacts', For more information on this error please follow this help link https://go.microsoft.com/fwlink/?linkid=2195293 ----> InnerException : Microsoft.Crm.CrmException: Invalid property 'ccl3016_NextofKinRequired' was found in entity 'Microsoft.Dynamics.CRM.contact'. ---> Microsoft.OData.ODataException: Does not support untyped value in non-open type.\r\n at System.Web.OData.Formatter.Deserialization.DeserializationHelpers.ApplyProperty(ODataProperty property, IEdmStructuredTypeReference resourceType, Object resource, ODataDeserializerProvider deserializerProvider, ODataDeserializerContext readContext)\r\n at Microsoft.Crm.Extensibility.CrmODataEntityDeserializer.ApplyStructuralProperty(Object resource, ODataProperty structuralProperty, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n --- End of inner exception stack trace ---\r\n at Microsoft.Crm.Extensibility.CrmODataEntityDeserializer.ApplyStructuralProperty(Object resource, ODataProperty structuralProperty, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ApplyStructuralProperties(Object resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n at Microsoft.Crm.Extensibility.CrmODataEntityDeserializer.ApplyStructuralProperties(Object resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ReadResource(ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)."}}” /var/www/html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113

The field definition for the mentioned field in the stacktrace is:

{
    "@odata.type": "#Microsoft.Dynamics.CRM.PicklistAttributeMetadata",
    "AttributeType": "Picklist",
    "IsCustomAttribute": true,
    "IsValidForCreate": true,
    "IsValidForUpdate": true,
    "CanBeSecuredForCreate": true,
    "CanBeSecuredForUpdate": true,
    "LogicalName": "ccl3016_nextofkinrequired",
    "SchemaName": "ccl3016_NextofKinRequired",
    "MetadataId": "e6f53ef1-13f4-4f2c-b4e6-1b9b3c50d175",
    "DisplayName": {
        "LocalizedLabels": [
            {
                "Label": "Next of Kin Required?",
                "LanguageCode": 1033,
                "IsManaged": true,
                "MetadataId": "a4b2170b-efc4-46f5-a2ee-52e08e5133cf",
                "HasChanged": null
            }
        ],
        "UserLocalizedLabel": {
            "Label": "Next of Kin Required?",
            "LanguageCode": 1033,
            "IsManaged": true,
            "MetadataId": "a4b2170b-efc4-46f5-a2ee-52e08e5133cf",
            "HasChanged": null
        }
    },
    "RequiredLevel": {
        "Value": "ApplicationRequired",
        "CanBeChanged": true,
        "ManagedPropertyLogicalName": "canmodifyrequirementlevelsettings"
    }
}

Steps to reproduce

  1. Enable Microsoft Dynamics 365 CRM integration and enable contact mapping
  2. The following API error occurs on attempting to create a contact

Form settings

N/A

Craft CMS version

3.7.63.1

Plugin version

1.6.21 (dev-craft-3)

Multi-site?

No

Additional context

No response

jamesmacwhite commented 1 year ago

This would appear to be a casing issue with the field name. The logical name works, the schema name doesn't.

This returns valid data from the API:

/api/data/v9.0/contacts?$select=ccl3016_nextofkinrequired

The current request I think which is failing:

/api/data/v9.0/contacts?$select=ccl3016_NextofKinRequired

{"error":{"code":"0x0","message":"Could not find a property named 'ccl3016_NextofKinRequired' on type 'Microsoft.Dynamics.CRM.contact'."}}

jamesmacwhite commented 1 year ago

Wonder if the conditional here, is the issue: https://github.com/verbb/formie/blob/craft-3/src/integrations/crm/MicrosoftDynamics365.php#L456-L461.

It would appear the logical name is needed not the schema name

https://learn.microsoft.com/en-gb/troubleshoot/power-platform/power-apps/dataverse-web-api/web-api-client-errors#invalid-property-property-name-was-found-in-entity-microsoftdynamicscrmentity-name

engram-design commented 1 year ago

As you've referenced in https://github.com/verbb/formie/issues/1071 it's all a bit of a mystery to me! I'm not exactly sure how to handle that if there's no definitive rule to what should use what.

I'll have to do some more testing with different field types.

jamesmacwhite commented 1 year ago

I can dump the full metadata of our fields to understand if there's other casing difference on custom fields. Seems to be possible through:

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/web-api-service-documents#csdl-metadata-document.

https://yourorg.api.crm.dynamics.com/api/data/v9.2/$metadata

jamesmacwhite commented 1 year ago

Looking at the CSDL metadata for the environment I'm testing, all the property names are lowercase and look like the logical name values.

jamesmacwhite commented 1 year ago

This is what the EntityType data looks like. It would be interesting if the original issue reporter on #1071 could look at their fields under CSDL, as based on the docs it suggests whatever the Name values are on the property, that is what must be used.

If I remove the conditions to switch between SchemaName and LogicalName and just set as LogicalName, it works. I get a different error but that's now something specific to our environment related to prvReadContact privilege

<EntityType Name="contact" BaseType="mscrm.crmbaseentity">
              <Key>
                  <PropertyRef Name="contactid" />
              </Key>
              <Property Name="esc_engagementscore" Type="Edm.Int32" />
              <Property Name="address1_line2" Type="Edm.String" Unicode="false" />
              <Property Name="yomimiddlename" Type="Edm.String" Unicode="false" />
              <Property Name="nc_createdbyfromcrm2013" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_polarquintile" Type="Edm.Int32" />
              <Property Name="_preferredequipmentid_value" Type="Edm.Guid" />
              <Property Name="ccl3016_englishforskill" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_appointmentsnotattended_date" Type="Edm.DateTimeOffset" />
              <Property Name="ccl3044_contactcode" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_receivecopyofapplicationcommunication" Type="Edm.Boolean" />
              <Property Name="address3_fax" Type="Edm.String" Unicode="false" />
              <Property Name="nc_childrecordslastmodifiedon" Type="Edm.DateTimeOffset" />
              <Property Name="creditlimit" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="address2_addresstypecode" Type="Edm.Int32" />
              <Property Name="_ccl1000_alumnirecordedaslostby_value" Type="Edm.Guid" />
              <Property Name="ccl1000_cvlastupdated" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1000_studentnumber" Type="Edm.String" Unicode="false" />
              <Property Name="_transactioncurrencyid_value" Type="Edm.Guid" />
              <Property Name="_mshied_currentacademicperiodid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_passportnumber" Type="Edm.String" Unicode="false" />
              <Property Name="_slaid_value" Type="Edm.Guid" />
              <Property Name="msdyn_portaltermsagreementdate" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1000_sjrequestedprospectus" Type="Edm.Boolean" />
              <Property Name="address2_telephone3" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_alumnidiscounts" Type="Edm.Boolean" />
              <Property Name="business2" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_hourlyrate_base" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="address2_county" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_heatstudent" Type="Edm.Boolean" />
              <Property Name="address1_telephone2" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_sjapplicationyearid_value" Type="Edm.Guid" />
              <Property Name="ccl3072_refugee" Type="Edm.Int32" />
              <Property Name="_ccl2002_currentjobpositionid_value" Type="Edm.Guid" />
              <Property Name="customersizecode" Type="Edm.Int32" />
              <Property Name="_parent_contactid_value" Type="Edm.Guid" />
              <Property Name="_ccl3016_assistant_value" Type="Edm.Guid" />
              <Property Name="adx_identity_securitystamp" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_lawfulbasislegit" Type="Edm.Boolean" />
              <Property Name="ccl1007_relationshiptoyou" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_tier4" Type="Edm.Boolean" />
              <Property Name="ccl1000_datereceived" Type="Edm.DateTimeOffset" />
              <Property Name="adx_profileisanonymous" Type="Edm.Boolean" />
              <Property Name="employeeid" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3016_criminalconviction" Type="Edm.Boolean" />
              <Property Name="ccl1000_recruitmenttype" Type="Edm.Int32" />
              <Property Name="ccl3072_parentattenduni" Type="Edm.Int32" />
              <Property Name="ccl1007_source" Type="Edm.Int32" />
              <Property Name="address2_country" Type="Edm.String" Unicode="false" />
              <Property Name="educationcode" Type="Edm.Int32" />
              <Property Name="mshied_ethnicgroup" Type="Edm.Int32" />
              <Property Name="adx_timezone" Type="Edm.Int32" />
              <Property Name="ccl1000_currentyearofstudy" Type="Edm.Int32" />
              <Property Name="pager" Type="Edm.String" Unicode="false" />
              <Property Name="nc_studentcoursedescription" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1002_favouriteeventids" Type="Edm.String" Unicode="false" />
              <Property Name="address3_latitude" Type="Edm.Double" />
              <Property Name="company" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_isintegrated" Type="Edm.Boolean" />
              <Property Name="managername" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_westernnameformat" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_nationalityid_value" Type="Edm.Guid" />
              <Property Name="address3_longitude" Type="Edm.Double" />
              <Property Name="gendercode" Type="Edm.Int32" />
              <Property Name="adx_identity_accessfailedcount" Type="Edm.Int32" />
              <Property Name="territorycode" Type="Edm.Int32" />
              <Property Name="_ccl1000_country_value" Type="Edm.Guid" />
              <Property Name="_msa_managingpartnerid_value" Type="Edm.Guid" />
              <Property Name="ccl3072_hesafound" Type="Edm.Int32" />
              <Property Name="ccl1007_previoussurname" Type="Edm.String" Unicode="false" />
              <Property Name="esc_scorelabel" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_alumnireactivateddate" Type="Edm.DateTimeOffset" />
              <Property Name="managerphone" Type="Edm.String" Unicode="false" />
              <Property Name="_parentcontactid_value" Type="Edm.Guid" />
              <Property Name="department" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_countryid_value" Type="Edm.Guid" />
              <Property Name="_ccl1000_sjapplicantdayyearid_value" Type="Edm.Guid" />
              <Property Name="ccl1007_authoriseactonbehalf" Type="Edm.Boolean" />
              <Property Name="ccl1000_sjenrolled" Type="Edm.Boolean" />
              <Property Name="_createdbyexternalparty_value" Type="Edm.Guid" />
              <Property Name="ccl3072_servicechild" Type="Edm.Int32" />
              <Property Name="_originatingleadid_value" Type="Edm.Guid" />
              <Property Name="telephone2" Type="Edm.String" Unicode="false" />
              <Property Name="_msdyn_segmentid_value" Type="Edm.Guid" />
              <Property Name="address1_freighttermscode" Type="Edm.Int32" />
              <Property Name="new_uniqueidcontactexport" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_appointmentsattended" Type="Edm.Int32" />
              <Property Name="mshied_lastpermanentresidencecountry" Type="Edm.Int32" />
              <Property Name="ccl3016_sourceid" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3016_mathsforskill" Type="Edm.String" Unicode="false" />
              <Property Name="annualincome_base" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="_ccl3016_council_value" Type="Edm.Guid" />
              <Property Name="emailaddress3" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_graduationyear" Type="Edm.String" Unicode="false" />
              <Property Name="esc_optintype" Type="Edm.String" Unicode="false" />
              <Property Name="nc_otherdisabilityorleaningsupportneed" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_previousinstitutionid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_sjmadeenquiry" Type="Edm.Boolean" />
              <Property Name="ccl1000_isdisabledstudent" Type="Edm.Boolean" />
              <Property Name="_ccl1000_disabilitytwoid_value" Type="Edm.Guid" />
              <Property Name="esc_overallscore" Type="Edm.Int32" />
              <Property Name="nc_esigtest" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_lawfulbasispublic" Type="Edm.Boolean" />
              <Property Name="mshied_ferpaprivacy" Type="Edm.Boolean" />
              <Property Name="_ccl1000_lastactivitybyid_value" Type="Edm.Guid" />
              <Property Name="yomifirstname" Type="Edm.String" Unicode="false" />
              <Property Name="adx_identity_logonenabled" Type="Edm.Boolean" />
              <Property Name="ccl1000_closedcaseslast3months" Type="Edm.Int32" />
              <Property Name="nc_unspentcriminalconvictions" Type="Edm.Boolean" />
              <Property Name="ccl3072_highereducationinstitution" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_closedcasesall" Type="Edm.Int32" />
              <Property Name="address3_county" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_schoolid_value" Type="Edm.Guid" />
              <Property Name="_ccl1007_countryofpermanentresidenceid_value" Type="Edm.Guid" />
              <Property Name="address3_composite" Type="Edm.String" Unicode="false" />
              <Property Name="_nc_invitation_value" Type="Edm.Guid" />
              <Property Name="nc_portalinvitationcodetemporary" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_sjenrolmentyearid_value" Type="Edm.Guid" />
              <Property Name="ccl3072_careleaver" Type="Edm.Boolean" />
              <Property Name="ccl1000_originalfirstname" Type="Edm.String" Unicode="false" />
              <Property Name="entityimage_timestamp" Type="Edm.Int64" />
              <Property Name="callback" Type="Edm.String" Unicode="false" />
              <Property Name="_nc_disability_value" Type="Edm.Guid" />
              <Property Name="ccl3072_idaciquintile" Type="Edm.Int32" />
              <Property Name="home2" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_countryofnationalityid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_availabilitydate" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_resetusername" Type="Edm.Boolean" />
              <Property Name="ccl1000_offermade" Type="Edm.Boolean" />
              <Property Name="ccl3072_permissiontotrack" Type="Edm.Int32" />
              <Property Name="birthdate" Type="Edm.Date" />
              <Property Name="_modifiedbyexternalparty_value" Type="Edm.Guid" />
              <Property Name="ccl3072_consentfuturecontact" Type="Edm.Int32" />
              <Property Name="_ccl1000_sitelocalofficeid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_regionofdomicile" Type="Edm.Int32" />
              <Property Name="nc_hopper" Type="Edm.Int32" />
              <Property Name="msdyn_gdproptout" Type="Edm.Boolean" />
              <Property Name="address2_upszone" Type="Edm.String" Unicode="false" />
              <Property Name="address3_freighttermscode" Type="Edm.Int32" />
              <Property Name="processid" Type="Edm.Guid" />
              <Property Name="nc_optintype" Type="Edm.String" Unicode="false" />
              <Property Name="address1_fax" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_agegroup" Type="Edm.Int32" />
              <Property Name="ccl1007_expirationdate" Type="Edm.DateTimeOffset" />
              <Property Name="_nc_invitationredeemedcontact_value" Type="Edm.Guid" />
              <Property Name="_owningteam_value" Type="Edm.Guid" />
              <Property Name="accountrolecode" Type="Edm.Int32" />
              <Property Name="suffix" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_guestpanel" Type="Edm.Boolean" />
              <Property Name="msdyn_disablewebtracking" Type="Edm.Boolean" />
              <Property Name="aging60" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="ccl1000_opendayregisteredon" Type="Edm.DateTimeOffset" />
              <Property Name="_ccl1007_ptfaculty_value" Type="Edm.Guid" />
              <Property Name="_createdby_value" Type="Edm.Guid" />
              <Property Name="mshied_nationalidentifier" Type="Edm.String" Unicode="false" />
              <Property Name="address1_longitude" Type="Edm.Double" />
              <Property Name="_ccl1007_tribalconversation_value" Type="Edm.Guid" />
              <Property Name="ccl1000_postgraduatestudy" Type="Edm.Boolean" />
              <Property Name="ccl3072_heprogrammelevel" Type="Edm.String" Unicode="false" />
              <Property Name="address1_utcoffset" Type="Edm.Int32" />
              <Property Name="_ccl1000_scholarshipflag_value" Type="Edm.Guid" />
              <Property Name="ccl1000_username" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_detailsofcondition" Type="Edm.String" Unicode="false" />
              <Property Name="nc_invitationredemptiondate" Type="Edm.DateTimeOffset" />
              <Property Name="adx_identity_username" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_applicantstatus" Type="Edm.Int32" />
              <Property Name="ccl1000_opencases" Type="Edm.Int32" />
              <Property Name="_slainvokedid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_dateofgraduation" Type="Edm.DateTimeOffset" />
              <Property Name="address3_stateorprovince" Type="Edm.String" Unicode="false" />
              <Property Name="preferredcontactmethodcode" Type="Edm.Int32" />
              <Property Name="_ccl1000_offermadeyear_value" Type="Edm.Guid" />
              <Property Name="ccl1000_hascvcontent" Type="Edm.Boolean" />
              <Property Name="anniversary" Type="Edm.Date" />
              <Property Name="nc_iagfilingtosharepoint" Type="Edm.Int32" />
              <Property Name="address1_latitude" Type="Edm.Double" />
              <Property Name="nc_invitationdatesent" Type="Edm.DateTimeOffset" />
              <Property Name="address1_primarycontactname" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_candidatestarrating" Type="Edm.Int32" />
              <Property Name="new_deactivateme" Type="Edm.Boolean" />
              <Property Name="nc_invitationstatus" Type="Edm.Int32" />
              <Property Name="isbackofficecustomer" Type="Edm.Boolean" />
              <Property Name="ccl1000_ucaspersonalid" Type="Edm.String" Unicode="false" />
              <Property Name="marketingonly" Type="Edm.Boolean" />
              <Property Name="_ccl1007_fundraisingintelligenceid_value" Type="Edm.Guid" />
              <Property Name="adx_identity_lockoutenddate" Type="Edm.DateTimeOffset" />
              <Property Name="address3_utcoffset" Type="Edm.Int32" />
              <Property Name="creditonhold" Type="Edm.Boolean" />
              <Property Name="address2_line1" Type="Edm.String" Unicode="false" />
              <Property Name="paymenttermscode" Type="Edm.Int32" />
              <Property Name="ccl3016_owntransport" Type="Edm.Boolean" />
              <Property Name="ccl1007_volunteer" Type="Edm.Boolean" />
              <Property Name="ccl3072_fsmbursary" Type="Edm.Int32" />
              <Property Name="ccl1000_sjapplicationdate" Type="Edm.DateTimeOffset" />
              <Property Name="address2_utcoffset" Type="Edm.Int32" />
              <Property Name="familystatuscode" Type="Edm.Int32" />
              <Property Name="_ccl1000_otherdisabilityid_value" Type="Edm.Guid" />
              <Property Name="ccl3072_estquintile" Type="Edm.Int32" />
              <Property Name="ccl3046_ethnicitytype" Type="Edm.Int32" />
              <Property Name="preferredappointmentdaycode" Type="Edm.Int32" />
              <Property Name="_ccl1000_country2_value" Type="Edm.Guid" />
              <Property Name="ccl1000_closedcasesacademicyear" Type="Edm.Int32" />
              <Property Name="donotphone" Type="Edm.Boolean" />
              <Property Name="ccl3072_consentmethod" Type="Edm.Int32" />
              <Property Name="ccl1007_instagramurl" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_internalcvdocumentlocation" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_registeredforapplicantday" Type="Edm.Boolean" />
              <Property Name="ccl3072_lawfulbasisconsent" Type="Edm.Boolean" />
              <Property Name="ccl1007_noofapplications" Type="Edm.Int32" />
              <Property Name="ccl1000_dpaauthorisationgiven" Type="Edm.Boolean" />
              <Property Name="ccl1000_copytoemail" Type="Edm.String" Unicode="false" />
              <Property Name="preferredappointmenttimecode" Type="Edm.Int32" />
              <Property Name="address2_city" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_approvedetailstobeshared" Type="Edm.Boolean" />
              <Property Name="modifiedon" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_nooutstandingactions_date" Type="Edm.DateTimeOffset" />
              <Property Name="adx_createdbyipaddress" Type="Edm.String" Unicode="false" />
              <Property Name="_masterid_value" Type="Edm.Guid" />
              <Property Name="adx_identity_locallogindisabled" Type="Edm.Boolean" />
              <Property Name="entityimage_url" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_assigncounsellorid_value" Type="Edm.Guid" />
              <Property Name="ccl1007_noofapplications_date" Type="Edm.DateTimeOffset" />
              <Property Name="address2_telephone2" Type="Edm.String" Unicode="false" />
              <Property Name="adx_identity_mobilephoneconfirmed" Type="Edm.Boolean" />
              <Property Name="ccl1000_availability" Type="Edm.Int32" />
              <Property Name="utcconversiontimezonecode" Type="Edm.Int32" />
              <Property Name="ccl1000_defaultemailsend" Type="Edm.Int32" />
              <Property Name="ccl1000_age" Type="Edm.Int32" />
              <Property Name="address1_telephone3" Type="Edm.String" Unicode="false" />
              <Property Name="new_keepordeactivate" Type="Edm.Boolean" />
              <Property Name="ccl3007_internationalcontact" Type="Edm.Boolean" />
              <Property Name="firstname" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_race_" Type="Edm.String" Unicode="false" />
              <Property Name="address1_name" Type="Edm.String" Unicode="false" />
              <Property Name="businesscardattributes" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_contactpremissiondate" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_nameofauthorisedperson" Type="Edm.String" Unicode="false" />
              <Property Name="address3_postalcode" Type="Edm.String" Unicode="false" />
              <Property Name="_ownerid_value" Type="Edm.Guid" />
              <Property Name="ccl1007_countryofbirthsameasnationality" Type="Edm.Boolean" />
              <Property Name="mshied_contacttype" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_portal_status" Type="Edm.Int32" />
              <Property Name="ccl1007_twitterurl" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_cvcontent" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_sjapplied" Type="Edm.Boolean" />
              <Property Name="address1_stateorprovince" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_noofapplications_state" Type="Edm.Int32" />
              <Property Name="_mshied_advisorid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_drivinglicensetype" Type="Edm.Int32" />
              <Property Name="ccl1007_appointmentsattended_state" Type="Edm.Int32" />
              <Property Name="assistantname" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3046_caredby" Type="Edm.Int32" />
              <Property Name="ccl1000_sjinterviewdate" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_documentapprovalnotifications" Type="Edm.Boolean" />
              <Property Name="nc_studentplannedstarttime" Type="Edm.String" Unicode="false" />
              <Property Name="address1_city" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_salary" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_heatid" Type="Edm.String" Unicode="false" />
              <Property Name="traversedpath" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_homeoverseasflag" Type="Edm.Boolean" />
              <Property Name="ccl1000_offeraccepted" Type="Edm.Boolean" />
              <Property Name="creditlimit_base" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="adx_profilealert" Type="Edm.Boolean" />
              <Property Name="ccl1000_careersadvice" Type="Edm.Boolean" />
              <Property Name="address2_freighttermscode" Type="Edm.Int32" />
              <Property Name="businesscard" Type="Edm.String" Unicode="false" />
              <Property Name="annualincome" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="description" Type="Edm.String" Unicode="false" />
              <Property Name="entityimage" Type="Edm.Binary" />
              <Property Name="esc_latestscoreevaluation" Type="Edm.DateTimeOffset" />
              <Property Name="adx_identity_twofactorenabled" Type="Edm.Boolean" />
              <Property Name="ccl1007_numberofappointments" Type="Edm.Int32" />
              <Property Name="mshied_isdeceased" Type="Edm.Boolean" />
              <Property Name="entityimageid" Type="Edm.Guid" />
              <Property Name="exchangerate" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="_ccl1000_matriculation_value" Type="Edm.Guid" />
              <Property Name="msdyn_isminorwithparentalconsent" Type="Edm.Boolean" />
              <Property Name="stageid" Type="Edm.Guid" />
              <Property Name="address3_addresstypecode" Type="Edm.Int32" />
              <Property Name="_ccl1000_sjprospectusyearid_value" Type="Edm.Guid" />
              <Property Name="_nc_invitationsender_value" Type="Edm.Guid" />
              <Property Name="ccl1000_sjapplicantdayattendedon" Type="Edm.DateTimeOffset" />
              <Property Name="lastname" Type="Edm.String" Unicode="false" />
              <Property Name="address1_county" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_countryofbirth" Type="Edm.Int32" />
              <Property Name="address2_line2" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_branchid_value" Type="Edm.Guid" />
              <Property Name="governmentid" Type="Edm.String" Unicode="false" />
              <Property Name="subscriptionid" Type="Edm.Guid" />
              <Property Name="ccl1000_alumnievents" Type="Edm.Boolean" />
              <Property Name="adx_profilelastactivity" Type="Edm.DateTimeOffset" />
              <Property Name="address1_upszone" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_offeraccepteddate" Type="Edm.DateTimeOffset" />
              <Property Name="nc_emergencycontactname" Type="Edm.String" Unicode="false" />
              <Property Name="versionnumber" Type="Edm.Int64" />
              <Property Name="ccl1007_requirevisatostudyuk" Type="Edm.Boolean" />
              <Property Name="ccl3016_ethnicity" Type="Edm.Int32" />
              <Property Name="ccl3016_addresstype" Type="Edm.Int32" />
              <Property Name="mshied_citizenship" Type="Edm.Int32" />
              <Property Name="adx_identity_passwordhash" Type="Edm.String" Unicode="false" />
              <Property Name="nc_iagcompleted" Type="Edm.Boolean" />
              <Property Name="adx_organizationname" Type="Edm.String" Unicode="false" />
              <Property Name="address1_country" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_dbsnumber" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_cvdocumentlocation" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_manualriskscore" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_estranged" Type="Edm.Boolean" />
              <Property Name="address2_composite" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_nationality" Type="Edm.Int32" />
              <Property Name="ccl1000_visarequired" Type="Edm.Boolean" />
              <Property Name="_mshied_studentstatusid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_cvcontenttagcloud" Type="Edm.String" Unicode="false" />
              <Property Name="adx_publicprofilecopy" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_contacttypecreateid_value" Type="Edm.Guid" />
              <Property Name="nc_studentplannedstartdate" Type="Edm.DateTimeOffset" />
              <Property Name="nc_forskillsid" Type="Edm.String" Unicode="false" />
              <Property Name="adx_identity_lockoutenabled" Type="Edm.Boolean" />
              <Property Name="nc_portalinvitation" Type="Edm.Int32" />
              <Property Name="ccl1000_mentorastudent" Type="Edm.Boolean" />
              <Property Name="adx_modifiedbyipaddress" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_studentstatus_value" Type="Edm.Guid" />
              <Property Name="ccl3072_polar3quintile" Type="Edm.Int32" />
              <Property Name="adx_identity_lastsuccessfullogin" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1000_registeredforopenday" Type="Edm.Boolean" />
              <Property Name="_accountid_value" Type="Edm.Guid" />
              <Property Name="nc_disabilityorlearningsupporttypes" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_lastcommunicationdate" Type="Edm.DateTimeOffset" />
              <Property Name="address1_postofficebox" Type="Edm.String" Unicode="false" />
              <Property Name="importsequencenumber" Type="Edm.Int32" />
              <Property Name="address2_fax" Type="Edm.String" Unicode="false" />
              <Property Name="aging90" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="mshied_race" Type="Edm.Int32" />
              <Property Name="address1_postalcode" Type="Edm.String" Unicode="false" />
              <Property Name="timespentbymeonemailandmeetings" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_preferredemailaddress" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_disabilitytypeid_value" Type="Edm.Guid" />
              <Property Name="fax" Type="Edm.String" Unicode="false" />
              <Property Name="_mshied_currentprogramid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_engagementscore" Type="Edm.Int32" />
              <Property Name="_ccl1000_sjinterviewyearid_value" Type="Edm.Guid" />
              <Property Name="mshied_firstgeneration" Type="Edm.Boolean" />
              <Property Name="numberofchildren" Type="Edm.Int32" />
              <Property Name="nc_createdonfromcrm2013" Type="Edm.DateTimeOffset" />
              <Property Name="nc_studentmsteamsurl" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_dbschecklevel" Type="Edm.Int32" />
              <Property Name="_ccl1007_department_value" Type="Edm.Guid" />
              <Property Name="ccl1000_currentposition" Type="Edm.String" Unicode="false" />
              <Property Name="nc_studentemailtemplate" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_srs_contactid" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_marketingoptin" Type="Edm.Boolean" />
              <Property Name="ccl1007_privacydeclaration" Type="Edm.Boolean" />
              <Property Name="_ccl1000_countryofethnicityid_value" Type="Edm.Guid" />
              <Property Name="ccl3072_hesatracked" Type="Edm.Int32" />
              <Property Name="leadsourcecode" Type="Edm.Int32" />
              <Property Name="salutation" Type="Edm.String" Unicode="false" />
              <Property Name="_preferredserviceid_value" Type="Edm.Guid" />
              <Property Name="_owningbusinessunit_value" Type="Edm.Guid" />
              <Property Name="middlename" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_offermadedate" Type="Edm.DateTimeOffset" />
              <Property Name="ftpsiteurl" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3016_dsi" Type="Edm.Int32" />
              <Property Name="ccl1007_numberofappointments_state" Type="Edm.Int32" />
              <Property Name="adx_modifiedbyusername" Type="Edm.String" Unicode="false" />
              <Property Name="aging30_base" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="ccl3072_lookedafterchild" Type="Edm.Int32" />
              <Property Name="nc_onorders" Type="Edm.Boolean" />
              <Property Name="_ccl3016_ethnicityid_value" Type="Edm.Guid" />
              <Property Name="nc_statusfromcrm2013" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_sjlastenquirydate" Type="Edm.DateTimeOffset" />
              <Property Name="_ccl1000_nationality_value" Type="Edm.Guid" />
              <Property Name="ccl1007_nooutstandingactions_state" Type="Edm.Int32" />
              <Property Name="ccl3072_consentdate" Type="Edm.DateTimeOffset" />
              <Property Name="address2_line3" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_tempwork" Type="Edm.Boolean" />
              <Property Name="nc_disabilityorlearningsupportneeds" Type="Edm.Boolean" />
              <Property Name="ccl1007_alumniprofilepicture_name" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_sjprospectusrequestdate" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_linkedinurl" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_alumnicreateddate" Type="Edm.DateTimeOffset" />
              <Property Name="address3_country" Type="Edm.String" Unicode="false" />
              <Property Name="aging30" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="ccl1000_visanumber" Type="Edm.String" Unicode="false" />
              <Property Name="_modifiedby_value" Type="Edm.Guid" />
              <Property Name="ccl1000_sjopendayattendedon" Type="Edm.DateTimeOffset" />
              <Property Name="donotemail" Type="Edm.Boolean" />
              <Property Name="ccl1007_isintegrated" Type="Edm.Boolean" />
              <Property Name="ccl1000_alumnilostdate" Type="Edm.DateTimeOffset" />
              <Property Name="jobtitle" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_edubaseschoolurn" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_internalcvcontent" Type="Edm.String" Unicode="false" />
              <Property Name="_defaultpricelevelid_value" Type="Edm.Guid" />
              <Property Name="_createdonbehalfby_value" Type="Edm.Guid" />
              <Property Name="mobilephone" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_password" Type="Edm.String" Unicode="false" />
              <Property Name="_mshied_currentprogramlevelid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_guestlecturer" Type="Edm.Boolean" />
              <Property Name="nc_addresslookup" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_applicantdayregisteredon" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_createdbyagency" Type="Edm.Boolean" />
              <Property Name="mshied_currentprogramcompletionpercentage" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="ccl1007_agentconsentgiven" Type="Edm.Int32" />
              <Property Name="mshied_maidenname" Type="Edm.String" Unicode="false" />
              <Property Name="donotbulkpostalmail" Type="Edm.Boolean" />
              <Property Name="ccl3072_hsmaturestudent" Type="Edm.Boolean" />
              <Property Name="address2_stateorprovince" Type="Edm.String" Unicode="false" />
              <Property Name="nc_updatedfromebs" Type="Edm.Boolean" />
              <Property Name="mshied_legacy" Type="Edm.Boolean" />
              <Property Name="ccl1007_emailoffernotifications" Type="Edm.Boolean" />
              <Property Name="followemail" Type="Edm.Boolean" />
              <Property Name="ccl1007_selectedaction" Type="Edm.Int32" />
              <Property Name="address2_postalcode" Type="Edm.String" Unicode="false" />
              <Property Name="address3_telephone2" Type="Edm.String" Unicode="false" />
              <Property Name="emailaddress2" Type="Edm.String" Unicode="false" />
              <Property Name="aging60_base" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="nc_candidateageatenrolmentcalculated" Type="Edm.Int32" />
              <Property Name="overriddencreatedon" Type="Edm.DateTimeOffset" />
              <Property Name="ccl3007_feetype" Type="Edm.Int32" />
              <Property Name="address2_shippingmethodcode" Type="Edm.Int32" />
              <Property Name="ccl1000_studentvulnerabilitydetails" Type="Edm.String" Unicode="false" />
              <Property Name="adx_createdbyusername" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_miltarystatus" Type="Edm.Int32" />
              <Property Name="ccl1000_candidate" Type="Edm.Boolean" />
              <Property Name="_ccl1000_sjenquiryyearid_value" Type="Edm.Guid" />
              <Property Name="_ccl1007_ethnicity_value" Type="Edm.Guid" />
              <Property Name="ccl1000_sjenrolmentdate" Type="Edm.DateTimeOffset" />
              <Property Name="_ccl1000_alumnicreatedby_value" Type="Edm.Guid" />
              <Property Name="childrensnames" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_lastincomingactivitydate" Type="Edm.DateTimeOffset" />
              <Property Name="address2_addressid" Type="Edm.Guid" />
              <Property Name="ccl3072_dataconsentgiven" Type="Edm.Boolean" />
              <Property Name="spousesname" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_titleother" Type="Edm.String" Unicode="false" />
              <Property Name="nc_nationalinsurancenumber" Type="Edm.String" Unicode="false" />
              <Property Name="nc_ehcplan" Type="Edm.Boolean" />
              <Property Name="_owninguser_value" Type="Edm.Guid" />
              <Property Name="ccl1000_sjattendedapplicantday" Type="Edm.Boolean" />
              <Property Name="donotfax" Type="Edm.Boolean" />
              <Property Name="_nc_inviteredemption_value" Type="Edm.Guid" />
              <Property Name="createdon" Type="Edm.DateTimeOffset" />
              <Property Name="adx_confirmremovepassword" Type="Edm.Boolean" />
              <Property Name="_ccl_primarylanguage_value" Type="Edm.Guid" />
              <Property Name="_ccl3016_learningdifficulty_value" Type="Edm.Guid" />
              <Property Name="aging90_base" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="ccl1000_alumnistatus" Type="Edm.Int32" />
              <Property Name="nc_ebsimport" Type="Edm.Boolean" />
              <Property Name="_ccl3007_agent_value" Type="Edm.Guid" />
              <Property Name="address2_latitude" Type="Edm.Double" />
              <Property Name="nc_futureapprentice" Type="Edm.Int32" />
              <Property Name="ccl3072_marketingoptin" Type="Edm.Boolean" />
              <Property Name="_nc_2ndoption_value" Type="Edm.Guid" />
              <Property Name="address3_telephone3" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_vulnerablestudent" Type="Edm.Int32" />
              <Property Name="ccl1000_internalcvlastupdated" Type="Edm.DateTimeOffset" />
              <Property Name="nickname" Type="Edm.String" Unicode="false" />
              <Property Name="nc_probationawaitingcaseorservingsentence" Type="Edm.Boolean" />
              <Property Name="address3_city" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_networking" Type="Edm.Boolean" />
              <Property Name="ccl3072_pupilpremium" Type="Edm.Int32" />
              <Property Name="_adx_preferredlanguageid_value" Type="Edm.Guid" />
              <Property Name="haschildrencode" Type="Edm.Int32" />
              <Property Name="ccl1000_benefits" Type="Edm.String" Unicode="false" />
              <Property Name="merged" Type="Edm.Boolean" />
              <Property Name="mshied_citizenshipstatus" Type="Edm.Int32" />
              <Property Name="ccl1000_firstname3" Type="Edm.String" Unicode="false" />
              <Property Name="teamsfollowed" Type="Edm.Int32" />
              <Property Name="shippingmethodcode" Type="Edm.Int32" />
              <Property Name="_ccl1000_organisationid_value" Type="Edm.Guid" />
              <Property Name="ccl3016_ictforskill" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_imdquintile" Type="Edm.Int32" />
              <Property Name="mshied_externalidentifier" Type="Edm.String" Unicode="false" />
              <Property Name="statuscode" Type="Edm.Int32" />
              <Property Name="address3_telephone1" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_correspondenceaddresssameaspermanent" Type="Edm.Boolean" />
              <Property Name="address1_composite" Type="Edm.String" Unicode="false" />
              <Property Name="telephone1" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_courseid_value" Type="Edm.Guid" />
              <Property Name="address2_longitude" Type="Edm.Double" />
              <Property Name="_ccl1000_institutionid_value" Type="Edm.Guid" />
              <Property Name="address1_line1" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_marketinglistinterests" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_appointmentsnotattended_state" Type="Edm.Int32" />
              <Property Name="_mshied_externalsystem_value" Type="Edm.Guid" />
              <Property Name="_ccl1000_offeracceptedyear_value" Type="Edm.Guid" />
              <Property Name="nc_invitationemployeripaddress" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl3016_disabilityid_value" Type="Edm.Guid" />
              <Property Name="address2_name" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_currentpassport" Type="Edm.Boolean" />
              <Property Name="customertypecode" Type="Edm.Int32" />
              <Property Name="ccl1007_appointmentsnotattended" Type="Edm.Int32" />
              <Property Name="ccl3072_uniquelearnernumber" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_sjattendedinterview" Type="Edm.Boolean" />
              <Property Name="ccl1007_assigntomyself" Type="Edm.Boolean" />
              <Property Name="nc_safeguardingnotes" Type="Edm.String" Unicode="false" />
              <Property Name="address3_line1" Type="Edm.String" Unicode="false" />
              <Property Name="address1_addresstypecode" Type="Edm.Int32" />
              <Property Name="address2_primarycontactname" Type="Edm.String" Unicode="false" />
              <Property Name="externaluseridentifier" Type="Edm.String" Unicode="false" />
              <Property Name="nc_fullname" Type="Edm.String" Unicode="false" />
              <Property Name="address3_name" Type="Edm.String" Unicode="false" />
              <Property Name="nc_learningdifficulty" Type="Edm.Boolean" />
              <Property Name="adx_profilealertdate" Type="Edm.DateTimeOffset" />
              <Property Name="mshied_externalsourcesystem" Type="Edm.Int32" />
              <Property Name="ccl1000_visatype" Type="Edm.Int32" />
              <Property Name="ccl3072_consentpregdpr" Type="Edm.Int32" />
              <Property Name="nc_candidateestimatedenrolmentdate" Type="Edm.Date" />
              <Property Name="_mshied_currentprogramversion_value" Type="Edm.Guid" />
              <Property Name="assistantphone" Type="Edm.String" Unicode="false" />
              <Property Name="_parentcustomerid_value" Type="Edm.Guid" />
              <Property Name="donotpostalmail" Type="Edm.Boolean" />
              <Property Name="ccl3072_heprogrammetitle" Type="Edm.String" Unicode="false" />
              <Property Name="donotsendmm" Type="Edm.Boolean" />
              <Property Name="_ccl3007_agency_value" Type="Edm.Guid" />
              <Property Name="esc_suitabilityscore" Type="Edm.Int32" />
              <Property Name="ccl3072_lawfulbasislegal" Type="Edm.Boolean" />
              <Property Name="ccl1000_sourcelastmodifiedon" Type="Edm.DateTimeOffset" />
              <Property Name="adx_profilemodifiedon" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_communicateinwelsh" Type="Edm.Boolean" />
              <Property Name="ccl1000_lastoutgoingactivitydate" Type="Edm.DateTimeOffset" />
              <Property Name="nc_emergencycontactrelation" Type="Edm.Int32" />
              <Property Name="ccl1000_passport" Type="Edm.Boolean" />
              <Property Name="address3_upszone" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_dataquality" Type="Edm.Int32" />
              <Property Name="adx_identity_emailaddress1confirmed" Type="Edm.Boolean" />
              <Property Name="yomilastname" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_youngadultcarer" Type="Edm.Boolean" />
              <Property Name="ccl1000_title" Type="Edm.Int32" />
              <Property Name="_nc_1stoption_value" Type="Edm.Guid" />
              <Property Name="ccl1000_hourlyrate" Type="Edm.Decimal" Scale="Variable" />
              <Property Name="ccl1000_dbscheckissuedate" Type="Edm.DateTimeOffset" />
              <Property Name="ccl1007_nooutstandingactions" Type="Edm.Int32" />
              <Property Name="_ccl3016_manager_value" Type="Edm.Guid" />
              <Property Name="address1_telephone1" Type="Edm.String" Unicode="false" />
              <Property Name="ccl3072_adulthequalificationquintile" Type="Edm.Int32" />
              <Property Name="address3_primarycontactname" Type="Edm.String" Unicode="false" />
              <Property Name="adx_profilealertinstructions" Type="Edm.String" Unicode="false" />
              <Property Name="address3_postofficebox" Type="Edm.String" Unicode="false" />
              <Property Name="new_potentialduplicate" Type="Edm.Boolean" />
              <Property Name="address2_telephone1" Type="Edm.String" Unicode="false" />
              <Property Name="new_forskillsid" Type="Edm.String" Unicode="false" />
              <Property Name="address2_postofficebox" Type="Edm.String" Unicode="false" />
              <Property Name="lastonholdtime" Type="Edm.DateTimeOffset" />
              <Property Name="address3_shippingmethodcode" Type="Edm.Int32" />
              <Property Name="ccl1000_positionsought" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_appointmentsattended_date" Type="Edm.DateTimeOffset" />
              <Property Name="ccl3072_permissionphoto" Type="Edm.Int32" />
              <Property Name="emailaddress1" Type="Edm.String" Unicode="false" />
              <Property Name="nc_studentcampus" Type="Edm.Int32" />
              <Property Name="donotbulkemail" Type="Edm.Boolean" />
              <Property Name="onholdtime" Type="Edm.Int32" />
              <Property Name="nc_safeguardingteamapprovetoproceed" Type="Edm.Boolean" />
              <Property Name="ccl3016_mechcomp" Type="Edm.String" Unicode="false" />
              <Property Name="address3_line2" Type="Edm.String" Unicode="false" />
              <Property Name="mshied_hipaaindicator" Type="Edm.Boolean" />
              <Property Name="ccl1000_lastactivitydate" Type="Edm.DateTimeOffset" />
              <Property Name="address1_shippingmethodcode" Type="Edm.Int32" />
              <Property Name="ccl3072_hstimeincare" Type="Edm.Boolean" />
              <Property Name="ccl3016_nextofkinrequired" Type="Edm.Int32" />
              <Property Name="ccl1000_sjattendedopenday" Type="Edm.Boolean" />
              <Property Name="msdyn_orgchangestatus" Type="Edm.Int32" />
              <Property Name="telephone3" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_assignapplicationguid" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1007_countryofbirthid_value" Type="Edm.Guid" />
              <Property Name="ccl3072_permissiontomonitor" Type="Edm.Int32" />
              <Property Name="statecode" Type="Edm.Int32" />
              <Property Name="websiteurl" Type="Edm.String" Unicode="false" />
              <Property Name="msdyn_isminor" Type="Edm.Boolean" />
              <Property Name="nc_emergencycontactphonenumber" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1000_latestrecruitmentstage" Type="Edm.Int32" />
              <Property Name="ccl1007_faculty" Type="Edm.String" Unicode="false" />
              <Property Name="yomifullname" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_alumnireactivatedby_value" Type="Edm.Guid" />
              <Property Name="_ccl1000_disabilityoneid_value" Type="Edm.Guid" />
              <Property Name="address1_addressid" Type="Edm.Guid" />
              <Property Name="_ccl1007_ethinicity_value" Type="Edm.Guid" />
              <Property Name="_modifiedonbehalfby_value" Type="Edm.Guid" />
              <Property Name="ccl1000_candidateno" Type="Edm.String" Unicode="false" />
              <Property Name="_preferredsystemuserid_value" Type="Edm.Guid" />
              <Property Name="timezoneruleversionnumber" Type="Edm.Int32" />
              <Property Name="ccl1000_haddisability" Type="Edm.Boolean" />
              <Property Name="ccl1000_workpermit" Type="Edm.Int32" />
              <Property Name="address3_addressid" Type="Edm.Guid" />
              <Property Name="address1_line3" Type="Edm.String" Unicode="false" />
              <Property Name="fullname" Type="Edm.String" Unicode="false" />
              <Property Name="_ccl1000_sjopendayyearid_value" Type="Edm.Guid" />
              <Property Name="ccl1000_offerinternshipgraduateposition" Type="Edm.Boolean" />
              <Property Name="ccl1007_selectednotifications" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_authorisedpersonemailtext" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_alumniprofilepicture" Type="Edm.Binary" />
              <Property Name="_ccl1000_countryofdomicileid_value" Type="Edm.Guid" />
              <Property Name="ccl1007_languagepreference" Type="Edm.Int32" />
              <Property Name="adx_identity_newpassword" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_studentbiography" Type="Edm.String" Unicode="false" />
              <Property Name="address3_line3" Type="Edm.String" Unicode="false" />
              <Property Name="lastusedincampaign" Type="Edm.DateTimeOffset" />
              <Property Name="participatesinworkflow" Type="Edm.Boolean" />
              <Property Name="ccl1007_facebookurl" Type="Edm.String" Unicode="false" />
              <Property Name="ccl1007_numberofappointments_date" Type="Edm.DateTimeOffset" />
              <Property Name="_ccl1000_yearofgraduationid_value" Type="Edm.Guid" />
              <Property Name="contactid" Type="Edm.Guid" />
       ...
</EntityType>
jamesmacwhite commented 1 year ago

This CSDL metadata request does seem to be the single point of truth of what properties are in fact usable though to a CRM environment so it's possibly a method of assurance to always know if something is valid, however, it's rather expensive query wise, by default 14.9 MB in size for the environment tested and in an XML format (ewww), I don't think you can do anything with it, it just gets returned as is, with everything.

jamesmacwhite commented 1 year ago

My only other thoughts if you perhaps added an event for the mapping data, so before it's used, it gives a chance for a developer to obtain the mapping and modify if needed.

I was able to do this with the EVENT_AFTER_FETCH_FORM_SETTINGS event and array_walk_recursive() over the integration fields in each collection and basically just strtolower the handle if not already so the integration settings provides it as always lower for now, this may be not the case for other CRM environments, but it does mean we aren't trapped by the conditional logic setting the invalid names currently.

Now based on #1071, it sounds like the reverse problem for the other person, but without seeing the CSDL data for their environment it's hard to know what the true Property Name truly should be.

It is a bit of confusing one I've read more than one source that cites SchemaName should be used with OData, but our CRM certainly doesn't and I've checked various custom fields, they are all lower, it's also the same story on other entities i.e. leads.

jamesmacwhite commented 1 year ago

Closing this as there is technically a solution, you can override the field handle as described if not right with events or alternatively create a custom integration inheriting the base Dynamics 365 class to modify things. The only reliable way to determine this without guessing schema vs logical name values is to lookup the CSDL as it's basically blueprint of a CRM environment and the single source of truth, but as it's XML (and there's no way to format it differently) it is a lot of processing/overhead.