+ Start a Discussion
Soundar Rajan PonpandiSoundar Rajan Ponpandi 

Call back value is Error in Controller

Hi ,

below code getting Error State while saving the record so i couldn't navigate to recently created record page.
getSave : function (component, event, helper) {
        alert('Current Record Id |' + component.get("v.recordId"));
        var action = component.get("c.GD_newQuoteVersion");
        var toastEvent = $A.get("e.force:showToast");
            quoteId: component.get("v.recordId")
            var state = result.getState();
            alert('state ' + state);
            /*if (state == "SUCCESS") {
                var res = result.getReturnValue();
                alert('INside of success ' + res);
            var newQtId = result.getReturnValue();
            console.log('Return Value is:' + JSON.stringify(result.getReturnValue()));
            alert('New Quote Id - ' + JSON.stringify(result.getReturnValue()));
            /*Toast Event*/
                title: "Success!",
                message: "Quote is created successfully!",
                type: "success"
            var recId = component.get("v.recordId");
            var sObectEvent = $A.get("e.force:navigateToSObject");
            sObectEvent .setParams({
                "recordId": recId,
                "slideDevName": "detail"

Can anyone please tell me where i did mistake ? 

Hearty thanks in advance.

Best Answer chosen by Soundar Rajan Ponpandi
Santosh Kumar 348Santosh Kumar 348
Check out your code in APEX as STATE  value is returned from APEX class.
Check the debug log, there must be some exception occuring at the time of saving the record.

The simple way to check the debug log is in Developer console, just check out log section in DevConsole when you have excuted your code else you  can setup Debug log for your name and can check.

Mark this answer as closed if it served your purpose.

Santosh Kumar