Stay in the know Thank you for your interest in our Law Firm Newsletter. Please use the below form to manage your communication preferences. (function (a, t, i) { var e = "MSCI"; var s = "Analytics"; var o = e + "queue"; a[o] = a[o] || []; var r = a[e] || function (n) { var t = {}; t[s] = {}; function e(e) { while (e.length) { var r = e.pop(); t[s][r] = function (e) { return function () { a[o].push([e, n, arguments]) } }(r) } } var r = "track"; var i = "set"; e([r + "Event", r + "View", r + "Action", i + "Config", i + "Property", i + "User", "initialize", "teardown"]); return t }(i.name); var n = i.name; if (!a[e]) { a[n] = r[s]; a[o].push(["new", n]); setTimeout(function () { var e = "script"; var r = t.createElement(e); r.async = 1; r.src = i.src; var n = t.getElementsByTagName(e)[0]; n.parentNode.insertBefore(r, n) }, 1) } else { a[n] = new r[s] } if (i.user) { a[n].setUser(i.user) } if (i.props) { for (var c in i.props) { a[n].setProperty(c, i.props[c]) } } a[n].initialize(i.cfg) })(window, document, { src: "https://rdrect-usa1.mkt.dynamics.com/webtracking/WebTracking/WebTracking.bundle.js", name: "MSCI", cfg: { ingestionKey: "1280954908f041fdaf6ef039280f396f-be00ac66-7835-46b3-8af8-3ef5180b522a-7454", endpointUrl: "https://mobile.events.data.microsoft.com/OneCollector/1.0/", autoCapture: { view: true, click: true }, orgInfo: { orgId: "01813376-80a3-4283-a0b4-392b6625c592", orgTenantId: "4ee48f43-e15d-4f4a-ad55-d0990aac660e", orgGeo: "USA" } } }); // NOTE: for reference see https://go.microsoft.com/fwlink/?linkid=2250770 const formSelector = 'form[data-formid="1e322ac32f7f4b42a91ebdab2a749bdf-use"]'; // Global click listener using delegation to catch form submissions reliably document.addEventListener("click", async (e) => { const submitBtn = e.target.closest('.submit-button') || e.target.closest('button[type="submit"]') || e.target.closest('input[type="submit"]'); if (!submitBtn) return; const form = submitBtn.closest(formSelector); if (!form) return; // Grab the selected country value dynamically from the custom dropdown component const countryInput = form.querySelector('input[name="country"]'); const selectedCountry = countryInput ? countryInput.getAttribute('data-value') || countryInput.value : ""; const mappings = [ { FormFieldName: "firstname", DataverseFieldName: "firstname", }, { FormFieldName: "lastname", DataverseFieldName: "lastname", }, { FormFieldName: "emailaddress", DataverseFieldName: "emailaddress1", }, { // Explicitly mapped from the resolved country dropdown value DataverseFieldName: "address1_country", DataverseFieldValue: selectedCountry, }, { FormFieldName: "jobtitle", DataverseFieldName: "jobtitle", }, { FormFieldName: "organization", DataverseFieldName: "Organization", }, { FormFieldName: "description", DataverseFieldName: "description", }, // Consent topics mapped dynamically based on selected interest checkboxes { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "51a138b6-6897-f111-8076-000d3a336d61;Email;true", LabelText: "AI & Data", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "58a138b6-6897-f111-8076-000d3a336d61;Email;true", LabelText: "Finance & Revenue", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "8273d0b8-6897-f111-8076-000d3a33672a;Email;true", LabelText: "Managed Services", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "103824b9-6897-f111-8075-70a8a5af0770;Email;true", LabelText: "Mission & Growth", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "f366c9bb-6897-f111-8076-00224804f864;Email;true", LabelText: "Operations", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "c6c5afbc-6897-f111-8076-000d3a336d61;Email;true", LabelText: "People, Organization & Change", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "cec5afbc-6897-f111-8076-000d3a336d61;Email;true", LabelText: "Resilience & Sustainability", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "d5c5afbc-6897-f111-8076-000d3a336d61;Email;true", LabelText: "Risk, Regulatory & Compliance", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, { FormFieldName: "interests", DataverseFieldName: "msdynmkt_topicid;channels;optinwhenchecked", DataverseFieldValue: "fd66c9bb-6897-f111-8076-00224804f864;Email;true", LabelText: "Technology", ComplianceSettingsId: "7f4a6355-1811-4cde-bde3-fee8c85f56b1", }, // Privacy Policy agreement checkbox { FormFieldName: "privacypolicy", DataverseFieldName: "PrivacyPolicy", DataverseFieldValue: [ { FormValue: "privacypolicy", DataverseValue: "1" }, ], }, { DataverseFieldName: "parentaccountid", DataverseFieldValue: "{\"Id\":\"bc5eac4b-1da3-f111-b8dc-7ced8d6ea4cf\",\"LogicalName\":\"account\"}", }, { DataverseFieldName: "gh_leadsourcecategory", DataverseFieldValue: "{\"Id\":\"7848d936-e181-f111-ab0e-00224804f864\",\"LogicalName\":\"gh_leadcategory\"}", }, { DataverseFieldName: "gh_leadsource", DataverseFieldValue: "{\"Id\":\"dac0b855-fc89-f111-ab10-00224804f864\",\"LogicalName\":\"gh_leadsource\"}", }, { DataverseFieldName: "RunContact-Lead-AccountAutomation", DataverseFieldValue: "1", }, { DataverseFieldName: "CreateMQL", DataverseFieldValue: "0", }, ]; try { const serializedForm = d365mktformcapture.serializeForm(form, mappings); // console.log(JSON.stringify(serializedForm)); // NOTE: enable for debugging const payload = serializedForm.SerializedForm.build(); const captureConfig = { FormId: "c010ac1f-f4b1-f111-aaab-0022480bfde6", FormApiUrl: "https://public-usa.mkt.dynamics.com/api/v1.0/orgs/01813376-80a3-4283-a0b4-392b6625c592/landingpageforms" }; await d365mktformcapture.submitForm(captureConfig, payload); } catch (err) { console.error(err); } form.submit(); }, true);