DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_CUSTOM_RET_VAL_PKG

Source


1 PACKAGE BODY FA_CUSTOM_RET_VAL_PKG as
2 /* $Header: facrvcb.pls 120.3 2005/07/25 09:59:35 yyoon noship $   */
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,
8 	 p_log_level_rec        IN     FA_API_TYPES.log_level_rec_type default null) return boolean IS
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
52 ,p_log_level_rec => p_log_level_rec) THEN 		.
53 	     	RAISE group_asset_required;
54   END IF;
55 */
56 
57 	Return TRUE;
58 
59 Exception
60 
61 -- rn determine method
62 -- potentially create new messages for all these without tokens
63 
64    WHEN category_required THEN
65 	  FND_MESSAGE.SET_NAME('OFA', 'FA_NULL_CATEGORY');
66 	  p_error_message := fnd_message.get;
67       	  Return false;
68 
69    WHEN location_required THEN
70 	  FND_MESSAGE.SET_NAME('OFA','FA_NULL_LOCATION');
71 	  FND_MESSAGE.SET_TOKEN('LOCATION', 'FA_MASS_RETIREMENTS.LOCATION_ID', false);
72 	  p_error_message := fnd_message.get;
73 	  Return false;
74 
75    WHEN units_required THEN
76 	  FND_MESSAGE.SET_NAME('OFA','FA_NULL_FA_UNITS');
77 	  FND_MESSAGE.SET_TOKEN('ASSET_UNITS', 'FA_MASS_RETIREMENTS.UNITS_TO_RETIRE', false);
78 	  p_error_message := fnd_message.get;
79 	  Return false;
80 
81    WHEN group_asset_required THEN
82 	  FND_MESSAGE.SET_NAME('OFA','FA_NULL_GROUP_ASSETS');
83 	  p_error_message := fnd_message.get;
84       	  Return false;
85 
86 END VALIDATE_CRITERIA;
87 END FA_CUSTOM_RET_VAL_PKG;