Deletes an extended field.
The deleteExtendedField()
function returns a Promise that resolves
when the specified extended field is deleted.
When an extended field is deleted, any contact data stored in the field is permanently deleted as well.
Note:
Only visitors with
Manage Contacts permissions
can delete extended fields.
You can override the permissions by setting the suppressAuth
option to true
.
function deleteExtendedField(key: string, options: AuthOptions): Promise<void>;
Extended field ID.
Authorization options.
import { Permissions, webMethod } from "wix-web-module";
import { contacts } from "wix-crm-backend";
export const myDeleteExtendedFieldFunction = webMethod(
Permissions.Anyone,
() => {
const fieldKey = "custom.event-name";
const options = {
suppressAuth: false,
};
return contacts
.deleteExtendedField(fieldKey, options)
.then(() => {
console.log("Extended field deleted");
})
.catch((error) => {
console.error(error);
});
},
);
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.