raiseEvent (informazioni di riferimento sull'API JavaScript) per Dynamics 365 Channel Integration Framework 1.0

Richiama il sottoscrittore associato per l'evento.

Annotazioni

Se sono stati creati eventi personalizzati utilizzando il metodo addHandler, è possibile generare tali eventi passando il nome dell'evento come parametro in questo metodo.

Sintassi

Microsoft.CIFramework.raiseEvent(eventName, eventInputParameters, correlationId);

Parametri

Nome TIPO Obbligatorio Description
eventName String Yes Nome dell'evento il cui gestore deve essere richiamato.
eventInputParameters Stringa JSON Yes I parametri di input che devono essere passati alla funzione del gestore.
correlationId Identificatore Unico Globale (GUID) NO Viene usato per raggruppare tutte le chiamate API correlate per i dati di telemetria diagnostica.

Valore restituito

Promessa con valore booleano.

Example

// Let there be an event registered to a subscriber.
handlerFunction = function(eventInput) 
{
    console.log(eventInput);
    if(eventInput != null &&  eventInput != undefined && eventInput.size > 0) 
    {
        inputData = eventInput.get("value");
        correlationId = eventInput.get("correlationId");
        console.log(inputData + " " + correlationId);
    }
    return Promise.resolve();
}
Microsoft.CIFramework.addHandler("oncustomevent", handlerFunction);
//Use raiseEvent API to invoke the subscribed handler of the event.
Microsoft.CIFramework.raiseEvent("oncustomevent", "test input value");

//In the main UCI page
Microsoft.CIFramework.addHandler("widgetEvent", handlerFunction);
///In the widget code
Microsoft.CIFramework.raiseEvent("widgetEvent", eventInput);

//In the widget code
Microsoft.CIFramework.addHandler("mainPageEvent", handlerFunction);
//In the main UCI page
Microsoft.CIFramework.raiseEvent("mainPageEvent", eventInput);

onClickToAct
onModeChanged
onPageNaviga
onSendKBArticolo
onSizeChanged