Case
Enable approval functionality for a new section
Solution
1. Create a new object for the [Approvals] custom section. The detail object name is generated from the section object name + Visa. For example, for the UsrInnerRequest section, the object name will be UsrInnerRequestVisa. When creating the object, ensure inheriting from the [BaseVisa] object, add a field for connecting to the section, other parameters should be configured similar to the [OrderVisa] object.
The UsrInnerRequest object should be managed by records.
2. Enable approval functionality for the custom section page. Namely, migrate all elements from the [OrderPageV2] order page schema to the custom section page by the Visa keyword.
3. Enable approving in the custom section list. Namely, migrate all elements from the [OrderSectionV2] order section list schema to the custom section list schema by the Visa key word.
4. Copy the "Receiving order approval" subprocess and change the Order and Read data parameters, as well as filtering of elements from the [Order] section to the custom section object. The subprocess title should look as follows: section name + VisaBaseSubprocess.
5.Copy the "Order approval" process and change the Order and Read data parameters, element filtering and the link to subprocess for the relevant values. The process title should look as follows: section name + VisaProcess. The elements of sending notifications should be changed for the new sending element.
6. Add a new "[custom section name] Approval process" system setting with a link to the process specified in item 5. See the setup parameters in the "Order approval process" system setting.
To display approvals on the communication panel:
1. Copy the [OrderVisaNotificationProvider] schema and rename it for the Section name + VisaNotificationProvider. By the Order keyword, replace it in the schema for the name of the custom section object. The titles of the [Orders] section fields should be replaced by the corresponding fields of the custom section.
2. Register the previously added schema with the 0 type by a script in the [Notification Provider] table (the [Lookup] does not enable saving a record with a 0 type):
insert into NotificationProvider (ClassName, Type) values ('Terrasoft.Configuration.UsrInnerRequestVisaNotificationProvider','0')