简体   繁体   English

输入有效的 URL 并重试: Salesforce Lightning Web 组件错误

[英]Enter a valid URL and try again : Salesforce Lightning Web Component Error

Hi all I am using LNS(Lightning NavigationService) in LWC.大家好,我在 LWC 中使用 LNS(Lightning NavigationService)。 I have created three buttons for New,Edit,View in LWC on Account object where i am adding my component in Account record where i can clcik thee buttons ie On click of New button it will open New Account record STandard Record Page similarly for rest of buttons edit & view.我在帐户 object 的 LWC 中创建了三个按钮用于新建、编辑、查看,我在帐户记录中添加了我的组件,我可以在其中单击按钮,即单击新建按钮时,它将打开新帐户记录标准记录页面,类似于 rest 的按钮编辑和查看。 But when i am click on each of these buttons i am getting error msg "Enter a valid URL and try again".但是当我单击每个按钮时,我收到错误消息“输入有效的 URL 并重试”。 Let me know what ihave missed让我知道我错过了什么

Hi all I am using LNS(Lightning NavigationService) in LWC.大家好,我在 LWC 中使用 LNS(Lightning NavigationService)。 I have created three buttons for New,Edit,View in LWC on Account object where i am adding my component in Account record where i can clcik thee buttons ie On click of New button it will open New Account record STandard Record Page similarly for rest of buttons edit & view.我在帐户 object 的 LWC 中创建了三个按钮用于新建、编辑、查看,我在帐户记录中添加了我的组件,我可以在其中单击按钮,即单击新建按钮时,它将打开新帐户记录标准记录页面,类似于 rest 的按钮编辑和查看。 But when i am click on each of these buttons i am getting error msg "Enter a valid URL and try again".但是当我单击每个按钮时,我收到错误消息“输入有效的 URL 并重试”。 Let me know what ihave missed让我知道我错过了什么

 import { LightningElement,api } from 'lwc'; import{NavigationMixin} from 'lightning/navigation' export default class NavigationServiceLWC extends NavigationMixin(LightningElement) { @api recordId; navigateToNewRecordPage(){ this[NavigationMixin.Navigate]({ type:'standard__recordPage', attributes:{ "recordId":this.recordId, "objectApiName":"Account", "actionName":"new" } }); } navigateToEditRecordPage(){ this[NavigationMixin.Navigate]({ type:'standard__recordPage', attributes:{ "recordId":this.recordId, "objectApiName":"Account", "actionName":"edit" } }); } navigateToViewRecordPage(){ this[NavigationMixin.Navigate]({ type:'standard__recordPage', attributes:{ "recordId":this.recordId, "objectApiName":"Account", "actionName":"view" } }); } }
 <:-- begin snippet: js hide: false console: true babel: false -->

<template>
  <lightning-card title="Navigation Service in Lightning Web Components">
    <lightning-card title="Navigate to Record Page">
      <lightning-button-group>
        <lightning-button label="New Record Page" onclick={navigateToNewRecordPage}></lightning-button>  
        <lightning-button label="Edit Record Page" onclick={navigateToEditRecordPage}></lightning-button>
        <lightning-button label="View Record Page" onclick={navigateToViewRecordPage}></lightning-button>
      </lightning-button-group>  
    </lightning-card>
  </lightning-card>  
</template>

Same issue for me as well, in my case however there was a casing issue in the recordid variable name对我来说也是同样的问题,但在我的情况下, recordid变量名中存在大小写问题

attributes:{
    "recordId": this.recordid,
    "objectApiName":"Account",
    "actionName":"view"
}

Edit - Can you post this question on Salesforce's stackexchange?编辑 - 您可以在Salesforce 的 stackexchange 上发布这个问题吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 401 未经授权 REST API 中闪电 web 组件 ZA8FF6C9514C35C8563B350382 - 401 Unauthorized REST API in lightning web component salesforce 如何在Salesforce中将SVG用作闪电组件 - how to use svg into lightning component in Salesforce 使用 Salesforce 中的闪电组件覆盖按钮 - Override a button using lightning component in Salesforce 每当我单击闪电组件 salesforce 中的提交按钮时,我都会收到提示刷新页面的错误 - I am getting the error saying to refresh the page, whenever I click on submit button in the lightning component salesforce Salesforce:在 Lightning 组件中动态获取记录 ID - Salesforce: Dynamically grabbing record id's in a Lightning Component 如何在salesforce闪存组件中实现reCAPTCHA V3? - How to implement reCAPTCHA V3 in salesforce lightning component? Salesforce Lightning Component不会通过Apex调用更新记录,从而冻结 - Salesforce Lightning Component will not update records via Apex call, freezes 如何获取闪电组件salesforce中的查询字符串参数 - how do I get the query string parameters in lightning component salesforce 显示 JSON 字符串的 Lightning Web 组件不起作用 - Lightning Web Component to display JSON String is not working Webpack 加载器错误:Salesforce Lightning Design React App - Webpack loader error: Salesforce Lightning Design React App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM