Skip to main content
Tweeted twitter.com/StackSalesforce/status/1273767450530787329
Bumped by Community user
added 419 characters in body
Source Link
salesforce-sas
  • 24.5k
  • 5
  • 44
  • 79

----------------------- EDITED ---------------------------------------

Event for very simple form like below, I am getting error for this user:

<lightning:recordEditForm recordId="{!v.recordId}"
                              objectApiName="Opportunity">
        <lightning:messages />
        
        <lightning:outputField fieldName="Name" />
    </lightning:recordEditForm>

----------------------- EDITED ---------------------------------------

Event for very simple form like below, I am getting error for this user:

<lightning:recordEditForm recordId="{!v.recordId}"
                              objectApiName="Opportunity">
        <lightning:messages />
        
        <lightning:outputField fieldName="Name" />
    </lightning:recordEditForm>
added 2 characters in body
Source Link
salesforce-sas
  • 24.5k
  • 5
  • 44
  • 79

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object].

I am using lightning:recordEditForm as below in lightning record page:

<lightning:recordEditForm aura:id="form" recordId="{!v.recordId}"
                                          objectApiName="{!v.objectName}"
                                          onerror="{!c.handleFormError}"
                                          onsuccess="{!c.handleFormSuccess}">
                    <!-- the messages component is for error messages -->
                    <lightning:messages />

     // lightning:inputField

While testing for different users, its working for most of the users but failing for very few users and getting UI like below:

enter image description hereenter image description here

When trying to debug (with breakpoint) the event from method handleFormError, I am getting below in console logs

event.getParam('message')
"Cannot read property 'errorCode' of undefined"
event.getParam('detail')
""
event.getParam("output").fieldErrors
undefined
JSON.stringify(event.getParam('output'))
"{}"
JSON.stringify(event.getParam('error'))
"{"ok":false,"status":400,"statusText":"Bad Request","body":{}}"

Further, I am getting below error in console log after the record page is loaded.

KB {component: "markup://force:lds", componentStack: "[lightning:recordEditForm]", action: null, name: "AuraFriendlyError", message: "Error in fetching record or record metadata. [[object Object]]", …}

For the user, for his profile, all the fields used in form have editable permission for that specific record type and has access to record. App is normal (non-console). Object is Opportunity (and its custom fields).

PS: Pls let me know if any other info has to be added in question. Thanks in advance!

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object].

I am using lightning:recordEditForm as below in lightning record page:

<lightning:recordEditForm aura:id="form" recordId="{!v.recordId}"
                                          objectApiName="{!v.objectName}"
                                          onerror="{!c.handleFormError}"
                                          onsuccess="{!c.handleFormSuccess}">
                    <!-- the messages component is for error messages -->
                    <lightning:messages />

     // lightning:inputField

While testing for different users, its working for most of the users but failing for very few users and getting UI like below:

enter image description here

When trying to debug (with breakpoint) the event from method handleFormError, I am getting below in console logs

event.getParam('message')
"Cannot read property 'errorCode' of undefined"
event.getParam('detail')
""
event.getParam("output").fieldErrors
undefined
JSON.stringify(event.getParam('output'))
"{}"
JSON.stringify(event.getParam('error'))
"{"ok":false,"status":400,"statusText":"Bad Request","body":{}}"

Further, I am getting below error in console log after the record page is loaded.

KB {component: "markup://force:lds", componentStack: "[lightning:recordEditForm]", action: null, name: "AuraFriendlyError", message: "Error in fetching record or record metadata. [[object Object]]", …}

For the user, for his profile, all the fields used in form have editable permission for that specific record type and has access to record. App is normal (non-console). Object is Opportunity (and its custom fields).

PS: Pls let me know if any other info has to be added in question. Thanks in advance!

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object].

I am using lightning:recordEditForm as below in lightning record page:

<lightning:recordEditForm aura:id="form" recordId="{!v.recordId}"
                                          objectApiName="{!v.objectName}"
                                          onerror="{!c.handleFormError}"
                                          onsuccess="{!c.handleFormSuccess}">
                    <!-- the messages component is for error messages -->
                    <lightning:messages />

     // lightning:inputField

While testing for different users, its working for most of the users but failing for very few users and getting UI like below:

enter image description here

When trying to debug (with breakpoint) the event from method handleFormError, I am getting below in console logs

event.getParam('message')
"Cannot read property 'errorCode' of undefined"
event.getParam('detail')
""
event.getParam("output").fieldErrors
undefined
JSON.stringify(event.getParam('output'))
"{}"
JSON.stringify(event.getParam('error'))
"{"ok":false,"status":400,"statusText":"Bad Request","body":{}}"

Further, I am getting below error in console log after the record page is loaded.

