• phaniram satya durga upalapati
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Error occurred while trying to proxy request /api/sessions from localhost:3001 to http://localhost:3002 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
My sharing settings for Opportunity Object is 'Private'. As part of my lightning component i am using force:recordData to read the record and update few fields i.e. OwnerId  to new User and saving the record. Issues is SaveRecord method is updating the record but it is returning error result.
Error: {"state":"ERROR","recordId":null,"error":[{"message":"The requested resource does not exist\n","pageErrors":[{"statusCode":"NOT_FOUND","message":"The requested resource does not exist"}],"fieldErrors":{},"potentialDuplicates":[]}],"entityApiName":null,"action":{}}. Kindly suggest me what might be the issue.

Component(.cmp):
---------------------------
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global">
    <aura:attribute name="recordId" type="string" />
   <aura:attribute name="record" type="Opportunity" />
  <!--Loading the Data from the Opportunity record -->   
    <force:recordData aura:id="editRecord" 
                              recordId="{!v.recordId}"
                              fields="['Name','RecordTypeId','OwnerId','Type']"
                              mode="EDIT"
                              targetFields="{!v.record}"
                              recordUpdated="{!c.dataLoaded}"
                              />
</aura:component>

controller.Js:
---------------
({
dataLoaded : function(component, event, helper) {
       // helper.fetchRec(component);
        let rec = component.get("v.record");
        rec.Type = '********';
        rec.OwnerId = '***************';
        component.set("v.record",rec);
   
},
})
helper.js:
-------------
({
    
    updateRec : function(component) {
             component.find("editRecord").saveRecord($A.getCallback((result) => {  
                    if (result.state == "SUCCESS" || result.state === "DRAFT") {
                        alert('success');                    
                    }else{
                       alert("Error: " + JSON.stringify(result));
                    }
        }
      ));
    },     
})
 
Error occurred while trying to proxy request /api/sessions from localhost:3001 to http://localhost:3002 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
My sharing settings for Opportunity Object is 'Private'. As part of my lightning component i am using force:recordData to read the record and update few fields i.e. OwnerId  to new User and saving the record. Issues is SaveRecord method is updating the record but it is returning error result.
Error: {"state":"ERROR","recordId":null,"error":[{"message":"The requested resource does not exist\n","pageErrors":[{"statusCode":"NOT_FOUND","message":"The requested resource does not exist"}],"fieldErrors":{},"potentialDuplicates":[]}],"entityApiName":null,"action":{}}. Kindly suggest me what might be the issue.

Component(.cmp):
---------------------------
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickActionWithoutHeader" access="global">
    <aura:attribute name="recordId" type="string" />
   <aura:attribute name="record" type="Opportunity" />
  <!--Loading the Data from the Opportunity record -->   
    <force:recordData aura:id="editRecord" 
                              recordId="{!v.recordId}"
                              fields="['Name','RecordTypeId','OwnerId','Type']"
                              mode="EDIT"
                              targetFields="{!v.record}"
                              recordUpdated="{!c.dataLoaded}"
                              />
</aura:component>

controller.Js:
---------------
({
dataLoaded : function(component, event, helper) {
       // helper.fetchRec(component);
        let rec = component.get("v.record");
        rec.Type = '********';
        rec.OwnerId = '***************';
        component.set("v.record",rec);
   
},
})
helper.js:
-------------
({
    
    updateRec : function(component) {
             component.find("editRecord").saveRecord($A.getCallback((result) => {  
                    if (result.state == "SUCCESS" || result.state === "DRAFT") {
                        alert('success');                    
                    }else{
                       alert("Error: " + JSON.stringify(result));
                    }
        }
      ));
    },     
})