您在此处:
允许客服人员使用 Apex 触发器查看服务资源简档
创建 Apex 触发器,将服务资源记录与客服人员共享,并将客服人员设置为所有者。然后,客服人员可以对自己的服务资源记录采取操作。他们可以提交服务资源首选项、资源缺勤或出勤表,或查看通过客服人员参与获得的技能。触发器允许客服人员仅查看自己的服务资源记录,而非向所有客服人员公开打开所有服务资源记录。

使用更普遍的搜索词。
选择更少的筛选器,并扩大搜索范围。
创建 Apex 触发器,将服务资源记录与客服人员共享,并将客服人员设置为所有者。然后,客服人员可以对自己的服务资源记录采取操作。他们可以提交服务资源首选项、资源缺勤或出勤表,或查看通过客服人员参与获得的技能。触发器允许客服人员仅查看自己的服务资源记录,而非向所有客服人员公开打开所有服务资源记录。
| 查看支持版本。 |
以下示例介绍了如何与客服人员共享服务资源记录。
trigger share_record_with_resource on ServiceResource (after insert) {
for (ServiceResource sr : Trigger.New) {
if (sr.RelatedRecord != null) {
ServiceResourceShare srShare = new ServiceResourceShare();
srShare.ParentId = sr.Id;
srShare.UserOrGroupId = sr.RelatedRecordId;
srShare.AccessLevel = 'Read';
insert srShare;
}
}
}
以下示例介绍了如何将客服人员设置为服务资源记录的所有者:
trigger change_resource_owner on ServiceResource (before insert) {
for (ServiceResource sr : Trigger.New) {
if (sr.RelatedRecordId != null) {
sr.OwnerId = sr.RelatedRecordId;
}
}
}

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.