Skip to content

@mbanq/core-sdk-js v0.50.0


@mbanq/core-sdk-js / commands / CreateEntryInDataTable

Function: CreateEntryInDataTable()

CreateEntryInDataTable(params, data): Command<{ data: { fileData?: Blob | File; tableData: Record<string, any>; }; params: { apptableid: number; command?: string; datatable: string; }; }, { additionalProp?: Record<string, any>; changes?: Record<string, any>; clientId?: number; id: number; loanId?: number; officeId?: number; resourceId: number; savingsId?: number; }>

Defined in: src/commands/rest/dataTable.ts:73

Create a new entry (row) in a data table

This endpoint allows you to add a new entry to a specified data table. The data can be provided as JSON values or via file uploads. When uploading files, ensure that the request body content type is set to multipart/form-data.

Parameters

params

The path and query parameters

apptableid

number = ...

The ID of the application table (defaults to 101 for client tables)

command?

string = ...

Optional command parameter to control file upload behavior (e.g., 'largeFile')

datatable

string = ...

The name of the data table where the entry will be made

data

The request body

fileData?

Blob | File = ...

Optional file to upload (PDF, JPEG, JPG, PNG formats supported)

tableData

Record<string, any> = ...

JSON object containing data table fields details for the column

Returns

Command<{ data: { fileData?: Blob | File; tableData: Record<string, any>; }; params: { apptableid: number; command?: string; datatable: string; }; }, { additionalProp?: Record<string, any>; changes?: Record<string, any>; clientId?: number; id: number; loanId?: number; officeId?: number; resourceId: number; savingsId?: number; }>

Command object that executes the API request and returns the created entry details

Example

typescript
const command = CreateEntryInDataTable(
  { datatable: 'd_rdatatable', apptableid: 101 },
  {
    tableData: {
       employee_id: '2113',
       first_name: 'TTT1',
       last_name: 'DDD1',
       ids: '3432',
       name: 'TD2',
       locale: 'en',
       dateFormat: 'dd MMMM yyyy'
     }
  }
);
const result = await client.request(command);
console.log(result.resourceId); // 1719455311113
console.log(result.clientId); // 517

Released under the MIT License.