This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @IsTest | |
| public class ParentWithNestedChildrenUtility { | |
| /** | |
| * @description Creates an in-memory SObject with nested related (child) records using JSON serialization and deserialization, without DMLs. | |
| * @param parentRecord The parent SObject record to receive children. | |
| * @param childrenRecords SObject records to be nested under the parent. | |
| * @param relationshipFieldName The relationship field name on Parent ('Contacts', 'Opportunities', 'Equipment_Maintenance_Items__r'). Using String, as "SObjectField" type cannot be used due to relationship fields on parent-side are not available that way. | |
| * @param populateFakeIds If true, fake Ids will be generated and assigned to parent and child records when their Ids are null. | |
| * @return The deserialized parent SObject with nested children records. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const SALESFORCE_ORG_ID = '00DQy00000TqD0T'; // Salesforce Instance Org Id, can be taken from generated Web-To-Lead link. | |
| function onFormSubmit(e) { | |
| const reponseFields = e.response.getItemResponses(); | |
| const payload = { | |
| 'oid': SALESFORCE_ORG_ID, | |
| 'first_name': reponseFields[0].getResponse(), | |
| 'last_name': reponseFields[1].getResponse(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @IsTest | |
| public inherited sharing class AvailableTimeSlotsService { | |
| private final static String USED_API_VERSION { get { return '60.0';}} | |
| private final static Integer MAXIMUM_DAYS_TO_SEARCH { get { return 180;}} | |
| @InvocableMethod(Label = 'Find first free Time Slot for Scheduler' IconName='slds:standard:time_period' Description = 'Returns first found unoccupied Time Slot for given Service Territory and Work Type Group.' Category = 'Appointments') | |
| public static List<String> getTimeSlot(final List<SchedulerSearchParams> schedulerSearchParamsList) { | |
| final List<String> freeTimeSlots = new List<String>(); |