KB {component: "markup://force:lds", componentStack: "[lightning:recordEditForm]", action: null, name: "AuraFriendlyError", message: "Error in fetching record or record metadata. [[object Object]]", …}

For the user, for his profile, all the fields used in form have editable permission for that specific record type and has access to record. App is normal (non-console). Object is Opportunity (and its custom fields).

PS: Pls let me know if any other info has to be added in question. Thanks in advance!

added 76 characters in body
Source Link
salesforce-sas
  • 24.5k
  • 5
  • 44
  • 79

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object].

I am using lightning:recordEditForm as below in lightning record page:

<lightning:recordEditForm aura:id="form" recordId="{!v.recordId}"
                                          objectApiName="{!v.objectName}"
                                          onerror="{!c.handleFormError}"
                                          onsuccess="{!c.handleFormSuccess}">
                    <!-- the messages component is for error messages -->
                    <lightning:messages />

     // lightning:inputField

While testing for different users, its working for most of the users but failing for very few users and getting UI like below:

enter image description here

When trying to debug (with breakpoint) the event from method handleFormError, I am getting below in console logs

event.getParam('message')
"Cannot read property 'errorCode' of undefined"
event.getParam('detail')
""
event.getParam("output").fieldErrors
undefined
JSON.stringify(event.getParam('output'))
"{}"
JSON.stringify(event.getParam('error'))
"{"ok":false,"status":400,"statusText":"Bad Request","body":{}}"

Further, I am getting below error in console log after the record page is loaded.

KB {component: "markup://force:lds", componentStack: "[lightning:recordEditForm]", action: null, name: "AuraFriendlyError", message: "Error in fetching record or record metadata. [[object Object]]", …}

For the user, for his profile, all the fields used in form have editable permission for that specific record type and has access to record. App is normal (non-console). Object is Opportunity (and its custom fields).

PS: Pls let me know if any other info has to be added in question. Thanks in advance!

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object].

I am using lightning:recordEditForm as below in lightning record page:

<lightning:recordEditForm aura:id="form" recordId="{!v.recordId}"
                                          objectApiName="{!v.objectName}"
                                          onerror="{!c.handleFormError}"
                                          onsuccess="{!c.handleFormSuccess}">
                    <!-- the messages component is for error messages -->
                    <lightning:messages />

     // lightning:inputField

While testing for different users, its working for most of the users but failing for very few users and getting UI like below:

enter image description here

When trying to debug (with breakpoint) the event from method handleFormError, I am getting below in console logs

event.getParam('message')
"Cannot read property 'errorCode' of undefined"
event.getParam('detail')
""
event.getParam("output").fieldErrors
undefined
JSON.stringify(event.getParam('output'))
"{}"
JSON.stringify(event.getParam('error'))
"{"ok":false,"status":400,"statusText":"Bad Request","body":{}}"

Further, I am getting below error in console log after the record page is loaded.

KB {component: "markup://force:lds", componentStack: "[lightning:recordEditForm]", action: null, name: "AuraFriendlyError", message: "Error in fetching record or record metadata. [[object Object]]", …}

For the user, for his profile, all the fields used in form have editable permission for that specific record type and has access to record.

Problem: Many users are able to see a form but few users are not able to see the form and getting error [object object].

I am using lightning:recordEditForm as below in lightning record page:

<lightning:recordEditForm aura:id="form" recordId="{!v.recordId}"
                                          objectApiName="{!v.objectName}"
                                          onerror="{!c.handleFormError}"
                                          onsuccess="{!c.handleFormSuccess}">
                    <!-- the messages component is for error messages -->
                    <lightning:messages />

     // lightning:inputField

While testing for different users, its working for most of the users but failing for very few users and getting UI like below:

enter image description here

When trying to debug (with breakpoint) the event from method handleFormError, I am getting below in console logs

event.getParam('message')
"Cannot read property 'errorCode' of undefined"
event.getParam('detail')
""
event.getParam("output").fieldErrors
undefined
JSON.stringify(event.getParam('output'))
"{}"
JSON.stringify(event.getParam('error'))
"{"ok":false,"status":400,"statusText":"Bad Request","body":{}}"

Further, I am getting below error in console log after the record page is loaded.

KB {component: "markup://force:lds", componentStack: "[lightning:recordEditForm]", action: null, name: "AuraFriendlyError", message: "Error in fetching record or record metadata. [[object Object]]", …}

For the user, for his profile, all the fields used in form have editable permission for that specific record type and has access to record. App is normal (non-console). Object is Opportunity (and its custom fields).

PS: Pls let me know if any other info has to be added in question. Thanks in advance!

Source Link
salesforce-sas
  • 24.5k
  • 5
  • 44
  • 79
Loading