Обновление триггера Apex для отображения приложений повторной сертификации
Обновите триггер Apex, выполняемый при создании отдельной записи заявки категории «Благосостояние». Настройте триггер для публикации BMRecertEvent, когда приложение повторной сертификации пройдет проверку и будет на рассмотрении. Обработчик событий для BMRecertEvent обновляет статус повторной сертификации назначения бонуса, связанного с приложением.
В меню «Настройка» менеджера объектов выберите «Отдельное приложение».
Нажмите «Триггеры».
Для ProcessIAForBenefitAssistance нажмите , а потом выберите «Правка».
Вставьте этот код в текстовое поле. Замените префикс Omnistudio-Namespace-Prefix префиксом пространства имен пакета Omnistudio, установленного в вашей организации.
Найдите префикс пространства имен пакета Omnistudio на странице установленных пакетов в настройках.
trigger ProcessIAForBenefitAssistance on IndividualApplication (after update) {
String procedureNameForNewIA = 'BenefitManagement_ProcessIndividualApplication';
Map <String, Object> ipInput = new Map <String, Object> ();
Map <String, Object> ipOutput = new Map <String, Object> ();
Map <String, Object> ipOptions = new Map <String, Object> ();
// List to hold the Platform Events to be published
List<BMRecertEvent__e> eventsToPublish = new List<BMRecertEvent__e>();
// Iterate through the inserted or updated records
for (IndividualApplication ia : Trigger.new) {
if(ia.Status == 'Submitted' && ia.Category == 'Benefit') {
String recordId = ia.Id;
ipInput.put('RecordId', recordId);
/* Call the IP via runIntegrationService, and save the output to ipOutput */
ipOutput = (Map <String, Object>) Omnistudio-Namespace-Prefix.IntegrationProcedureService.runIntegrationService(procedureNameForNewIA, ipInput, ipOptions);
System.debug('IP Output: ' + ipOutput);
IndividualApplication iaRecord = [SELECT Id, Status, ApplicationType, Category FROM IndividualApplication WHERE Id = :ia.Id];
if(iaRecord.Status != 'Denied' && iaRecord.ApplicationType == 'Recertification'){
BMRecertEvent__e event = new BMRecertEvent__e();
// Set fields on the Platform Event based on the inserted or updated record
event.RecordId__c = iaRecord.Id;
// Add the Platform Event to the list of events to be published
eventsToPublish.add(event);
}
}
}
// Publish the list of Platform Events
if (!eventsToPublish.isEmpty()) {
EventBus.publish(eventsToPublish);
}
}
Сохраните изменения.
Эта статья решила вашу проблему?
Оставьте свой отзыв, чтобы мы могли стать лучше!
Загрузка
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
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
Always Active
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
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
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.