+ Start a Discussion
SaintMichaelSaintMichael 

RemoteAction Parameters Help

Im trying perform an Insert from my JQUERY mobile page.

 

Ive tried this:

 $(".insertButton").click(function() {
  
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem($("#model").val(),$("#asset_tag").val(),("#operating_system").val(), handleUpdate);
            });

 

Above s no good.

 

I tried this too:

 $(".insertButton").click(function() {
               
                var merchRecord = {
                   
                    Operating_System__c: $("#operating_system").val(),
                    Model__c: $("#model").val(),
                    Asset_Tag__c:$("#asset_tag").val()
                };
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem(merchRecord, handleUpdate);
            });

 

 

Problem is i get this error:

Visualforce Remoting: Parameter length does not match remote action parameters: expected 3 parameters, got

Line 115

 

 

Not quite sure how to perform the insert.

 

Any ideas?

SaintMichaelSaintMichael

O, this seems to be getting inserted:

 

 $(".insertButton").click(function() {
               
                var merchRecord = {
                   
                    Operating_System__c: $("#operating_system").val(),
                    Model__c: $("#model").val(),
                    Asset_Tag__c:$("#asset_tag").val()
                };
                $.mobile.showPageLoadingMsg();
                InventoryExtension.insertInventoryItem(merchRecord, handleUpdate);
            });



@RemoteAction
    public static String insertInventoryItem(Equipment__c newEQ) {
        try {
            
            
            insert newEQ;
            return 'Item Inserted';
        } catch (Exception e) {
            return e.getMessage();
        }
    }