1 PACKAGE BODY FA_CUSTOM_RET_VAL_PKG as
2 /* $Header: facrvcb.pls 120.4 2009/03/27 08:54:45 bridgway ship $ */
3
4
5 FUNCTION VALIDATE_CRITERIA
6 (px_mass_ret_rec IN FA_CUSTOM_RET_VAL_PKG.mass_ret_rec_type,
7 p_error_message OUT NOCOPY varchar2, p_log_level_rec IN FA_API_TYPES.log_level_rec_type) return boolean IS
8
9
10
11
12 l_mass_ret_rec fa_custom_ret_val_pkg.mass_ret_rec_type;
13
14 Category_required Exception;
15 Location_required Exception;
16 Units_required Exception;
17 Group_asset_required Exception;
18
19 Begin
20
21
22 -- columns in fa_mass_retirements are now available
23 -- reference through l_mass_ret_rec.mass_retirement_id etc.
24 --
25
26 l_mass_ret_rec := px_mass_ret_rec;
27
28 /* ACTIVATE AND CUSTOMIZE THIS SECTION IF ADDITIONAL
29 VALIDATION IS WANTED IN Create Mass Retirements form
30 OR IN Process Pending Retirements Criteria. */
31
32 --
33 /*
34 IF l_mass_ret_rec.category_id is null THEN
35 RAISE category_required;
36 END IF;
37 */
38 --
39 /*
40 IF l_mass_ret_rec.location_id is null THEN
41 RAISE location_required;
42 END IF;
43 */
44 /*
45 IF l_mass_ret_rec.units is null THEN
46 RAISE units_required;
47 END IF;
48 */
49 /*
50 IF (l_mass_ret_rec.group_asset_id is null
51 and l_mass_ret_rec.project_id is not null) THEN .
52 RAISE group_asset_required;
53 END IF;
54 */
55
56 Return TRUE;
57
58 Exception
59
60 -- rn determine method
61 -- potentially create new messages for all these without tokens
62
63 WHEN category_required THEN
64 FND_MESSAGE.SET_NAME('OFA', 'FA_NULL_CATEGORY');
65 p_error_message := fnd_message.get;
66 Return false;
67
68 WHEN location_required THEN
69 FND_MESSAGE.SET_NAME('OFA','FA_NULL_LOCATION');
70 FND_MESSAGE.SET_TOKEN('LOCATION', 'FA_MASS_RETIREMENTS.LOCATION_ID', false);
71 p_error_message := fnd_message.get;
72 Return false;
73
74 WHEN units_required THEN
75 FND_MESSAGE.SET_NAME('OFA','FA_NULL_FA_UNITS');
76 FND_MESSAGE.SET_TOKEN('ASSET_UNITS', 'FA_MASS_RETIREMENTS.UNITS_TO_RETIRE', false);
77 p_error_message := fnd_message.get;
78 Return false;
79
80 WHEN group_asset_required THEN
81 FND_MESSAGE.SET_NAME('OFA','FA_NULL_GROUP_ASSETS');
82 p_error_message := fnd_message.get;
83 Return false;
84
85 END VALIDATE_CRITERIA;
86 END FA_CUSTOM_RET_VAL_PKG;