查找或创建新的 Lightning Web 组件/销售人员的 URL

发布于 2025-01-14 21:55:20 字数 527 浏览 0 评论 0 原文

我是 Sales Force 的新手,我希望外部客户端可以通过 url 访问新创建的 Lightning Web 组件。我正在添加到现有的 SalesForce 实例。

我们的代码库中有几个现有的 lwc,其中两个可以通过外部客户端的 url 访问。两者都遵循类似的模式:

[organization url] /schedule/s/self? [query params]  (name of lwc "selfSchedule")
[organization url] /schedule/s/opt-out? [query params] (name of lwc "subscriptionOptOut")

我想对新组件做类似的事情,但我不明白中间值来自哪里或它们是在哪里定义的。我不确定为什么它是“时间表”,也无法推理“自我”和“选择退出”的来源。中心值总是 s 吗?

我在 GUI 以及代码库中的文件中查找了定义这些值但无济于事的地方。

有人可以提供有关在哪里查找/定义中间 URL 值的指导,以便我可以正确引用它们吗?

I am new to Sales Force and I want a newly created Lightning Web Component to be accessible by url to outside clients. I'm adding to an existing SalesForce instance.

We have several existing lwc in our code base, two of which are accessible by url to outside clients. The both follow a similar pattern:

[organization url] /schedule/s/self? [query params]  (name of lwc "selfSchedule")
[organization url] /schedule/s/opt-out? [query params] (name of lwc "subscriptionOptOut")

I want to do something similar with the new component, but I don't understand where the middle values are coming from or where they are defined. I'm not sure why it's "schedule" nor have I been able to reason where "self" and "opt-out" come from. Will the center value always be s?

I have looked in the GUI as well as the files in the code base for a place where these values are defined to no avail.

Can someone please offer guidance in where to find/define the middle URL values so that I can properly reference them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海之角 2025-01-21 21:55:20

您的组织正在使用“网站”或“体验云”(以前称为客户/合作伙伴社区,以前称为客户/合作伙伴门户)。转到设置 ->站点或设置 ->体验一下...并看看。

如果您不知道自己正在使用社区,那么您可能没有真正的社区用户和社区用户。许可证(比常规许可证便宜,但仍然如此),您可能只有“来宾用户”进行未经身份验证的访问。小心向来宾用户公开的内容

可能会有一些 trailheads视频(如果您迷路了)。

  1. 转到社区构建器并为您的组件创建新页面(但不要添加组件,也许只添加一些纯文本)。页面编辑器与“Lightning App Builder”编辑器类似但不完全相同。这是您选择“自我”、“选择退出”等的部分。
  2. 也许将您的页面添加到页面顶部的导航菜单中。
  3. 点击“发布”并检查是否可以看到新页面。
  4. 将组件的“meta.xml”文件与其他两个文件进行比较。您需要添加目标 (可能是 lightningCommunity__Page) 来表明可以将其放在社区页面上。部署。
  5. 如果您的组件使用 Apex - 您需要向来宾用户(或普通社区用户,如果事实证明您确实拥有他们)授予运行此类的权限。来宾用户仍然是个人资料,您拥有所有正常的复选框 - 但它有点隐藏。步骤取决于您是否拥有网站社区
  6. 您已准备好返回页面,将组件放在上面,然后再次点击“发布”。
  7. 如果您认为存在最高错误 - 调试来宾用户也有点痛苦。转到设置 ->调试日志并搜索名称中带有“guest”的用户。应该会弹出类似“{您的社区名称}站点访客用户”的内容。

Your organisation is using a "Site" or "Experience Cloud" (formerly known as Customer / Partner Community, formerly known as Customer / Partner Portal). Go to Setup -> Sites or Setup -> Experience... and have a look.

If you had no idea you're using a community there's a chance you don't have real community users & licences (cheaper than regular licenses but still), you might have just the "guest user" for unauthenticated access. Be careful what you expose to guest users

There might be some trailheads and videos if you're lost.

  1. Go to community builder and create new page for your component (but don't add the component yet, maybe add just some plain text). The page editor is similar but not identical to "Lightning App Builder" editor. This is the part where you choose "self", "opt-out" etc.
  2. Maybe add your page to Navigation Menu at top of the page.
  3. Hit "Publish" and check if you can see the new page.
  4. Compare your component's "meta.xml" file with the other two. You'll need to add a target (probably lightningCommunity__Page) to it to indicate it's OK to drop it on community page. Deploy.
  5. If your component uses Apex - you need to grant permission to run this class to the guest user (or normal community users, if it turns out you actually have them). Guest user is still a Profile, you have all the normal checkboxes - but it's bit hidden. Steps depend whether you have a Site or community.
  6. You're ready to go back to your page, drop your component on it and hit Publish again.
  7. If you think there are apex errors - debugging guest users is bit of a pain too. Go to Setup -> Debug logs and search users with "guest" in name. Something like "{your community name} Site Guest User" should pop up.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文