Create Data Storage entity.add
We are still updating this page
Some data may be missing here — we will fill it in shortly.
Scope:
entityWho can execute the method: any user
The entity.add method creates a data storage. Before creating, you can check for the existence of the storage using entity.get.
Parameters
|
Parameter |
Description |
|
ENTITY* |
Required. String identifier of the storage, unique for this application (maximum length - 13 characters). |
|
NAME* |
Required. Name of the storage. |
|
ACCESS |
Description of access permissions for the storage. |
Required parameters are marked with *
The Creator of the storage automatically receives X permission.
Example
try
{
const response = await $b24.callMethod(
'entity.add',
{
'ENTITY': 'dish',
'NAME': 'Dishes',
'ACCESS': {
U1:'W',
AU:'R'
}
}
);
const result = response.getData().result;
console.log('Created element with ID:', result);
// Your required data processing logic
processResult(result);
}
catch( error )
{
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'entity.add',
[
'ENTITY' => 'dish',
'NAME' => 'Dishes',
'ACCESS' => [
'U1' => 'W',
'AU' => 'R'
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
// Your required data processing logic
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error adding entity: ' . $e->getMessage();
}
BX24.callMethod(
'entity.add',
{
'ENTITY': 'dish',
'NAME': 'Dishes',
'ACCESS': {
U1:'W',
AU:'R'
}
}
);
How to Use Examples in Documentation