Hello dears,
I need show a popup to get a value when the action start.
Can help me with that?
Regards,
Like
2 comments
18:33 Oct 30, 2017
If you're asking about calling a popup from a business process, then there is no such a functionality in the out-of-the-box system.
It's possible to create such a functionality with code. This is the way on how to call a page method from a business process.
The code in the process
//Usings
using Terrasoft.Configuration;
using Terrasoft.Messaging.Common;
using Newtonsoft.Json;
//Code
public void SendMessage() {
string senderName = "TestPopup";
string message = JsonConvert.SerializeObject(new {
RecordId = Guid.NewGuid(),
Name = "Some name"
});
// For all users
//MsgChannelUtilities.PostMessageToAll(senderName, message);
// For current user
var userConnection = Get<UserConnection>("UserConnection");
MsgChannelUtilities.PostMessage(userConnection, senderName, message);
// For specific user with sysAdminUnitId
/*IMsgChannel channel = MsgChannelManager.Instance.FindItemByUId(sysAdminUnitId);
if (channel != null) {
var simpleMessage = new SimpleMessage() {
Id = sysAdminUnitId,
Body = message,
Header = {
Sender = senderName
}
};
channel.PostMessage(simpleMessage);
}*/
}Frontend
define("CommunicationPanel", ["terrasoft", "LookupUtilities"],
function(Terrasoft, LookupUtilities) {
return {
messages: {
"CardProccessModuleInfo": { "direction": "subscribe", "mode": "ptp" },
"GetHistoryState": { "direction": "publish", "mode": "ptp" }
},
attributes: {},
methods: {
init: function() {
this.callParent(arguments);
Terrasoft.ServerChannel.on(Terrasoft.EventName.ON_MESSAGE, this.onMessageReceived, this);
},
//probably onMessage
onMessageReceived: function(sender, message) {
if (message && message.Header && message.Header.Sender === "TestPopup") {
//var result = this.Ext.decode(message.Body);
var contactFilters = Terrasoft.createFilterGroup();
var config = {
entitySchemaName: "Contact",
mode: "processMode",
captionLookup: "Contact lookup",
multiSelect: false,
columnName: "Name",
filters: contactFilters,
commandLineEnabled: true
};
var handler = this.handler;
LookupUtilities.OpenLookupPage(this.sandbox, {config: config, handler: handler}, this, null, false);
}
},
handler: function() {
//run process here
/*
ProcessModuleUtilities.executeProcess({
sysProcessName: processName
});*/
},
destroy: function() {
this.Terrasoft.ServerChannel.un(Terrasoft.EventName.ON_MESSAGE, this.onMessage, this);
this.callParent(arguments);
}
},
diff: []
};
});
Please note that you'll need to modify the OpenLookupPage method and draw a lookup frame manually.
Show all comments