So, could you please explain when custom fields can be used and how to use them? I find this very confusing and the wix code manual is not really helping.
Say I just triggered users to register their e-mail and password and now - on a seperate page - I want their contact information to be added to the wix CRM, the following code does not seem to work:
import wixCRM from ‘wix-crm’;
import wixLocation from ‘wix-location’
$w.onReady( function () {
$w(“#register”).onClick( () => {
wixCRM.createContact( {
“firstName”: $w(“#firstName”).value,
“lastName”: $w(“#lastName”).value,
“PostalCode”: $w(‘#PostalCode’).value,
“Country” : $w(‘#Country’).value,
“HighestDegree”: $w(‘#HighestDegree’).value,
“ProfessionalSituation”: $w(‘#ProfessionalSituation’).value,
“Company” : $w(‘#Company’).value
.then(()=>{
wixLocation.to(‘/registratie-succesvol’);
})
})
})
})
Help is much appreciated. Thanks in advance.