Set Up Submit and Lock Wizard

This feature is available from Mira (v1.37) onwards

Introduction to the Wizard

The Submit Application wizard optimizes the submission workflow for Projects (or Applications) by offering users a consolidated interface to submit multiple data tables simultaneously.

Upon submission, the associated data tables and linked Lightning Web Components (LWCs) are locked, preventing further modifications. This functionality ensures data integrity within the system.

The following flows are included in the module:

Flow API Name

Description

ampi__Submit_Lock_Wizard

It collects the outputs from each subflow to verify if the component has already been submitted. If the Project/Application has been submitted previously, it displays a message regarding the same.

If any of the components has failed submission due to an error, then the handler flow collects the error messages from the sub-flows of the particular component that failed and displays them. If there are no errors, it shows a message that the submission has been successful

ampi__Submit_Indicator

This flow updates the "ampi__xx_Indicators_Locked__c" field on a Project record, ensuring the manageIndicators LWC component is appropriately locked.

  1. The flow begins by using a Get element to fetch the Project record where “ampi__xx_Indicators_Locked__c” is set to FALSE. If the user lacks access to that field, an auto-generated error message will be triggered and managed using the fault path to handle exceptions.

  2. A Decision element determines if there are any records to update. If records are available:

    • The “ampi__xx_Indicators_Locked__c” field is updated to TRUE.

    • The updated value is committed using the Update element.

  3. Upon successful update, a flag is set in the Set Record Update Flag element.

  4. If an error occurs during the update process, it is captured and stored in an output variable.

  5. To facilitate debugging, the error message is prefixed with ‘Project-’ to indicate the object on which the error occurred.

ampi__Submit_Framework

This flow involves checking two key conditions for locking: the presence of a framework record and the status of the “ampi__xx_Framework_Locked__c” field.

The decision element (Is Framework Available ?) determines if a framework record is present.

  1. If a record is present, it fetches framework object records where “ampi__xx_Framework_Locked__c” is False.

    1. If any framework record(s) are found:

      1. The "ampi__xx_Framework_Locked__c" field on the Framework object is updated to TRUE.

      2. The updated value is committed using the Update element.

      3. Upon successful update, a flag is set in the Set Record Update Flag element.

    2. If no framework record(s) are found, the Get Record element (Get Updated Frameworks) checks if “ampi__xx_Framework_Locked__c” is True, indicating the framework record has already been updated.

  2. If a Framework record is not present, it fetches project object records where the “ampi__xx_Framework_Locked__c” field is False.

    1. If any project record(s) are found:

      1. The "ampi__xx_Framework_Locked__c" field on the Project object is updated to TRUE.

      2. The updated value is committed using the Update element.

      3. Upon successful update, a flag is set in the Set Record Update Flag element.

    2. If no project record(s) are found, the Get Record element (Get Updated Projects) checks if “ampi__xx_Framework_Locked__c” is True, indicating the project record has already been updated.

This structured approach ensures that the locking mechanism is correctly applied based on the presence and status of framework and project records

ampi__Submit_Submission

This flow utilizes an Information Screen to display necessary instructions and context. After the Information Screen, the recordId for the Submission object record with the Submission record type is obtained through the 'Get Submission Record Type Id' element. This record type ID is then stored in the ID variable.

  1. It fetches submission records where “ampi__Response_Locked__c” is False and the record type ID matches the submission.

  2. It checks if any submission records are present. If present, it passes the list of submissions to the Apex action.

  3. The Apex Action Validates all questions in the database, ensuring they meet the criteria for a valid answer or question within the valid section.

    • Outputs:

      • submissionId: The ID of the valid submission for update action.

      • errorMessage: Stores any validation errors returned by the Apex method.

      • isSuccessful: A flag set to true if the submission contains valid questions and no errors are encountered.

      • submissionsIdForUpdate: A list variable storing the IDs of valid submissions.

  4. It then obtains IDs from the submissionsIdForUpdate output of the Apex action for updating.

  5. It uses a Decision Element to decides whether to update the record or set the flag based on the presence of the submission.

  6. If the record is available for updating, the flow follows the same procedure as in the submit indicator flow.

