Want to call a popup page from snippet

  • 1
  • Question
  • Updated 4 years ago
Hi i had wrote a row action in a table, a snippet will be fired when we click on row action and checks records. If records already exists it shows a message. But if records doesn't exist then it must show  a popup(include page) opens. popup must be called from a snippet if no records found. How can i call a popup page from snippet if no records exist. 

How can i call a popup window from snippet?? please some one help me out.

Thanks in advance.
Photo of pavan thutupalli

pavan thutupalli

  • 144 Points 100 badge 2x thumb

Posted 4 years ago

  • 1
Photo of JD Bell

JD Bell, Senior Product Engineer

  • 2,996 Points 2k badge 2x thumb
I recommend you use our new action framework ("Run multiple actions"). Use your existing snippet to check if any records exist. If they do, return false, otherwise return true (or just don't return anything). Now add a second action that opens a popup. If your first action (your snippet) returns false, it cancels the stream of actions and nothing below it will execute. If it returns true or doesn't return any value, then the action stream is not cancelled and the popup will open.
Photo of Eddie

Eddie

  • 720 Points 500 badge 2x thumb
how do you return false in the snippet using multiple actions.

I have the below code but it didnt work:

var AllMortgageModel = skuid.model.getModel('AllMortgage');
var row_id = AllMortgageModel.data[0].Id;
var request_type = AllMortgageModel.data[0].Request_Type__c;

if (!request_type){
    alert('You must select a Request Type');
}
else{
    alert(row_id);
    alert(request_type); 
   
   
    //Close the Popup
    //skuid.$('.ui-dialog-content').dialog('close');
}

return false;