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.
To define user-specific validation for your contracts:
-
Create the user-specific packages only in the fusion_dynamic schema.
-
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;
-
-
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
-
-
Define user-specific validation messages prefixed with OKC_CUSTOM_ in FND_MESSAGES in the product OKC.
-
Add validation logic to the procedure OKC_CUSTOM_VALIDATION_DYD.CUSTOM_VALIDATIONS.