Define User-Specific Validation for Contracts

In addition to the standard validation process that's done for all contracts, you can define your own user-specific validation for your contracts.

Note: This custom validation package is for on-premises installations.

To define user-specific validation for your contracts:

  1. Create the user-specific packages only in the fusion_dynamic schema.

  2. To prevent the object-does-not-exist compilation error, identify all objects to be queried, and grant access to those objects before creating the package. For example, the grants could be this way:

    • GRANT SELECT ON okc_validate_contract_t TO fusion_dynamic;

    • GRANT INSERT ON okc_validate_contract_t TO fusion_dynamic;

    • GRANT SELECT ON okc_k_headers_all_b TO fusion_dynamic;

  3. Sign in to the application as an administrator, and using the API ADM_DDL.DO_DDL(l_stmt), create the package this way:

    • Package: OKC_CUSTOM_VALIDATION_DYD

    • Procedure: CUSTOM_VALIDATIONS

    • Parameters: IN

    • p_contract_id: Contract Id of the contract i.e okc_k_headers_all_b.id

    • p_major_version: Version of the contract i.e okc_k_headers_all_b.major_version

    • p_sequence_id: Use this sequence_id to insert errors or warning into okc_validate_contract_t

  4. Define user-specific validation messages prefixed with OKC_CUSTOM_ in FND_MESSAGES in the product OKC.

  5. Add validation logic to the procedure OKC_CUSTOM_VALIDATION_DYD.CUSTOM_VALIDATIONS.