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);
});
},
);
Deletes a label from the site and removes it from contacts it applies to.
The deleteLabel()
function returns a Promise
that resolves when the specified label is deleted.
Note:
Only visitors with
Manage Contacts permissions
can delete labels.
You can override the permissions by setting the suppressAuth
option to true
.
Label key to delete.
Authorization options.
Retrieves a custom field with a given name, or creates one if it doesn't exist.
The findOrCreateExtendedField()
function returns a Promise
that resolves when the specified custom field is found or created.
Successful calls to findOrCreateExtendedField()
always return an
extended field,
which can be passed to subsequent function calls.
To find an existing extended field without potentially creating a new one, use
getExtendedField()
or
queryExtendedFields()
.
Note:
Only visitors with
Manage Contacts permissions
can find or create extended fields.
You can override the permissions by setting the suppressAuth
option to true
.
Custom field to find or create.
Authorization options.
Retrieves a label with a given name, or creates one if it doesn't exist.
The findOrCreateLabel()
function returns a Promise
that resolves when the specified label is found or created.
Successful calls to findOrCreateLabel()
always return a label,
which can be passed to subsequent function calls.
To find an existing label without potentially creating a new one, use
getLabel()
or
queryLabels()
.
Note:
Only visitors with
Manage Contacts permissions
can find or create labels.
You can override the permissions by setting the suppressAuth
option to true
.
Label display name to retrieve or create.
If an existing label is an exact match for the specified display name, the existing label is returned. If not, a new label is created and returned.
Authorization options.