Excel.LinkedEntityIdCulture interface

Representa el identificador de entidad y la referencia cultural de un LinkedEntityCellValue objeto.

Comentarios

Conjunto de API: ExcelApi 1.19

Esta interfaz no se admite en Excel en la Web.

Usada por

Ejemplos

/**
 * Custom function that acts as the data provider for a LinkedEntityDataDomain.
 * Called on demand by Excel to resolve and refresh LinkedEntityCellValue objects.
 * @customfunction
 * @linkedEntityLoadService
 * @param {any} request Request to resolve and refresh LinkedEntityCellValue objects.
 * @return {any} Resolved or refreshed LinkedEntityCellValue objects that were requested in the passed-in request.
 */
function contosoLoadService(request: any): any {
    const notAvailableError = new CustomFunctions.Error(CustomFunctions.ErrorCode.notAvailable);

    try {
        // Parse the request that was passed-in by Excel.
        const parsedRequest: Excel.LinkedEntityLoadServiceRequest = JSON.parse(request);
        // Initialize result to populate and return to Excel.
        const result: Excel.LinkedEntityLoadServiceResult = { entities: [] };

        // Identify the domainId of the request and call the corresponding function to create
        // linked entity cell values for that linked entity data domain.
        const entities: Excel.LinkedEntityIdCulture[] = parsedRequest.entities;
        for (const { entityId } of entities) {
            let linkedEntityResult = null;
            switch (parsedRequest.domainId) {
                case "products": {
                    linkedEntityResult = makeProductLinkedEntity(entityId);
                    break;
                }
                case "categories": {
                    linkedEntityResult = makeCategoryLinkedEntity(entityId);
                    break;
                }
                default:
                    throw notAvailableError;
            }

            if (!linkedEntityResult) {
                // Throw an error to signify to Excel that the resolution or refresh of the requested linkedEntityId failed.
                throw notAvailableError;
            }

            result.entities.push(linkedEntityResult);
        }

        return result;
    } catch (error) {
        console.error(error);
        throw notAvailableError;
    }
}

Propiedades

culture

Representa la referencia cultural del lenguaje que se usa para crear el LinkedEntityCellValue objeto.

entityId

Representa el identificador específico de un servicio que se usa para crear el LinkedEntityCellValue objeto .

Detalles de las propiedades

culture

Representa la referencia cultural del lenguaje que se usa para crear el LinkedEntityCellValue objeto.

culture: string;

Valor de propiedad

string

Comentarios

Conjunto de API: ExcelApi 1.19

Esta propiedad no se admite en Excel en la Web.

entityId

Representa el identificador específico de un servicio que se usa para crear el LinkedEntityCellValue objeto .

entityId: string;

Valor de propiedad

string

Comentarios

Conjunto de API: ExcelApi 1.19

Esta propiedad no se admite en Excel en la Web.