- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2024 08:56 PM
I am using this workspace client script to present a g_modal dialog to send an SMS message to an Openframe integrated application. It seems that the 'CustomEvent.fireAll' execution is causing an endless loop in the messaging.
This command certainly sends a message to Openframe but it executes endlessly until the entire browser window refreshes. What am I missing? Is there an alternative to sending a message to Openframe from this UI Action script (below) ?
UI Action Script (incident Table)
-------
function onClick(g_form) {
alert('Send Text');
var userToText = g_form.getReference('caller_id', doText) function doText(userToText) { var fields = [
{
type:'string',
name:'mobile_phone',
label: 'Caller Mobile Phone',
value: userToText.mobile_phone,
displayValue: userToText.mobile_phone,
readonly: true
},
{
type: 'textarea',
name: 'messageBody',
label: 'Message Content',
mandatory: true
}
];
g_modal.showFields({
title: "Send Text Message",
fields: fields,
// buttons: buttons,
confirmTitle: "Send",
cancelTitle: "Cancel",
size: 'md'
}).then( function(fieldValues){ var payload = { "type": "OUTGOING_SMS", "data": {"to": fieldValues.updatedFields[0].value, "message": fieldValues.updatedFields[1].value}};
var context = {"payload": payload, "method" : "openframe_communication" };
CustomEvent.fireAll("openframe_request", context);
console.log('send message');
});
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 08:28 AM
I have resolved this separately... the error was in the code of the OpenFrame app... nvm...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 08:28 AM
I have resolved this separately... the error was in the code of the OpenFrame app... nvm...