Search...
deleteExtendedField( )
Deletes an extended field.
Description
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 totrue
.
Syntax
function deleteExtendedField(key: string, [options: AuthOptions]): Promise<void>
deleteExtendedField Parameters
NAME
TYPE
DESCRIPTION
key
string
Extended field ID.
options
Optional
AuthOptions
Authorization options.
Returns
Return Type:
Promise<void>
Was this helpful?
Delete an extended field
Copy Code
1import { Permissions, webMethod } from 'wix-web-module';2import { contacts } from 'wix-crm-backend';34export const myDeleteExtendedFieldFunction = webMethod(Permissions.Anyone, () => {5 const fieldKey = "custom.event-name";6 const options = {7 suppressAuth: false8 };910 return contacts.deleteExtendedField(fieldKey, options)11 .then(() => {12 console.log("Extended field deleted");13 })14 .catch((error) => {15 console.error(error);16 });17});