ampi__Submit_Budget

This flow updates the "ampi__xx_Budget_Locked__c" field on a Budget record, ensuring that budgeting_Cycle cannot be updated and Budgets cannot be updated/uploaded.

  1. The flow begins by using a Get element to fetch the Budget record where “ampi__xx_Budget_Locked__c” is set to FALSE. If the user lacks access to that field, an auto-generated error message will be triggered and managed using the fault path to handle exceptions.

  2. A Decision element determines if there are any records to update. If records are available:

    • The “ampi__xx_Budget_Locked__c” field is updated to TRUE.

    • The updated value is committed using the Update element.

  3. Upon successful update, a flag is set in the "Set Record Update Flag" element.

  4. If an error occurs during the update process, it is captured and stored in an output variable.

  5. To facilitate debugging, the error message is prefixed with "Budget-" to indicate the object on which the error occurred.

ampi_Submit_Activity

This flow updates the "ampi__xx_Implementation_Plan_Locked__c“ field on an Implementation Plan record, ensuring that the activities LWC component is appropriately locked.

  1. The flow begins by using a Get element to fetch an Implementation Plan record where “ampi__xx_Implementation_Plan_Locked__c” is set to FALSE. If the user lacks access to that field, an auto-generated error message will be triggered and managed using the fault path to handle exceptions.

  2. A Decision element determines if there are any records to update. If records are available:

    • The “ampi__xx_Implementation_Plan_Locked__c “field is updated to TRUE.

    • The updated value is committed using the Update element.

  3. Upon successful update, a flag is set in the "Set Record Update Flag" element.

  4. If an error occurs during the update process, it is captured and stored in an output variable.

  5. To facilitate debugging, the error message is prefixed with Implementation Plan- to indicate the object on which the error occurred.

ampi__Submit_Target

This flow begins by expecting a recordId as input, which is obtained from the Reporting Period object. Since the Reporting Period object has 2 different record types: Reporting Period and Baseline, the flow fetches the Reporting Period record type for the locking setTargets component and ensuring Targets cannot be edited/uploaded.

  1. It gets the record type in (Get Reporting Period Record Type Id) element and stores it in the Id variable for further use.

  2. It then fetches a Reporting Period record whose record type is Reporting Period and "ampi__Targets_Locked__c" is false.

  3. A Decision element determines whether to update a record or set a flag for the Information Screen.

  4. If the record is to be updated, the remaining flow proceeds similarly to the previously mentioned flows

ampi__Submit_Baseline

This flow begins by expecting a recordId as input, which is obtained from the Reporting Period object. Since the Reporting Period object has 2 different record types: Reporting Period and Baseline, the flow fetches the Baseline record type for the locking setTargets component and ensuring Baselines cannot be edited/uploaded.

  1. It gets the record type in (Get BaseLine Record Type Id) element and stores it in the Id variable for further use.

  2. It then fetches a Reporting Period record whose record type is Baseline and "ampi__Results_Locked__c" is false.

  3. A Decision element determines whether to update a record or set a flag for the Information Screen.

  4. If the record is to be updated, the remaining flow proceeds similarly to the previously mentioned flows

ampi__Submit_Result

This flow begins by expecting a recordId as input, which is obtained from the Reporting Period object. Since the Reporting Period object has 2 different record types: Reporting Period and Baseline, the flow fetches the Reporting Period record type for the locking addResults component and ensuring that results cannot be edited/uploaded.

  1. It gets the record type in (Get Reporting Period Record Type Id) element and stores it in the Id variable for further use.

  2. It then fetches a Reporting Period record whose record type is Reporting Period and "ampi__Results_Locked__c" is false.

  3. A Decision element determines whether to update a record or set a flag for the Information Screen.

  4. If the record is to be updated, the remaining flow proceeds similarly to the previously mentioned flows

The flows have been enabled as a template, and hence if you want to edit it to meet your organization’s specific use case, you can clone the flow, make the required changes in the cloned flow, and activate the cloned flow.