Renames an extended field.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function renameExtendedField(
key: string,
field: RenameExtendedField,
): Promise<ExtendedField>;
null
null
import { extendedFields } from "wix-crm.v2";
/* Sample key value:
*
* 'custom.nickname'
*
* Sample field value:
* {
* 'Contact Nickname'
* }
*/
export async function myRenameExtendedFieldFunction(key, field) {
try {
const renamedExtendedField = await extendedFields.renameExtendedField(
key,
field,
);
console.log("Successfulyl renamed extendedField:", renamedExtendedField);
return renamedExtendedField;
} catch (error) {
console.log(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "namespace": "custom",
* "key": "custom.nickname",
* "displayName": "Contact Nickname",
* "dataType": "TEXT",
* "fieldType": "USER_DEFINED",
* "legacyId": "63408eaf-e3d0-43f3-afa5-942847d272a1",
* "wixSearchColumn": "info_extendedFields_custom_string_18",
* "_createdDate": "2023-12-25T12:21:42.000Z",
* "_updatedDate": "2023-12-25T13:25:35.000Z"
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.