function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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();
        }
    }