Documentación del asistente de contexto

El objeto context proporciona una interfaz poderosa para acceder a datos y ejecutar acciones dentro del Report Static Query Builder.

Está disponible globalmente como:

window.context

Contiene varios componentes clave que permiten interactuar con parámetros, tablas, flujos, formularios y consultas.

Estructura General

{
  params: {},       // Query parameters
  table: {},        // Available tables with data
  flow: Function,  // Load or open a flow
  form: Function,  // Open a form
  query: {}         // Query builder object
}

Componentes

params

El objeto params contiene todos los parámetros disponibles para el reporte actual.

// Example
context.params.userId = "12345";
context.params.startDate = "2023-01-01";

table

El objeto table contiene todas las tablas disponibles. Cada tabla es una lista de objetos (filas).

flow()

La función flow() permite cargar o abrir otro flujo desde el reporte actual.

Parámetros:

Opciones de executionType

  • openFlow → Abre el flujo en el panel

  • loadFlow → Ejecuta el flujo en segundo plano

form()

La función form() permite abrir un formulario desde el reporte actual.

Parámetros

query

La propiedad query permite acceder al constructor de consultas programáticas.

Permite:

  • Construir consultas dinámicas

  • Aplicar filtros

  • Ejecutar agregaciones

Practical Examples

Navigating between flows based on a condition:

Opening a form with data from the current context:

Loading a flow in the background and then reloading the current page:

Best Practices

  1. Parameter Management: When passing parameters to flows or forms, only include the parameters that need to change from the current context.

  2. Error Handling: Always ensure that the required IDs (flowId, formId) are valid before calling the respective functions.

  3. User Experience: Consider using reloadCurrent: true with caution as it will refresh the user's current view.

  4. Performance: When working with large tables, consider processing the data before navigating to another flow to minimize the data transfer.

Última actualización