+ Start a Discussion
Amita TatarAmita Tatar 

pop up alert messages

Hi guys, please help me how we can show pop up messages after performing DML operations insert,update,etc in salesforce
Sumit Kumar Singh 9Sumit Kumar Singh 9
You can try this -
<apex:page controller="insertRec">
    function insertAccount() {
            function(result, event) {
            { buffer: true, escape: true, timeout: 120000 }                   
        <a href="" onclick="insertAccount();" styleclass="btn"> Insert Contact </a>
public class insertRec {
    public static string InsertConRec() {
        string messageString = '';
        try {
            contact c = new Contact();
            c.lastName = 'Test';
            insert c;
            messageString = 'Successfully inserted the record.'; 
        } catch (Exception e) {
            messageString = e.getMessage();    
        return messageString ; 

Rogerio Lara 2028Rogerio Lara 2028
Hi Sumit,

I saw your post and I think this could be the potential solution to what I am trying to achieve. 

I'm getting an Error: Compile Error: unexpected token: '<' at line 1 column 0

Any ideas why this is happening?

Thank you,