29:
30: l_trohdr_rec := INV_Trohdr_Util.Query_row( To_Header_Id );
31:
32: if ( l_trohdr_rec.header_status <> INV_Globals.G_TO_STATUS_INCOMPLETE ) then
33: FND_MESSAGE.SET_NAME('INV','INV_TO_INVALID_FOR_APPROVAL');
34: FND_MESSAGE.SET_TOKEN('ENTITY', To_Header_Id);
35: FND_MSG_PUB.Add;
36: RETURN;
37: else
30: l_trohdr_rec := INV_Trohdr_Util.Query_row( To_Header_Id );
31:
32: if ( l_trohdr_rec.header_status <> INV_Globals.G_TO_STATUS_INCOMPLETE ) then
33: FND_MESSAGE.SET_NAME('INV','INV_TO_INVALID_FOR_APPROVAL');
34: FND_MESSAGE.SET_TOKEN('ENTITY', To_Header_Id);
35: FND_MSG_PUB.Add;
36: RETURN;
37: else
38: Select nvl(TXN_APPROVAL_TIMEOUT_PERIOD,0)
93: l_wf_item_exists := wf_item.item_exist( itemtype => l_ItemType,
94: itemkey => l_ItemKey );
95: if ( l_wf_item_exists ) then
96: -- inv_Debug.message('item exists');
97: FND_MESSAGE.SET_NAME('INV','INV_ALREADY_EXISTS');
98: FND_MESSAGE.SET_TOKEN('ENTITY','Approval Process');
99: FND_MSG_PUB.Add;
100: else
101: --Inv_debug.message(' creating the process');
94: itemkey => l_ItemKey );
95: if ( l_wf_item_exists ) then
96: -- inv_Debug.message('item exists');
97: FND_MESSAGE.SET_NAME('INV','INV_ALREADY_EXISTS');
98: FND_MESSAGE.SET_TOKEN('ENTITY','Approval Process');
99: FND_MSG_PUB.Add;
100: else
101: --Inv_debug.message(' creating the process');
102: wf_engine.createprocess( itemtype => l_ItemType,
174: wf_engine.startprocess( itemtype => l_ItemType,
175: itemkey => l_ItemKey );
176:
177: --inv_debug.message('Started the process' );
178: FND_MESSAGE.SET_NAME('INV','INV_APPROVAL_LAUNCHED');
179: FND_MSG_PUB.Add;
180: end if;
181:
182: Exception