16: --
17: g_package varchar2(33) := 'hr_dflex_utility.';
18: g_dfcode_structure l_ignore_dfcode_varray := l_ignore_dfcode_varray();
19: -- Bug fix 1218702.
20: g_debug boolean := hr_utility.debug_enabled;
21: --
22: -- ----------------------------------------------------------------------------
23: -- |------------------------< find_error_segment >-------------------|
24: -- ----------------------------------------------------------------------------
85: -- First get the flexfield information
86: --
87: -- Bug fix 1218702.Debug check added to improve performance.
88: if g_debug then
89: hr_utility.set_location('Entering:'|| l_proc, 10);
90: end if;
91: fnd_dflex.get_flexfield(appl_short_name => p_appl_short_name,
92: flexfield_name => p_flexfield_name,
93: flexfield => l_flexfield,
97: -- Next check that the context is valid, otherwise return the context
98: -- column name and prompt
99: --
100: if g_debug then
101: hr_utility.set_location(l_proc||'>'||to_char(p_error_seg_num)||'<', 20);
102: end if;
103: --
104: if (p_error_seg_num is null) then
105: --
108: -- column name and the context prompt to those associated with the
109: -- context information defined for this flexfield.
110: --
111: if g_debug then
112: hr_utility.set_location(l_proc, 30);
113: end if;
114: --
115: p_application_col_name := l_flexinfo.context_column_name;
116: p_form_left_prompt := l_flexinfo.form_context_prompt;
190: -- sorted list that the flex engine uses when validation occurs (details
191: -- from Gursat Olgun, AOL flex team Oct 1999)
192: --
193: if g_debug then
194: hr_utility.set_location(l_proc, 32);
195: end if;
196: --
197: -- First set up the Global Data Elements flexfield context, which is
198: -- always called 'Global Data Elements', as is not translated.
199: --
200: l_global_context := fnd_dflex.make_context(flexfield => l_flexfield,
201: context_code => 'Global Data Elements');
202: if g_debug then
203: hr_utility.set_location(l_proc, 34);
204: end if;
205: --
206: -- Fetch all enabled segments associated with this context. The flex server
207: -- engine will ignore non-enabled segments - see
210: fnd_dflex.get_segments(context => l_global_context,
211: segments => l_global_segments,
212: enabled_only => true);
213: if g_debug then
214: hr_utility.set_location(l_proc, 36);
215: end if;
216: --
217: -- Store the global set of segments in a structure for later use.
218: -- col1 corresponds to the application column name
227: l_global_segments.application_column_name.last loop
228:
229: -- Bug fix 1218702.
230: if g_debug then
231: hr_utility.set_location(l_proc||' - '||to_char(l_counter), 37);
232: end if;
233: l_segment_info(l_counter).col1 :=
234: l_global_segments.application_column_name(l_counter);
235: l_segment_info(l_counter).col2 := l_global_segments.row_prompt(l_counter);
236: l_global_count := l_global_count+1;
237:
238: -- Bug fix 1218702.
239: if g_debug then
240: hr_utility.set_location(l_global_segments.application_column_name(l_counter)||
241: ' - '||to_char(l_counter), 38);
242: end if;
243: end loop;
244: else
255: -- Next get the specific information if the context is not global data elements
256: --
257: if (p_context_code is not null) then
258: if g_debug then
259: hr_utility.set_location(l_proc, 40);
260: end if;
261: --
262: l_context := fnd_dflex.make_context(flexfield => l_flexfield,
263: context_code => p_context_code);
264: --
265: -- Retrieve the segment information for this context
266: --
267: if g_debug then
268: hr_utility.set_location(l_proc, 50);
269: end if;
270: --
271: fnd_dflex.get_segments(context => l_context,
272: segments => l_segments,
283: l_segment_info(l_counter+l_global_count).col2 :=
284: l_segments.row_prompt(l_counter);
285: -- Bug fix 1218702.Debug check added to improve performance.
286: if g_debug then
287: hr_utility.set_location(l_segments.application_column_name(l_counter)||' - '||
288: to_char(l_global_count+l_counter), 52);
289: end if;
290: end loop;
291: end if;
290: end loop;
291: end if;
292: end if;
293: if g_debug then
294: hr_utility.set_location(l_proc, 55);
295: end if;
296:
297: --
298: -- Next retrieve the application column name corresponding to the segment
306: --
307: end if;
308: --
309: if g_debug then
310: hr_utility.set_location('Leaving: '||l_proc, 60);
311: end if;
312: --
313: end find_error_segment;
314: -----------------------------------------------------------------------------
320: procedure create_ignore_df_validation(p_rec in out nocopy l_ignore_dfcode_varray) is
321: l_proc varchar2(72) := 'create_ignore_df_validation';
322: begin
323: if g_debug then
324: hr_utility.set_location('Entering:'|| l_proc, 10);
325: end if;
326: if p_rec.count <> 0
327: then
328: g_dfcode_structure := p_rec;
327: then
328: g_dfcode_structure := p_rec;
329: end if;
330: if g_debug then
331: hr_utility.set_location('Leaving:'|| l_proc, 20);
332: end if;
333: end create_ignore_df_validation;
334: --
335: -- user calls a population script to populate this array
339: function check_ignore_df_varray(p_structure in varchar2) return boolean is
340: l_proc varchar2(72) := 'check_ignore_df_varray';
341: begin
342: if g_debug then
343: hr_utility.set_location('Entering:'|| l_proc, 10);
344: end if;
345: if g_dfcode_structure.count <> 0
346: then
347: for l_count in g_dfcode_structure.first..g_dfcode_structure.last
352: end if;
353: end loop;
354: end if;
355: if g_debug then
356: hr_utility.set_location('Leaving:'|| l_proc, 20);
357: end if;
358: return false;
359: end;
360: --
364: procedure remove_ignore_df_validation is
365: l_proc varchar2(72) := 'remove_ignore_df_validation';
366: begin
367: if g_debug then
368: hr_utility.set_location('Entering:'|| l_proc, 10);
369: end if;
370: g_dfcode_structure.delete;
371: if g_debug then
372: hr_utility.set_location('Leaving:'|| l_proc, 20);
368: hr_utility.set_location('Entering:'|| l_proc, 10);
369: end if;
370: g_dfcode_structure.delete;
371: if g_debug then
372: hr_utility.set_location('Leaving:'|| l_proc, 20);
373: end if;
374: end;
375: --
376: --
515: open date_set;
516: fetch date_set into l_effective_date;
517: if date_set%notfound then
518: if g_debug then
519: hr_utility.set_location(l_proc,13);
520: end if;
521: l_effective_date := trunc(sysdate);
522: close date_set;
523: else
521: l_effective_date := trunc(sysdate);
522: close date_set;
523: else
524: if g_debug then
525: hr_utility.set_location(l_proc,15);
526: end if;
527: close date_set;
528: end if;
529: --5132936 end
544: p_attr_set_rw_num := p_attr_set_rw_num + 1;
545: --
546: elsif p_attr_value is not null then
547: --
548: hr_utility.set_message(800, 'HR_52993_NULL_DF_SEG_NAME');
549: hr_utility.raise_error;
550: --
551: end if;
552: --
545: --
546: elsif p_attr_value is not null then
547: --
548: hr_utility.set_message(800, 'HR_52993_NULL_DF_SEG_NAME');
549: hr_utility.raise_error;
550: --
551: end if;
552: --
553: end AttributeSet_AddAttrDets;
638: end GetNonExistRows;
639: --
640: begin
641: if g_debug then
642: hr_utility.set_location('Entering:'|| l_proc, 10);
643: end if;
644: --
645: -- Check mandatory parameters have been set
646: --
655: ,p_argument => 'descflex_name'
656: ,p_argument_value => p_descflex_name
657: );
658: if g_debug then
659: hr_utility.set_location(l_proc, 20);
660: end if;
661: --
662: -- 2256742 ignore desc flex validation if flexcode exists in varray:
663: --
665: --
666: if check_ignore_df_varray(l_flex_code)
667: then
668: if g_debug then
669: hr_utility.set_location(l_proc, 25);
670: end if;
671: -- 2256742 no validation required, exit procedure
672: return;
673: else
889: ,p_attr_name => p_attribute30_name
890: ,p_attr_value => p_attribute30_value
891: );
892: if g_debug then
893: hr_utility.set_location(l_proc, 30);
894: end if;
895: --
896: -- Populate the AOL details
897: --
900: fnd_flex_descval.set_context_value
901: (p_attribute_category
902: );
903: if g_debug then
904: hr_utility.set_location(l_proc, 40);
905: end if;
906: --
907: -- Set the descriptive flex column details
908: --
927: end loop;
928: --
929: end if;
930: if g_debug then
931: hr_utility.set_location(l_proc, 40);
932: end if;
933: --
934: -- Validate DF column details passed to AOL
935: --
944: then
945: --
946: -- AOL DF validation succeeds - do nothing
947: --
948: hr_utility.set_location(l_proc, 50);
949: -- Bug fix 1218702.Debug check added to improve performance.
950: if g_debug then
951: FOR i IN 1..20 loop
952: hr_utility.set_location(substr(to_char(i)||'...'
948: hr_utility.set_location(l_proc, 50);
949: -- Bug fix 1218702.Debug check added to improve performance.
950: if g_debug then
951: FOR i IN 1..20 loop
952: hr_utility.set_location(substr(to_char(i)||'...'
953: ||nvl(FND_FLEX_DESCVAL.segment_column_name(i),'NULL VALUE'),1,70),980);
954: END LOOP;
955: end if;
956: --
956: --
957: else
958: -- Bug fix 1218702.Debug check added to improve performance.
959: if g_debug then
960: hr_utility.set_location(substr('--====== FLEX VALUES =====--',1,70),69);
961: hr_utility.set_location(substr('Error segment:'
962: ||nvl(to_char(fnd_flex_descval.error_segment),'CONTEXT'),1,70),970);
963: FOR i IN 1..20 loop
964: hr_utility.set_location(substr(to_char(i)||'...'
957: else
958: -- Bug fix 1218702.Debug check added to improve performance.
959: if g_debug then
960: hr_utility.set_location(substr('--====== FLEX VALUES =====--',1,70),69);
961: hr_utility.set_location(substr('Error segment:'
962: ||nvl(to_char(fnd_flex_descval.error_segment),'CONTEXT'),1,70),970);
963: FOR i IN 1..20 loop
964: hr_utility.set_location(substr(to_char(i)||'...'
965: ||nvl(FND_FLEX_DESCVAL.segment_column_name(i),'NULL VALUE'),1,70),980);
960: hr_utility.set_location(substr('--====== FLEX VALUES =====--',1,70),69);
961: hr_utility.set_location(substr('Error segment:'
962: ||nvl(to_char(fnd_flex_descval.error_segment),'CONTEXT'),1,70),970);
963: FOR i IN 1..20 loop
964: hr_utility.set_location(substr(to_char(i)||'...'
965: ||nvl(FND_FLEX_DESCVAL.segment_column_name(i),'NULL VALUE'),1,70),980);
966: END LOOP;
967: end if;
968: --
967: end if;
968: --
969: -- Raise or trap the AOL error
970: --
971: hr_utility.set_location(l_proc, 60);
972: --
973: -- The FND FLEX DESCVAL package makes a call to FND MESSAGE
974: -- get encoded
975: hr_message.parse_encoded(p_encoded_error =>
973: -- The FND FLEX DESCVAL package makes a call to FND MESSAGE
974: -- get encoded
975: hr_message.parse_encoded(p_encoded_error =>
976: FND_FLEX_DESCVAL.encoded_error_message);
977: hr_utility.set_location(l_proc, 62);
978: --
979: if ((hr_message.last_message_app = 'FND') and
980: (hr_message.last_message_name = 'FLEX-VALUE NOT FOUND')) then
981: --
979: if ((hr_message.last_message_app = 'FND') and
980: (hr_message.last_message_name = 'FLEX-VALUE NOT FOUND')) then
981: --
982: if g_debug then
983: hr_utility.set_location(l_proc, 64);
984: end if;
985: --
986: -- In this case, there was an invalid segment, or context.
987: -- We must allow for the possibility that the context value
1001: p_form_left_prompt => l_flex_seg_error_prompt,
1002: p_table_name => l_table_name
1003: );
1004: if g_debug then
1005: hr_utility.set_location(l_proc || l_flex_seg_error_prompt, 66);
1006: end if;
1007: l_value := hr_message.get_token_value(p_token_name => 'VALUE');
1008: --
1009: -- Now have the additional error information, raise a different error
1019: --
1020: elsif (hr_message.last_message_app = 'FND') and
1021: (hr_message.last_message_name = 'FLEX-NULL SEGMENT') then
1022: if g_debug then
1023: hr_utility.set_location(l_proc, 67);
1024: end if;
1025: --
1026: -- In this case, there was a missing mandatory segment
1027: -- First, work out which segment is in error, and change the
1037: p_form_left_prompt => l_flex_seg_error_prompt,
1038: p_table_name => l_table_name
1039: );
1040: if g_debug then
1041: hr_utility.set_location(l_proc, 68);
1042: end if;
1043: --
1044: -- Now have the additional error information, raise a different error
1045: -- using this information.
1056: -- Some other non-expected error, simply raise the error in the
1057: -- previous fashion.
1058: --
1059: -- Bug fix: 2504004
1060: hr_utility.set_location(l_proc, 69);
1061: -- dbms_standard.raise_application_error
1062: -- (-20001
1063: -- ,fnd_flex_descval.error_message
1064: -- );
1069: end if;
1070: --
1071: end if; -- FND_FLEX_DESCVAL.validate_desccols
1072: if g_debug then
1073: hr_utility.set_location(l_proc, 70);
1074: end if;
1075: --
1076: -- Check if error has been added to multi_message, and if so, do not
1077: -- proceed with following logic
1192: p_form_left_prompt => l_flex_seg_error_prompt,
1193: p_table_name => l_table_name
1194: );
1195: -- raise error
1196: hr_utility.set_message(800,'HR_52763_INV_FORMAT');
1197: hr_utility.set_message_token('VALUE_IN',l_id_in);
1198: hr_utility.set_message_token('VALUE_OUT',l_id_out);
1199: hr_utility.set_message_token('SEGMENT',l_seg_column_name);
1200: hr_multi_message.add
1193: p_table_name => l_table_name
1194: );
1195: -- raise error
1196: hr_utility.set_message(800,'HR_52763_INV_FORMAT');
1197: hr_utility.set_message_token('VALUE_IN',l_id_in);
1198: hr_utility.set_message_token('VALUE_OUT',l_id_out);
1199: hr_utility.set_message_token('SEGMENT',l_seg_column_name);
1200: hr_multi_message.add
1201: (p_associated_column1 => l_table_name || '.' || l_seg_column_name);
1194: );
1195: -- raise error
1196: hr_utility.set_message(800,'HR_52763_INV_FORMAT');
1197: hr_utility.set_message_token('VALUE_IN',l_id_in);
1198: hr_utility.set_message_token('VALUE_OUT',l_id_out);
1199: hr_utility.set_message_token('SEGMENT',l_seg_column_name);
1200: hr_multi_message.add
1201: (p_associated_column1 => l_table_name || '.' || l_seg_column_name);
1202: l_error := true;
1195: -- raise error
1196: hr_utility.set_message(800,'HR_52763_INV_FORMAT');
1197: hr_utility.set_message_token('VALUE_IN',l_id_in);
1198: hr_utility.set_message_token('VALUE_OUT',l_id_out);
1199: hr_utility.set_message_token('SEGMENT',l_seg_column_name);
1200: hr_multi_message.add
1201: (p_associated_column1 => l_table_name || '.' || l_seg_column_name);
1202: l_error := true;
1203: end if;
1215: end if;
1216: --
1217: end loop;
1218: if g_debug then
1219: hr_utility.set_location(l_proc, 80);
1220: end if;
1221: --
1222: -- Get Non Enabled attribute names
1223: --
1227: --
1228: ,p_ne_tor_rws => l_ne_attr_set
1229: );
1230: if g_debug then
1231: hr_utility.set_location(l_proc, 90);
1232: end if;
1233: --
1234: -- Check if non enabled attributes have been provided
1235: --
1247: --
1248: -- Raise the AOL error
1249: --
1250: if g_debug then
1251: hr_utility.set_location(l_proc, 100);
1252: end if;
1253: --
1254: hr_utility.set_message(800, 'HR_52994_NON_EXIST_SEG_NAME');
1255: hr_utility.set_message_token('SEGMENT',l_ne_column_name);
1250: if g_debug then
1251: hr_utility.set_location(l_proc, 100);
1252: end if;
1253: --
1254: hr_utility.set_message(800, 'HR_52994_NON_EXIST_SEG_NAME');
1255: hr_utility.set_message_token('SEGMENT',l_ne_column_name);
1256: hr_utility.set_message_token('VALUE',l_ne_column_value);
1257: hr_multi_message.add
1258: (p_associated_column1 => l_table_name || '.' || l_ne_column_name);
1251: hr_utility.set_location(l_proc, 100);
1252: end if;
1253: --
1254: hr_utility.set_message(800, 'HR_52994_NON_EXIST_SEG_NAME');
1255: hr_utility.set_message_token('SEGMENT',l_ne_column_name);
1256: hr_utility.set_message_token('VALUE',l_ne_column_value);
1257: hr_multi_message.add
1258: (p_associated_column1 => l_table_name || '.' || l_ne_column_name);
1259: --
1252: end if;
1253: --
1254: hr_utility.set_message(800, 'HR_52994_NON_EXIST_SEG_NAME');
1255: hr_utility.set_message_token('SEGMENT',l_ne_column_name);
1256: hr_utility.set_message_token('VALUE',l_ne_column_value);
1257: hr_multi_message.add
1258: (p_associated_column1 => l_table_name || '.' || l_ne_column_name);
1259: --
1260: end if;
1266: --
1267: exception
1268: when app_exception.application_exception then
1269: if hr_multi_message.exception_add then
1270: hr_utility.set_location('Leaving '||l_proc, 110);
1271: raise;
1272: end if;
1273: hr_utility.set_location('Leaving '||l_proc, 120);
1274: end ins_or_upd_descflex_attribs;
1269: if hr_multi_message.exception_add then
1270: hr_utility.set_location('Leaving '||l_proc, 110);
1271: raise;
1272: end if;
1273: hr_utility.set_location('Leaving '||l_proc, 120);
1274: end ins_or_upd_descflex_attribs;
1275: --
1276: end hr_dflex_utility;