Native Pulsar UI Interaction API

Native Pulsar UI Interaction

The calls that support Pulsar native screen interaction need to know that you will only see the response when the native screen is dismissed by the user. For example, if your code calls viewObject in edit mode, when the user types the data on the screen and hits save or cancel, you will see the JSAPI response. This way, you can take the appropriate action based on that response. 

setLeavePageMessage

The setLeavePageMessage API allows you to display a confirmation prompt whenever the user tries to leave the page.  If a message is specified, the user will be prompted to select 'Yes' or 'No' for the Done button press as well as for these web navigation buttons: Refresh, Back, Forward.  To disable this prompt, call this command again with a zero length string.

var request = {  "type" : "setLeavePageMessage", "object" : "", "data" : "Are you sure you want to leave this page?" // message displayed in a yes/no confirmation alert }; bridge.sendRequest(request, function (responseData) { alert('Javascript got its view response: ' + responseData); });

exit

The exit API closes the html document.  This command is the same as pressing the Done button and will work alongside the setLeavePageMessage command.

var request = {  "type" : "exit", "data" : {} }; bridge.sendRequest(request, function (responseData) { console.log('exit: ' + responseData); });

showCreate

var request = { "type" : "showCreate", "object" : "Account", "data" : { "Name" : "John Doe Industries", "Phone" : "867-5309" } }; bridge.sendRequest(request, function(responseData) { if (responseData.type === "showcreateResponse" && responseData.data.createResult === "TRUE") { alert('Create Success! ObjectId: ' + responseData.data.createId); } else { alert('Error during create: ' + responseData.data); } });

viewObject

viewRelated

viewList

lookupObject

scanObject

scanBarcode

executeQuickAction

cameraPhoto

cameraPhotoPicker

filePicker

displayUrl