API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type...

364
Oracle CRM Application Foundation API Reference Guide Release 11i August 2002 Part No. A90092-05

Transcript of API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type...

Page 1: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Oracle CRM Application Foundation

API Reference Guide

Release 11i

August 2002

Part No. A90092-05

Page 2: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Oracle CRM Application Foundation API Reference Guide, Release 11i

Part No. A90092-05

Copyright © 2001, 2002, Oracle Corporation. All rights reserved.

Primary Authors: Charles Colt, Carol Fager-Higgins, Kellie Briesach, Robert Geiwitz, Melody Yang

Contributors: Sharad Mathur, Rajesh Singh, Huub Bouten, Colin Furtaw, Rick Day, Kerry Murphey, Mike Petrosino

The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent and other intellectual and industrial property laws. Reverse engineering, disassembly or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited.

The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.

If the Programs are delivered to the US Government or anyone licensing or using the Programs on behalf of the US Government, the following notice is applicable:

RESTRICTED RIGHTS NOTICE

Programs delivered subject to the DOD FAR Supplement are 'commercial computer software' and use, duplication and disclosure of the Programs including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are 'restricted computer software' and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065.

The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be licensee's responsibility to take all appropriate fail-safe, back up, redundancy and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the Programs.

Oracle is a registered trademark, and PL/SQL and SQL*Plus are trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners.

Page 3: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Contents

Send Us Your Comments ................................................................................................................... xi

Preface........................................................................................................................................................... xiii

Audience for This Guide ..................................................................................................................... xiiiHow To Use This Guide ..................................................................................................................... xivTypographic Conventions ................................................................................................................... xvDocumentation Accessibility .............................................................................................................. xvOther Information Sources ................................................................................................................. xviDo Not Use Database Tools to Modify Oracle Applications Data ................................................ xxAbout Oracle ........................................................................................................................................ xxi

1 Introduction

1.1 Parameter Specifications ...................................................................................................... 1-21.1.1 Standard IN Parameters................................................................................................ 1-21.1.2 Standard OUT Parameters............................................................................................ 1-31.1.3 Parameter Size ................................................................................................................ 1-41.1.4 Missing Parameter Attributes ...................................................................................... 1-41.1.5 Parameter Validations ................................................................................................... 1-51.1.6 Invalid Parameters ......................................................................................................... 1-51.2 Version Information.............................................................................................................. 1-51.3 Status Messages ..................................................................................................................... 1-6

2 Interaction History Public APIs

2.1 Customer Interaction ........................................................................................................... 2-12.1.1 Media Item ...................................................................................................................... 2-22.1.2 Media Lifecycle............................................................................................................... 2-32.1.3 Activity ............................................................................................................................ 2-32.1.4 Interaction ....................................................................................................................... 2-32.1.5 Relating Customer Interaction Information............................................................... 2-3

iii

Page 4: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

2.2 Package JTF_IH_PUB............................................................................................................ 2-42.2.1 Data Structure Specifications........................................................................................ 2-52.2.1.1 Interaction Record Type......................................................................................... 2-52.2.1.2 Activity Record Type.............................................................................................. 2-62.2.1.3 Media Item Record Type........................................................................................ 2-72.2.1.4 Media Item Lifecycle Record Type ....................................................................... 2-72.3 Non-cached Creation APIs................................................................................................... 2-82.3.1 Overview ......................................................................................................................... 2-82.3.2 Process Flow.................................................................................................................... 2-92.3.3 Create_MediaItem........................................................................................................ 2-102.3.4 Create_MediaLifecycle ................................................................................................ 2-122.3.5 Create_Interaction ........................................................................................................ 2-142.4 Cached Creation APIs ......................................................................................................... 2-172.4.1 Overview ....................................................................................................................... 2-182.4.2 Process Flows ................................................................................................................ 2-192.4.3 Open_MediaItem.......................................................................................................... 2-272.4.4 Update_MediaItem ...................................................................................................... 2-282.4.5 Add_MediaLifecycle.................................................................................................... 2-302.4.6 Update_MediaLifecycle............................................................................................... 2-322.4.7 Close_MediaItem.......................................................................................................... 2-342.4.8 Open_Interaction.......................................................................................................... 2-362.4.9 Update_Interaction ...................................................................................................... 2-392.4.10 Add_Activity................................................................................................................. 2-412.4.11 Update_Activity ........................................................................................................... 2-432.4.12 Update_ActivityDuration ........................................................................................... 2-452.4.13 Close_Interaction.......................................................................................................... 2-472.5 Counting APIs...................................................................................................................... 2-492.5.1 Overview ....................................................................................................................... 2-492.5.2 Get_InteractionActivityCount .................................................................................... 2-492.5.3 Get_InteractionCount .................................................................................................. 2-512.6 Messages and Notifications ............................................................................................... 2-542.6.1 JTF_IH_PUB .................................................................................................................. 2-552.6.1.1 Create_Interaction................................................................................................. 2-552.6.1.2 Open_MediaItem .................................................................................................. 2-562.6.1.3 Update_MediaItem ............................................................................................... 2-57

iv

Page 5: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

2.6.1.4 Add_MediaLifecycle ............................................................................................ 2-572.6.1.5 Close_MediaItem .................................................................................................. 2-582.6.1.6 Open_Interaction .................................................................................................. 2-582.6.1.7 Update_Interaction ............................................................................................... 2-602.6.1.8 Add_Activity ......................................................................................................... 2-612.6.1.9 Update_Activity .................................................................................................... 2-622.6.1.10 Close_Interaction .................................................................................................. 2-632.7 Sample Code ........................................................................................................................ 2-642.7.1 Non-cached Creation APIs ......................................................................................... 2-652.7.1.1 Create_MediaItem................................................................................................. 2-652.7.1.2 Create_MediaLifecycle......................................................................................... 2-682.7.1.3 Create_Interaction................................................................................................. 2-702.7.2 Cached Creation APIs ................................................................................................. 2-742.7.2.1 Open_MediaItem .................................................................................................. 2-742.7.2.2 Update_MediaItem............................................................................................... 2-772.7.2.3 Add_MediaLifecycle ............................................................................................ 2-802.7.2.4 Update_MediaLifecycle ....................................................................................... 2-832.7.2.5 Close_MediaItem .................................................................................................. 2-852.7.2.6 Open_Interaction .................................................................................................. 2-882.7.2.7 Update_Interaction ............................................................................................... 2-922.7.2.8 Add_Activity ......................................................................................................... 2-942.7.2.9 Update_Activity .................................................................................................... 2-992.7.2.10 Update_ActivityDuration.................................................................................. 2-1012.7.2.11 Close_Interaction ................................................................................................ 2-1042.7.3 Counting APIs ............................................................................................................ 2-1082.7.3.1 Get_InteractionActivityCount........................................................................... 2-1082.7.3.2 Get_InteractionCount......................................................................................... 2-110

3 Resource Manager Public APIs

3.1 Resource Manager Public Packages ................................................................................... 3-13.1.1 Resource Manager Public APIs .................................................................................... 3-23.2 Package JTF_RS_RESOURCE_PUB .................................................................................... 3-33.2.1 Create_Resource ............................................................................................................. 3-33.2.2 Update_Resource ......................................................................................................... 3-113.3 Package JTF_RS_GROUPS_PUB ....................................................................................... 3-19

v

Page 6: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

3.3.1 Create_Resource_Group.............................................................................................. 3-193.3.2 Update_Resource_Group............................................................................................ 3-213.4 Package JTF_RS_SALESREPS_PUB.................................................................................. 3-243.4.1 Create_SalesRep ........................................................................................................... 3-243.4.2 Update_SalesRep.......................................................................................................... 3-283.5 Messages and Notifications ............................................................................................... 3-313.5.1 JTF_RS_RESOURCE_PUB........................................................................................... 3-323.5.1.1 Create_Resource .................................................................................................... 3-323.5.1.2 Update_Resource .................................................................................................. 3-353.5.2 JTF_RS_GROUPS_PUB................................................................................................ 3-373.5.2.1 Create_Resource_Group ...................................................................................... 3-373.5.2.2 Update_Resource_Group..................................................................................... 3-383.5.3 JTF_RS_SALESREPS_PUB .......................................................................................... 3-393.5.3.1 Create_SalesRep .................................................................................................... 3-393.5.3.2 Update_SalesRep................................................................................................... 3-413.6 Sample Code......................................................................................................................... 3-423.6.1 JTF_RS_RESOURCE_PUB........................................................................................... 3-423.6.1.1 Create_Resource .................................................................................................... 3-423.6.1.2 Update_Resource .................................................................................................. 3-453.6.2 JTF_RS_GROUPS_PUB................................................................................................ 3-493.6.2.1 Create_Resource_Group Sample Code.............................................................. 3-493.6.2.2 Update_Resource_Group Sample Code ............................................................ 3-513.6.3 JTF_RS_SALESREPS_PUB .......................................................................................... 3-533.6.3.1 Create_SalesRep Sample Code............................................................................ 3-533.6.3.2 Update_SalesRep Sample Code .......................................................................... 3-55

4 Task Manager Public APIs

4.1 Task Manager Public Packages ........................................................................................... 4-14.2 Package JTF_TASKS_PUB.................................................................................................... 4-54.2.1 Data Structure Specifications........................................................................................ 4-54.2.1.1 Task Assign Record Type....................................................................................... 4-54.2.1.2 Task Dependency Record Type ............................................................................ 4-64.2.1.3 Task Reference Record Type ................................................................................. 4-64.2.1.4 Task Recurrence Record Type............................................................................... 4-64.2.1.5 Task Dates Record Type......................................................................................... 4-7

vi

Page 7: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

4.2.1.6 Task Contact Record Type..................................................................................... 4-74.2.1.7 Task Notes Record Type ........................................................................................ 4-74.2.1.8 Sort Record Type..................................................................................................... 4-84.2.2 Create_Task..................................................................................................................... 4-94.2.3 Update_Task ................................................................................................................. 4-194.2.4 Delete_Task ................................................................................................................... 4-274.3 Package JTF_TASKS_ASSIGNMENTS_PUB................................................................... 4-294.3.1 Data Structure Specifications...................................................................................... 4-294.3.1.1 Task Assignments Record Type.......................................................................... 4-294.3.2 Create_Task_Assignment ........................................................................................... 4-304.3.3 Update_Task_Assignment.......................................................................................... 4-364.3.4 Delete_Task_Assignment............................................................................................ 4-404.4 Package JTF_TASK_REFERENCES_PUB ........................................................................ 4-424.4.1 Data Structure Specifications...................................................................................... 4-424.4.1.1 References Record Type....................................................................................... 4-424.4.2 Create_References ........................................................................................................ 4-434.4.3 Update_References ...................................................................................................... 4-464.4.4 Delete_References ........................................................................................................ 4-494.5 Messages and Notifications ............................................................................................... 4-504.5.1 Common Messages ...................................................................................................... 4-514.5.2 JTF_TASK_ASSIGNMENTS_PUB............................................................................. 4-544.5.3 JTF_TASK_REFERENCES_PUB................................................................................. 4-544.5.4 JTF_TASKS_PUB .......................................................................................................... 4-554.6 Sample Code ........................................................................................................................ 4-564.6.1 Package JTF_TASKS_PUB .......................................................................................... 4-574.6.2 Package JTF_TASK_ASSIGNMENTS_PUB ............................................................. 4-614.6.3 Package JTF_TASK_REFERENCES_PUB................................................................. 4-64

5 Notes Public APIs

5.1 Package JTF_NOTES_PUB................................................................................................... 5-15.1.1 Data Structure Specifications........................................................................................ 5-25.1.1.1 Record jtf_note_contexts_rec_type....................................................................... 5-25.1.2 Notes Public APIs........................................................................................................... 5-25.1.3 Note Source and Note Context..................................................................................... 5-25.1.3.1 Note Source.............................................................................................................. 5-3

vii

Page 8: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

5.1.3.2 Note Context ............................................................................................................ 5-35.1.4 Party Relationships ........................................................................................................ 5-45.1.5 Create_Note..................................................................................................................... 5-55.1.6 Update_Note ................................................................................................................. 5-115.2 Messages and Notifications ............................................................................................... 5-135.2.1 JTF_NOTES_PUB ......................................................................................................... 5-145.3 Sample Code......................................................................................................................... 5-145.3.1 Package JTF_NOTES_PUB.......................................................................................... 5-145.3.1.1 Create_Note ........................................................................................................... 5-155.3.1.2 Update_Note.......................................................................................................... 5-17

6 Fulfillment Engine Public APIs

6.1 Package JTF_FM_REQUEST_GRP...................................................................................... 6-16.1.1 Data Structure Specifications........................................................................................ 6-26.1.1.1 History Records....................................................................................................... 6-26.1.1.2 Status Records.......................................................................................................... 6-36.2 Submitting a Fulfillment Request ....................................................................................... 6-46.3 Forming an XML Request .................................................................................................... 6-76.3.1 The <ffm_request> Root Element ................................................................................ 6-76.3.1.1 The <app_info> Element........................................................................................ 6-86.3.1.2 The <item> Element................................................................................................ 6-96.3.2 The Fulfillment Request Document Type Definition (DTD) ................................. 6-116.3.3 Example XML Fulfillment Request............................................................................ 6-136.4 The Fulfillment APIs ........................................................................................................... 6-156.4.1 Start_Request ................................................................................................................ 6-156.4.2 Get_Content_XML........................................................................................................ 6-166.4.3 Submit_Request ............................................................................................................ 6-226.4.4 Send_Request ................................................................................................................ 6-266.4.5 Cancel_Request............................................................................................................. 6-316.4.6 Resubmit_Request........................................................................................................ 6-336.5 Messages and Notifications ............................................................................................... 6-346.5.1 Common Messages ...................................................................................................... 6-356.5.2 Get_Content_XML........................................................................................................ 6-366.5.3 Send_Request ................................................................................................................ 6-366.5.4 Cancel_Request............................................................................................................. 6-37

viii

Page 9: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

6.6 Sample Code ........................................................................................................................ 6-376.6.1 Package JTF_FM_REQUEST_GRP............................................................................. 6-376.6.1.1 Send Document ..................................................................................................... 6-376.6.1.2 2 Send Document with Bind Variables .............................................................. 6-406.6.1.3 Send Compressed Document .............................................................................. 6-436.6.1.4 Send Compressed File with Image and Bind Variables .................................. 6-466.6.1.5 Send Document with Query................................................................................ 6-496.6.1.6 Send Document with Bind Variables and Query ............................................. 6-526.6.1.7 Send compressed file with master document, query, bind variable, and image ...

6-556.6.1.8 Send Document with a Query that Returns Multiple Rows........................... 6-586.6.1.9 Send Multiple Documents ................................................................................... 6-616.6.1.10 Send Document as Attachment........................................................................... 6-65

Index

ix

Page 10: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

x

Page 11: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Send Us Your Comments

Oracle CRM Application Foundation API Reference Guide, Release 11i

Part No. A90092-05

Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this publication. Your input is an important part of the information used for revision.

■ Did you find any errors?■ Is the information clearly presented?■ Do you need more information? If so, where?■ Are the examples correct? Do you need more examples?■ What features did you like most about this manual?

If you find any errors or have any other suggestions for improvement, please indicate the chapter, section, and page number (if available). You can send comments to us at:

Oracle Corporation Oracle CRM Application Foundation, Content Development Manager500 Oracle ParkwayRedwood Shores, CA 94065USA

If you would like a reply, please give your name, address, and telephone number below.

xi

Page 12: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

xii

Page 13: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Preface

Audience for This GuideWelcome to Release 11i of the Oracle CRM Application Foundation API Reference Guide. This manual describes the CRM Application Foundation’s public APIs, and provides information to help you work effectively with these public APIs.

This guide assumes you have a working knowledge of the following:

■ The principles and customary practices of your business area

■ Oracle CRM Application Foundation

If you have never used the Oracle CRM Application Foundation modules, Oracle suggests you attend one or more of the Oracle CRM Application Foundation training classes available through Oracle University.

Note: This document provides API information for the following Oracle CRM Application Foundation modules only:

■ Interaction History

■ Resource Manager

■ Task Manager

■ Fulfillment

■ Notes

xiii

Page 14: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

■ The Oracle Applications graphical user interface

To learn more about the Oracle Applications graphical user interface, read the Oracle Applications User’s Guide. See "Other Information Sources" for more information about Oracle Applications product information.

This preface explains how the Reference Guide is organized and introduces other sources of information that can help you.

How To Use This GuideThis manual contains the following chapters:

Chapter Title Summary

Chapter 1 Introduction Discusses the following topics:

■ API and parameter specifications

■ Standard IN and OUT parameters

■ Status messages

Chapter 2 Interaction History Public APIs

Discusses the Interaction History public package (JTF_IH_PUB), and the associated public APIs.

Chapter 3 Resource Manager Public APIs

Discusses the following Resource Manager public packages, and the associated public APIs:

■ JTF_RESOURCES_PUB

■ JTF_RS_GROUP_PUB

■ JTF_RS_SALESREPS_PUB

Chapter 4 Task Manager Public APIs

Discusses the following Task Manager public packages, and the associated public APIs:

■ JTF_TASKS_PUB

■ JTF_TASK_ASSIGNMENT_PUB

■ JTF_TASK_REFERENCES_PUB

Chapter 5 Fulfillment Engine Public APIs

Discusses the Fulfillment public package (JTF_FM_REQUEST_GRP) and the associated public APIs.

xiv

Page 15: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Typographic ConventionsThis document uses the following typographic conventions:

Documentation Accessibility Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Standards will continue to evolve over time, and Oracle Corporation is actively engaged with other

Chapter 6 Notes Public APIs Discusses the Notes public package (JTF_NOTES_PUB), and the associated public APIs.

Convention Description

Monospace text Monospace text represents code or SQL statements.

lowercase italics Lowercase italics in the text represent variables. Substitute an appropriate value for the variable.

UPPERCASE Uppercase characters within the text represent command names, SQL reserved words and keywords, and terms associated with the Oracle database.

Indentation Indentation helps to show structure within code examples, but is not required.

<text> Text inside angle brackets can mean either of the following:

■ It denotes a variable that is replaced with an actual value at runtime.

■ In indicates XML elements in discussions about XML code.

Chapter Title Summary

xv

Page 16: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For additional information, visit the Oracle Accessibility Program Web site at http://www.oracle.com/accessibility/.

Accessibility of Code Examples in DocumentationJAWS, a Windows screen reader, may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, JAWS may not always read a line of text that consists solely of a bracket or brace.

Accessibility of Links to External Web Sites in Documentation This documentation may contain links to Web sites of other companies or organizations that Oracle Corporation does not own or control. Oracle Corporation neither evaluates nor makes any representations regarding the accessibility of these Web sites.

Other Information SourcesYou can choose from many sources of information, including online documentation, training, and support services, to increase your knowledge and understanding of Oracle CRM Application Foundation.

If this guide refers you to other Oracle Applications documentation, use only the Release 11i versions of those guides.

Online DocumentationAll Oracle Applications documentation is available online (HTML or PDF). Online help patches are available on MetaLink.

Related DocumentationOracle CRM Application Foundation shares business and setup information with other Oracle Applications products. Therefore, you may want to refer to other product documentation when you set up and use Oracle CRM Application Foundation

xvi

Page 17: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

You can read the documents online by reading from the Oracle Applications Document Library CD included in your media pack, or by using a Web browser with a URL that your system administrator provides.

If you require printed guides, you can purchase them from the Oracle Store at http://oraclestore.oracle.com.

Documents Related to All Products

Oracle Applications User’s GuideThis guide explains how to enter data, query, run reports, and navigate using the graphical user interface (GUI) available with this release of Oracle CRM Application Foundation (and any other Oracle Applications products). This guide also includes information on setting user profiles, as well as running and reviewing reports and concurrent processes.

You can access this user’s guide online by choosing”Getting Started with Oracle Applications” from any Oracle Applications help file.

Documents Related to This Product

Oracle CRM Application Foundation Implementation GuideUse this manual to understand the necessary configuration and setup steps that need to be performed after the Oracle CRM Application Foundation modules are installed.

Oracle CRM Application User GuideThis manual provides basic conceptual and reference information needed to understand the Oracle CRM Application Foundation modules. In addition, it details the procedures performed by a typical end-user of the Oracle CRM Application Foundation modules.

Installation and System Administration

Oracle Applications ConceptsThis guide provides an introduction to the concepts, features, technology stack, architecture, and terminology for Oracle Applications Release 11i. It provides a useful first book to read before an installation of Oracle Applications. This guide also introduces the concepts behind Applications-wide features such as Business Intelligence (BIS), languages and character sets, and Self-Service Web Applications.

xvii

Page 18: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Installing Oracle ApplicationsThis guide provides instructions for managing the installation of Oracle Applications products. In Release 11i, much of the installation process is handled using Oracle Rapid Install, which minimizes the time to install Oracle Applications, the Oracle8 technology stack, and the Oracle8i Server technology stack by automating many of the required steps. This guide contains instructions for using Oracle Rapid Install and lists the tasks you need to perform to finish your installation. You should use this guide in conjunction with individual product user’s guides and implementation guides.

Oracle Applications Supplemental CRM Installation StepsThis guide contains specific steps needed to complete installation of a few of the CRM products. The steps should be done immediately following the tasks given in the Installing Oracle Applications guide.

Upgrading Oracle ApplicationsRefer to this guide if you are upgrading your Oracle Applications Release 10.7 or Release 11.0 products to Release 11i. This guide describes the upgrade process and lists database and product-specific upgrade tasks. You must be either at Release 10.7 (NCA, SmartClient, or character mode) or Release 11.0, to upgrade to Release 11i. You cannot upgrade to Release 11i directly from releases prior to 10.7.

Maintaining Oracle ApplicationsUse this guide to help you run the various AD utilities, such as AutoUpgrade, AutoPatch, AD Administration, AD Controller, AD Relink, License Manager, and others. It contains how-to steps, screenshots, and other information that you need to run the AD utilities. This guide also provides information on maintaining the Oracle applications file system and database.

Oracle Applications System Administrator’s GuideThis guide provides planning and reference information for the Oracle Applications System Administrator. It contains information on how to define security, customize menus and online help, and manage concurrent processing.

Oracle Alert User’s GuideThis guide explains how to define periodic and event alerts to monitor the status of your Oracle Applications data.

xviii

Page 19: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Oracle Applications Developer’s GuideThis guide contains the coding standards followed by the Oracle Applications development staff. It describes the Oracle Application Object Library components needed to implement the Oracle Applications user interface described in the Oracle Applications User Interface Standards for Forms-Based Products. It also provides information to help you build your custom Oracle Forms Developer 6i forms so that they integrate with Oracle Applications.

Oracle Applications User Interface Standards for Forms-Based ProductsThis guide contains the user interface (UI) standards followed by the Oracle Applications development staff. It describes the UI for the Oracle Applications products and how to apply this UI to the design of an application built by using Oracle Forms.

Other Implementation Documentation

Oracle Workflow GuideThis guide explains how to define new workflow business processes as well as customize existing Oracle Applications-embedded workflow processes. You also use this guide to complete the setup steps necessary for any Oracle Applications product that includes workflow-enabled processes.

Oracle eTechnical Reference ManualsEach eTechnical Reference Manual (eTRM) contains database diagrams and a detailed description of database tables, forms, reports, and programs for a specific Oracle Applications product. This information helps you convert data from your existing applications, integrate Oracle Applications data with non-Oracle applications, and write custom reports for Oracle Applications products. Oracle eTRM is available on Metalink

Oracle Manufacturing APIs and Open Interfaces ManualThis manual contains up-to-date information about integrating with other Oracle Manufacturing applications and with your other systems. This documentation includes APIs and open interfaces found in Oracle Manufacturing.

Oracle Order Management Suite APIs and Open Interfaces ManualThis manual contains up-to-date information about integrating with other Oracle Manufacturing applications and with your other systems. This documentation includes APIs and open interfaces found in Oracle Order Management Suite.

xix

Page 20: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Oracle Applications Message Reference ManualThis manual describes Oracle Applications messages. This manual is available in HTML format on the documentation CD-ROM for Release 11i.

Training and Support

TrainingOracle offers training courses to help you and your staff master the Oracle CRM Application Foundation modules and reach full productivity quickly. You have a choice of educational environments:

■ You can attend courses offered by Oracle University at any one of our many Education Centers.

■ You can arrange for our trainers to teach at your facility.

■ You can use Oracle Learning Network (OLN), Oracle University's online education utility.

In addition, Oracle training professionals can tailor standard courses or develop custom courses to meet your needs. For example, you may want to use your organization’s structure, terminology, and data as examples in a customized training session delivered at your own facility.

SupportFrom on-site support to central support, our team of experienced professionals provides the help and information you need to keep the Oracle CRM Application Foundation modules working for you. This team includes your Technical Representative, Account Manager, and Oracle’s large staff of consultants and support specialists with expertise in your business area, managing an Oracle8i server, and your hardware and software environment.

OracleMetaLinkOracleMetaLink is your self-service support connection with web, telephone menu, and e-mail alternatives. Oracle supplies these technologies for your convenience, available 24 hours a day, 7 days a week. With OracleMetaLink, you can obtain information and advice from technical libraries and forums, download patches, download the latest documentation, look at bug details, and create or update TARs. To use MetaLink, register at (http://metalink.oracle.com).

Alerts: You should check OracleMetaLink alerts before you begin to install or upgrade any of your Oracle Applications. Navigate to the Alerts page as follows:

xx

Page 21: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Technical Libraries/ERP Applications/Applications Installation and Upgrade/Alerts.

Self-Service Toolkit: You may also find information by navigating to the Self-Service Toolkit page as follows: Technical Libraries/ERP Applications/Applications Installation and Upgrade.

Do Not Use Database Tools to Modify Oracle Applications DataOracle STRONGLY RECOMMENDS that you never use SQL*Plus, Oracle Data Browser, database triggers, or any other tool to modify Oracle Applications data unless otherwise instructed.

Oracle provides powerful tools you can use to create, store, change, retrieve, and maintain information in an Oracle database. But if you use Oracle tools such as SQL*Plus to modify Oracle Applications data, you risk destroying the integrity of your data and you lose the ability to audit changes to your data.

Because Oracle Applications tables are interrelated, any change you make using Oracle Applications can update many tables at once. But when you modify Oracle Applications data using anything other than Oracle Applications, you may change a row in one table without making corresponding changes in related tables. If your tables get out of synchronization with each other, you risk retrieving erroneous information and you risk unpredictable results throughout Oracle Applications.

When you use Oracle Applications to modify your data, Oracle Applications automatically checks that your changes are valid. Oracle Applications also keeps track of who changes information. If you enter information into database tables using database tools, you may store invalid information. You also lose the ability to track who has changed your information because SQL*Plus and other database tools do not keep a record of changes.

About OracleOracle Corporation develops and markets an integrated line of software products for database management, applications development, decision support, and office automation, as well as Oracle Applications, an integrated suite of more than 160 software modules for financial management, supply chain management, manufacturing, project systems, human resources and customer relationship management.

Oracle products are available for mainframes, minicomputers, personal computers, network computers and personal digital assistants, allowing organizations to

xxi

Page 22: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

integrate different computers, different operating systems, different networks, and even different database management systems, into a single, unified computing and information resource.

Oracle is the world’s leading supplier of software for information management, and the world’s second largest software company. Oracle offers its database, tools, and applications products, along with related consulting, education, and support services, in over 145 countries around the world.

xxii

Page 23: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Introd

1

Introduction

Oracle CRM contains the following types of APIs:

■ Private APIs are for internal, development use only. Details are not provided to anyone outside of the immediate development environment, nor are they intended for use by anyone outside of the CRM development environment.

■ Public APIs are designed for customers and Oracle consultants to integrate non-Oracle systems into CRM or to extend the functionality of the base products. Oracle does not support public APIs unless they are published in a reference manual such as this one. The user accepts all risk and responsibility for working with non-published public APIs.

■ Public, published APIs are guaranteed by Oracle to remain valid from release to release and that patches will not alter the API behavior. Public, published APIs are supported by Oracle to the same extent as released software.

For non-published APIs, Oracle expressly does not provide any guarantees regarding consistency of naming, usage, or behavior of any API (public or private) between releases. It is also possible that a patch could alter any characteristic of any non-published CRM API. As such, those who choose to use these APIs do so at their own risk. However, Oracle does attempt to minimize all changes to public APIs, even if not published.

The CRM Application Foundation APIsThe public APIs provided by the Oracle CRM Application Foundation and described in this document are divided into groups of public packages. There are one or more packages for each of the following Foundation modules covered here:

■ Interaction History

■ Resource Manager

uction 1-1

Page 24: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Parameter Specifications

■ Task Manager

■ Fulfillment

■ Notes

Each published API provides an API specification, and definitions as for its parameters, data structures, and status messages. Sample scripts and documented process flow diagrams are included where applicable.

1.1 Parameter SpecificationsThe specifications for the public APIs provided by the Oracle CRM Application Foundation define four categories of parameters:

■ Standard IN

■ Standard OUT

■ Procedure specific IN

■ Procedure specific OUT

Standard IN and OUT parameters are specified by the Oracle Applications business object API Coding Standards, and are discussed in the following sections.

Procedure specific IN and OUT parameter are related to the API being specified, and are discussed with that individual API.

1.1.1 Standard IN ParametersThe following table describes standard IN parameters, which are common to all public APIs provided by Oracle CRM Application Foundation.

Note: The words procedure and API are used interchangeably in this document.

Table 1–1 Standard IN Parameters

Parameter Data Type Required Description

p_api_version NUMBER Yes This must match the version number of the API. An unexpected error is returned if the calling program version number is incompatible with the current API version number (provided in the documentation).

1-2 Oracle CRM Application Foundation API Reference Guide

Page 25: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Parameter Specifications

1.1.2 Standard OUT ParametersThe following table describes standard OUT parameters, which are common to all public APIs provided by Oracle CRM Application Foundation.

p_init_msg_list VARCHAR2 Yes The valid values for this parameter are:

■ True = FND_API.G_TRUE

■ False = FND_API.G_FALSE

■ Default = FND_API.G_FALSE

If set to true, then the API makes a call to fnd_msg_pub.initialize to initialize the message stack. To set to true, use the value, "T".

If set to false then the calling program must initialize the message stack. This action is required to be performed only once, even in the case where more than one API is called. To set to false, use the value, "F".

p_commit VARCHAR2(1) No The valid values for this parameter are:

■ True = FND_API.G_TRUE

■ False = FND_API.G_FALSE

■ Default = FND_API.G_FALSE

If set to true, then the API commits before returning to the calling program. To set to true, use the value, "T".

If set to false, then it is the calling program’s responsibility to commit the transaction. To set to false, use the value, "F".

Note: All standard OUT parameters are required.

Table 1–1 Standard IN Parameters

Parameter Data Type Required Description

Introduction 1-3

Page 26: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Parameter Specifications

1.1.3 Parameter SizeVerify the size of the column from the base table for that column when passing a parameter of a specific length. For example, if you pass a NUMBER value, first query to find the exact value to pass. An incorrect value can cause the API call to fail.

1.1.4 Missing Parameter AttributesThe following table describes optional IN parameters which are initialized to pre-defined values representing missing constants. These constants are defined for the common PL/SQL data types and should be used in the initialization of the API formal parameters.

Table 1–2 Standard OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2(1) Indicates the return status of the API. The values returned are one of the following:

■ FND_API.G_RET_STS_SUCCESS

Success: Indicates the API call was successful

■ FND_API.G_RET_STS_ERROR

Expected Error: There is a validation error, or missing data error.

■ FND_API.G_RET_STS_UNEXP_ERROR

Unexpected Error: The calling program can not correct the error.

x_msg_count NUMBER Holds the number of messages in the message list.

x_msg_data VARCHAR2(2000) Holds the encoded message if x_msg_count is equal to one.

Table 1–3 Initialized IN Parameters

Parameter Type Initialized Value

G_MISS_NUM CONSTANT NUMBER:= 9.99E125

G_MISS_CHAR CONSTANT VARCHAR2(1):= chr(0)

G_MISS_DATE CONSTANT DATE:= TO_DATE('1','j');

1-4 Oracle CRM Application Foundation API Reference Guide

Page 27: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Version Information

These constants are defined in the package FND_API in the file fndpapis.pls. All columns in a record definition are set to the G_MISS_X constant as defined for the data type.

1.1.5 Parameter ValidationsThe following types of parameters are always validated during the API call:

■ Standard IN

■ Standard OUT

■ Mandatory procedure specific IN

■ Procedure specific OUT

1.1.6 Invalid ParametersIf the API encounters any invalid parameters during the API call, then one of the following actions will occur:

■ An exception is raised.

■ An error message identifying the invalid parameter is generated.

■ All API actions are cancelled.

1.2 Version InformationIt is mandatory that every API call pass a version number for that API as its first parameter (p_api_version).

This version number must match the internal version number of that API. An unexpected error is returned if the calling program version number is incompatible with the current API version number.

In addition, the object version number must be input for all update and delete APIs.

■ If the object_version_number passed by the API matches that of the object in the database, then the update is completed.

Warning: The currently supported version at this time is 1.0. Use only this for the API version number.

Introduction 1-5

Page 28: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Status Messages

■ If the object_version_number passed by the API does not match that of the object in the database, then an error condition is generated.

1.3 Status Messages

Every API must return one of the following states as parameter x_return_status after the API is called:

■ S (Success)

■ E (Error)

■ U (Unexpected error)

Each state can be associated with a status message. The following table describes each state.

Note: It is not required that all status notifications provide a number identifier along with the message, although, in many cases, it is provided.

Table 1–4 Status Message and Description

Status Description

S Indicates that the API performed all the operations requested by its caller.

■ A success return status may or may not be accompanied by messages in the API message list.

■ Currently, the CRM Foundation APIs do not provide a message for a return status of success.

E Indicates that the API failed to perform one or more of the operations requested by its caller.

An error return status is accompanied by one or more messages describing the error.

U Indicates that the API encountered an error condition it did not expect, or could not handle, and that it is unable to continue with its regular processing.

■ For example, certain programming errors such as attempting to divide by zero causes this error.

■ These types of errors usually cannot be corrected by the user and requires a system administrator or application developer to correct.

1-6 Oracle CRM Application Foundation API Reference Guide

Page 29: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Status Messages

Warning and Information MessagesIn addition to these three types of possible status messages, you can also code the following additional message types:

■ Warnings

■ Information

To create a warning message, perform the following steps:

1. Create a global variable to be used to signal a warning condition. For example, this could be similar to the following:

G_RET_STS_WARNING := 'W’

This global variable is not part of the FND_API package.

2. Return this value if the warning condition is encountered. For example, using the same example as in step one, set up the following code in the API to process the warning condition:

x_return_status := G_RET_STS_WARNING

This code replaces the more usual:

x_return_status := fnd_api.g_ret_sts_unexp_error for "U"

3. If desired, perform a similar procedure to create Information messages.

Introduction 1-7

Page 30: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Status Messages

1-8 Oracle CRM Application Foundation API Reference Guide

Page 31: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Interaction History Public

2

Interaction History Public APIs

Interaction History provides other CRM modules with a common framework for capturing and accessing all customer interaction data associated with customer contacts. Interaction History provides a central repository for this data and includes APIs for tracking all automated or agent-based customer interactions.

The following topics are discussed in this chapter:

■ Customer Interaction

■ Package JTF_IH_PUB

■ Non-cached Creation APIs

■ Cached Creation APIs

■ Counting APIs

■ Messages and Notifications

■ Sample Code

2.1 Customer InteractionA customer interaction contains up to four unique units of customer information, a media item, a media lifecycle, an activity, and an interaction. Figure 2-1 illustrates the different units of information that comprise a customer interaction and how they are stored in the Oracle database.

1. The customer interaction obtains its media item information from the Media Items table.

2. The customer interaction obtains its media lifecycle information from the Media Lifecycle table.

APIs 2-1

Page 32: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Customer Interaction

3. The customer interaction obtains its interaction information from the Interactions table.

4. The customer interaction obtains its activity information from the Media Items table.

Figure 2–1 Customer Interaction

2.1.1 Media ItemMedia items are inbound and outbound communications that take place between a customer and a human or automated agent, a system or a CRM application. One or more media items can be associated with a single activity. Telephone conversations and email correspondence between customers and agents are examples of media items.

2-2 Oracle CRM Application Foundation API Reference Guide

Page 33: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Customer Interaction

Media are the individual communication channels through which media items are delivered. Telephones, fax machines, automatic teller machines (ATMs), and email messages are examples of media.

2.1.2 Media LifecycleA Media Lifecycle is a unit of time associated with the handling of a media item. For example, if a customer call passes through four different phone queues for different periods of time contains four segments in its lifecycle.

2.1.3 ActivityAn activity is a business action performed by an agent as part of a customer interaction using one or more methods of communication called media items. Activities are recorded in Interaction History and can be viewed by using the Interaction History windows accessed from calling applications. Some examples of activities include an agent transferring a call, an agent emailing a marketing brochure, or a customer placing an order.

2.1.4 InteractionAn interaction is a point of contact or touchpoint between a human or automated agent and a party such as a customer, a customer system, or a potential customer. An interaction is a timed entity with an outcome and a result that can be tracked. When an interaction is closed, it becomes an historical record that subsequently cannot be altered or modified. Multiple forms of communication or media items between the party and the agent can be incuded in a single interaction.

2.1.5 Relating Customer Interaction InformationInteraction History applications must identify customer interaction information stored in different Oracle database tables as part of a single customer interaction. Figure 2-2 illustrates how the Interaction History database tables relate to each other using primary and foreign key values.

1. The Media Items table contains one primary key, media_id.

2. The Media Lifecycle table contains one primary key, milcs_id and one foreign key, media_id.

3. The Interactions table contains one primary key, interaction_id.

Interaction History Public APIs 2-3

Page 34: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_IH_PUB

4. The Activities table contains one primary key, activity_id and two foreign keys, media_id and interaction_id.

Figure 2–2 Relating Customer Interaction Tables

2.2 Package JTF_IH_PUBAll public procedures (APIs) relating to media items, media lifecycles, interactions, and activities are stored in the JTF_IH_PUB package. This package contains three types of Interaction History APIs:

■ Non-cached Creation APIs

■ Cached Creation APIs

■ Counting APIs

2-4 Oracle CRM Application Foundation API Reference Guide

Page 35: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_IH_PUB

2.2.1 Data Structure SpecificationsThe Interaction History APIs use the following data structures:

■ Interaction Record Type

■ Activity Record Type

■ Media Item Record Type

■ Media Item Lifecycle Record Type

Nested Record TypesPL/SQL record types are used in all open, add, and close Interaction History APIs. In certain cases, nested record types are used as well.

For example, in the Create_Interaction API:

■ Input parameter p_activities is a record of type activity_tbl_type.

■ In turn, activity_tbl_type contains a record of type activity_rec_type as one of its elements.

Using nested data structures in this fashion enables the calling API to pass one or more activities to an Interaction History creation API.

2.2.1.1 Interaction Record TypeThis composite record type enumerates all the elements that represent an interaction record. This business entity represents a contact point between a customer, customer system, or potential customer and a single human or automated agent.

TYPE interaction_rec_type IS RECORD( interaction_id number :=fnd_api.g_miss_num, reference_form varchar2(1000) :=fnd_api.g_miss_char, follow_up_action varchar2(80) :=fnd_api.g_miss_char, duration number :=fnd_api.g_miss_num, inter_interaction_duration number :=fnd_api.g_miss_num, non_productive_time_amount number :=fnd_api.g_miss_num, preview_time_amount number :=fnd_api.g_miss_num, productive_time_amount number :=fnd_api.g_miss_num, start_date_time date :=fnd_api.g_miss_date, wrapup_time_amount number :=fnd_api.g_miss_num, handler_id number :=fnd_api.g_miss_num, script_id number :=fnd_api.g_miss_num,

Interaction History Public APIs 2-5

Page 36: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_IH_PUB

outcome_id number :=fnd_api.g_miss_num, result_id number :=fnd_api.g_miss_num, reason_id number :=fnd_api.g_miss_num, resource_id number :=fnd_api.g_miss_num, party_id number :=fnd_api.g_miss_num, parent_id number :=fnd_api.g_miss_num, object_id number :=fnd_api.g_miss_num, object_type varchar2(30) :=fnd_api.g_miss_char, source_code_id number :=fnd_api.g_miss_num, source_code varchar2(30) :=fnd_api.g_miss_char, attribute1 varchar2(150) :=fnd_api.g_miss_char, attribute2 varchar2(150) :=fnd_api.g_miss_char, attribute3 varchar2(150) :=fnd_api.g_miss_char, attribute4 varchar2(150) :=fnd_api.g_miss_char, attribute5 varchar2(150) :=fnd_api.g_miss_char, attribute6 varchar2(150) :=fnd_api.g_miss_char, attribute7 varchar2(150) :=fnd_api.g_miss_char, attribute8 varchar2(150) :=fnd_api.g_miss_char, attribute9 varchar2(150) :=fnd_api.g_miss_char, attribute10 varchar2(150) :=fnd_api.g_miss_char, attribute11 varchar2(150) :=fnd_api.g_miss_char, attribute12 varchar2(150) :=fnd_api.g_miss_char, attribute13 varchar2(150) :=fnd_api.g_miss_char, attribute14 varchar2(150) :=fnd_api.g_miss_char, attribute15 varchar2(150) :=fnd_api.g_miss_char, attribute_category varchar2(30) :=fnd_api.g_miss_char);

2.2.1.2 Activity Record TypeThis composite record type enumerates all elements that represent an activity record. This business entity can be associated with the business functions performed during an interaction.

TYPE activity_rec_type IS RECORD( activity_id number :=fnd_api.g_miss_num, duration number :=fnd_api.g_miss_num, cust_account_id number :=fnd_api.g_miss_num, cust_org_id number :=fnd_api.g_miss_num, role varchar2(240) :=fnd_api.g_miss_char, start_date_time date :=fnd_api.g_miss_date, task_id number :=fnd_api.g_miss_num, doc_id number :=fnd_api.g_miss_num,

2-6 Oracle CRM Application Foundation API Reference Guide

Page 37: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_IH_PUB

doc_ref varchar2(30) :=fnd_api.g_miss_char, doc_source_object_name varchar2(80) :=fnd_api.g_miss_char, media_id number :=fnd_api.g_miss_num, action_item_id number :=fnd_api.g_miss_num, interaction_id number :=fnd_api.g_miss_num, outcome_id number :=fnd_api.g_miss_num, result_id number :=fnd_api.g_miss_num, reason_id number :=fnd_api.g_miss_num, description varchar2(1000) :=fnd_api.g_miss_char, action_id number :=fnd_api.g_miss_num, interaction_action_type varchar2(240) :=fnd_api.g_miss_char, object_id number :=fnd_api.g_miss_num, object_type varchar2(30) :=fnd_api.g_miss_char, source_code_id number :=fnd_api.g_miss_num, source_code varchar2(30) :=fnd_api.g_miss_char);

2.2.1.3 Media Item Record TypeThis composite record type enumerates all elements that represent a media record. This business entity can be generated by a customer, by the system, or an application.

TYPE media_rec_type IS RECORD( media_id number :=fnd_api.g_miss_num, source_id number :=fnd_api.g_miss_num, direction varchar2(240) :=fnd_api.g_miss_char, duration number :=fnd_api.g_miss_num, interaction_performed varchar2(240) :=fnd_api.g_miss_char, start_date_time date :=fnd_api.g_miss_date, media_data varchar2(80) :=fnd_api.g_miss_char, source_item_create_date_time date :=fnd_api.g_miss_date, source_item_id number :=fnd_api.g_miss_num, media_item_type varchar2(80) :=fnd_api.g_miss_char, media_item_ref varchar2(240) :=fnd_api.g_miss_char);

2.2.1.4 Media Item Lifecycle Record TypeThis composite record type enumerates all elements that represent a media lifecycle record. This business entity unit represents a unit of time associated with the handling of a media item.

Interaction History Public APIs 2-7

Page 38: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

TYPE media_lc_rec_type IS RECORD( start_date_time date :=fnd_api.g_miss_date, type_type varchar2(80) :=fnd_api.g_miss_char, type_id number :=fnd_api.g_miss_num, duration number :=fnd_api.g_miss_num, milcs_id number :=fnd_api.g_miss_num, milcs_type_id number :=fnd_api.g_miss_num, media_id number :=fnd_api.g_miss_num, handler_id number :=fnd_api.g_miss_num, resource_id number :=fnd_api.g_miss_num, milcs_code varchar2(80) :=fnd_api.g_miss_char);

2.3 Non-cached Creation APIsApplications with rapid transaction requirements, such as predictive dialing products, can take advantage of the following non-cached creation APIs:

■ Create_Interaction

■ Create_MediaItem

■ Create_MediaLifecycle

2.3.1 OverviewNon-cached creation APIs enable a client application to write and close an interaction in a single API call. This action is more efficient than that used for the cached APIs as the record is written and created in one transaction cycle. However, the client application must persist the interaction data during the creation of the interaction, or the entire interaction record can be lost if the data flow is interrupted.

If you use non-cached creation APIs for transactions and communication between the client application and the server is disrupted during creation of the record, then the entire transaction is lost.

Table 2–1 Interaction History Non-cached Creation APIs

Procedure Description

Create_MediaItem Creates a media item in the Media Items table. This procedure is optional..

2-8 Oracle CRM Application Foundation API Reference Guide

Page 39: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

2.3.2 Process FlowFigure 2-3 describes a common sequence of operations performed when a calling application invokes non-cached creation APIs. The process flows described in this figure are common but not required since some API calls are optional.

1. The Create_MediaItem API creates a media item in the Media Items table and passes a unique sequence generated identifier back to the calling application as x_media_id.

2. When the calling application invokes the Create_MediaLifecycle API, it passes the media item’s unique identifier as p_media_id. The Create_MediaLifecycle API then creates a media lifecycle record in the Media Lifecycles table.

3. When the calling application invokes the Create_Interaction API, the following events occur:

a. The calling application passes the media item’s unique identifier as p_media_id. The Create_Interaction API then creates an interaction in the Interactions table and sets the interaction to inactive so that it can no longer be modified.

b. The Create_Interaction API then creates one or more activities in the Activities table, associates the activity with the interaction, and sets the activity to inactive so that it can no longer be modified

Create_MediaLifecycle Creates a media lifecycle record in the Media Lifecycle table that is associated with a media item. This procedure is optional.

Create_Interaction Creates an interaction record in the Interactions table and associates it with one or more activities in the Activities table.

Note: Media Item and Media Lifecycle calls are optional since interactions can exist without a media item or its associated media lifecycle record.

Table 2–1 Interaction History Non-cached Creation APIs

Procedure Description

Interaction History Public APIs 2-9

Page 40: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

Figure 2–3 Non-cached creation API Process Flow

2.3.3 Create_MediaItemThe Create_MediaItem API creates a media item in the Media Items table. This procedure is optional since an interaction can be created without any media items and their associated media lifecycles. Currently some applications create a media item and pass its media_id value to the calling application which subsequently passes it to the Create_Interaction API.

For example, media items are currently created by Advanced Outbound (Predictive Calls), Advanced Inbound (OTM), 1-to-1 Fulfillment, and E-mail Center. In the first two cases the media_id value is passed to the desktop application (Telesales,

2-10 Oracle CRM Application Foundation API Reference Guide

Page 41: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

Customer Care, etc.) which enables these applications to associate the media item with the activities when they create an interaction and it's associated activities

Procedure Specification PROCEDURE create_mediaitem( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media in media_rec_type, p_mlcs in mlcs_tbl_type);

Current Version1.0

Parameter DescriptionsThe Create_MediaItem API sets the value of the input parameter to NULL if the parameter corresponds to the value of the G_MISS_X constant. If the parameter does not correspond to this constant, then the API retains the passed-in value.

The following table describes the IN parameters associated with this API.

Table 2–2 Create Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

Interaction History Public APIs 2-11

Page 42: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.3.4 Create_MediaLifecycleThe Create_MediaLifecycle API creates a media lifecycle record in the Media Lifecycle table. This procedure is optional since an interaction can be created without any media items and their associated media lifecycles.

Procedure Specification PROCEDURE create_medialifecycle( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false,

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in the table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in the table FND_LOGINS, and identifies the login session.

p_media media_rec_type Yes See "Media Item Record Type" on page 2-7.

p_mlcs mlcs_tbl_type Yes See "Media Item Lifecycle Record Type" on page 2-7.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–3 Create Media Item OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–2 Create Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

2-12 Oracle CRM Application Foundation API Reference Guide

Page 43: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media_lc_rec in media_lc_rec_type);

Current Version1.0

Parameter DescriptionsThe Create_MediaLifecycle API sets the value of the input parameter to NULL if the parameter corresponds to the value of the G_MISS_X constant. If the parameter does not correspond to this constant, then the API retains the passed-in value.

The following table describes the IN parameters associated with this API.

Table 2–4 Create Media Lifecycle IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in the table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in the table FND_LOGINS, and identifies the login session.

Interaction History Public APIs 2-13

Page 44: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.3.5 Create_InteractionThe Create_Interaction API creates an interaction record in the Interactions table, associates it with one or more activities in the Activities table and sets the status of the interaction to inactive. You can pass multiple Activity Records in the Create_Interaction API using the p_activities parameter. The data type for this parameter is activity_tlb_type which is a table of activity_rec_type values.

Procedure Specification PROCEDURE create_interaction( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null,

p_media_lc_rec media_lc_rec_type

Yes This record captures the media lifecycle.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

See "Media Item Lifecycle Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–5 Create Media Lifecycle OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–4 Create Media Lifecycle IN Parameters

Parameter Data Type Required Descriptions and Validations

2-14 Oracle CRM Application Foundation API Reference Guide

Page 45: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_interaction_rec in interaction_rec_type, p_activities in activity_tbl_type);

Current Version1.0

Parameter DescriptionsThe Create_Interaction API sets the value of the input parameter to NULL if the parameter corresponds to the value of the G_MISS_X constant. If the parameter does not correspond to this constant, then the API retains the passed-in value.

The following table describes the IN parameters associated with this API.

Create Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in the table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

Interaction History Public APIs 2-15

Page 46: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Non-cached Creation APIs

p_interaction_rec INTERACTION_REC_TYPE

Yes Contains the elements that comprise the interaction record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

■ handler_id

■ outcome_id

■ result_id

■ reason_id

■ resource_id

■ party_id

■ source_code

■ source_code_id

See "Interaction Record Type" on page 2-5 for the record specification.

Create Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

2-16 Oracle CRM Application Foundation API Reference Guide

Page 47: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4 Cached Creation APIsDesktop applications, such as a service request system, that must retain interaction information even when transactions are broken as well as the ability to associate

p_activities activity_tbl_type Yes The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

■ action_item_id

■ outcome_id

■ result_id

■ reason_id

■ action_id

■ source_code

■ source_code_id

See "Activity Record Type" on page 2-6 for the record specification.

1 The Application ID, Responsibility ID, and the User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–6 Create Interaction OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Create Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

Interaction History Public APIs 2-17

Page 48: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

multiple media items and activities with a single interaction can take advantage of the following cached creation APIs:

■ Open_MediaItem

■ Update_MediaItem

■ Add_MediaLifecycle

■ Update_MediaLifecycle

■ Close_MediaItem

■ Open_Interaction

■ Update_Interaction

■ Add_Activity

■ Update_Activity

■ Update_ActivityDuration

■ Close_Interaction

2.4.1 OverviewCached creation APIs enable Interaction History clients to create and update interactions on the server prior to closing the interaction, before the interaction becomes an historical record which cannot be updated or deleted. In this case, a partial interaction record is stored on the server and updated as required until the final Close_Interaction API call makes it a historical record. This mechanism provides some level of fault-tolerance and recovery to client applications creating the interactions but also provides slower performance than non-cached creation APIs. Unlike the non-cached creation APIs, the cached creation APIs require several procedures to create a single media item, media lifecycle, activity, or interaction. Cached creation APIs can also have one set of APIs nested within another.

If you use cached creation APIs for transactions and communication between the client application and the server is disrupted, all information captured up to the point of disruption can be recovered.

Table 2–7 Interaction History Cached Creation APIs

Procedure Description

Open_MediaItem Creates a media item in table Media Items table.

2-18 Oracle CRM Application Foundation API Reference Guide

Page 49: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

2.4.2 Process FlowsSince cached creation APIs perform their operations in a specific sequence, APIs that perform an update function cannot be invoked unless a corresponding API that performs an open or add function has first been invoked. For example, the Update_Interaction API cannot be invoked unless the corresponding Open_Interaction API has first been invoked. The Update_Activity API cannot be invoked unless the corresponding Add_Activity API has first been invoked. Similarly an update API cannot be invoked for a record that has already been closed. For example, after you invoke the Close_Interaction API you cannot invoke the Update_Interaction API for the same record.

Figure 2-4 provides an overview of a common process flow for cached creation APIs. The process flows described in this figure are common but not required since some API calls are optional.

Update_MediaItem Updates the current media item with values supplied by the calling application.

Add_MediaLifecycle Creates a media lifecycle record in the Media Lifecycle table and associates it with the media item passed by the calling application.

Update_MediaLifecycle Updates the current media lifecycle with values supplied by the calling application.

Close_MediaItem Sets the status of the media item and its associated media lifecycle to inactive so that they can no longer be updated.

Open_Interaction Creates an interaction in the Interactions table.

Update_Interaction Updates the current interaction with values supplied by the calling application.

Add_Activity Creates an activity in the Activities table that is associated with the interaction passed by the calling application.

Update_Activity Updates the current activity with values supplied by the calling application.

Update_ActivityDuration Updates the current activity’s end_date_time and duration fields with values supplied by the calling application.

Close_Interaction Sets the status of the interaction and its associated activities to inactive so that they can no longer be modified.

Table 2–7 Interaction History Cached Creation APIs

Procedure Description

Interaction History Public APIs 2-19

Page 50: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

1. The calling application executes the first of three steps required to create a media item, by invoking the Open_MediaItem API. This API inserts generic values in the Media Items table of the Oracle database.

2. The calling application executes the second of three step required to create a media item, by invoking the Update_MediaItem API. This API updates the Media Items table with values supplied by the calling application.

3. Before the media item becomes an historical record in the database, it can optionally contain an associated media lifecycle record. The calling application executes the first of two steps required to create a media lifecycle record by invoking the Add_MediaLifecycle API. This API inserts generic values in the Media Lifecycles table.

4. The calling application executes the second of two steps to create a media lifecycle record by invoking the Update_MediaLifecycle API. This API updates the media lifecycle record with values supplied by the calling application.

5. The calling application executes the third of three steps required to create a media item by invoking the Close_MediaItem API. This API performs all required validations to make the media item and its associated media lifecycle record, historical records.

6. The calling application executes the first of three steps required to create an interaction record by invoking the Open_Interaction API. This API inserts generic values in the Interactions table.

7. The calling application executes the second of three steps required to create an interaction by invoking the Update_Interaction API. This API updates the Interactions table with values supplied by the calling application.

Note: If a media lifecycle record is added to the media item, this must occur before closing the media item record. Once the media item record is closed it cannot be modified.

Note: Media Item and Media Lifecycle calls are optional since interactions can exist without a media item or its associated media lifecycle record.

2-20 Oracle CRM Application Foundation API Reference Guide

Page 51: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

8. The calling application executes the first of thee steps required to create an activity that is associated with the interaction by invoking the Add_Activity API. This API inserts generic values in the Activities table.

9. The calling application executes the second of three steps required to create an activity that is associated with an interaction by invoking the Update_Activity API. This API updates the Activities table with values supplied by the calling application.

10. The calling application executes the third of three steps required to create an activity that is associated with an interaction by invoking the Update_ActivityDuration API. This API updates the current activity’s duration with values supplied by the calling application.

11. The calling application performs the third of three steps required to create an interaction by invoking the Close_Interaction API. This API performs all required validations to make the interaction and its associated activity historical records in the Oracle database.

Note: One or more activities must be created and associated with the interaction before closing the interaction record. Once the interaction record is closed it cannot be modified.

Interaction History Public APIs 2-21

Page 52: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

Figure 2–4 Cached Creation API Process Flow Overview

2-22 Oracle CRM Application Foundation API Reference Guide

Page 53: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

Figure 2-5 provides a detailed explanation of the first five steps required to create a customer Interaction using the cached creation APIs. The process flows described in this figure are common but not required since some API calls are optional.

1. The Open_MediaItem API inserts generic records in the Media Items table of the Oracle database, sets the media item’s status to active so that it can be updated, and returns a sequence generated identifier to the calling application as x_media_id.

2. The Update_MediaItem API updates the Media Items table with values supplied by the calling application and retains the media item’s active status.

3. The calling application optionally associates a media lifecycle record with the media item by invoking the Add_MediaLifecycle API. The calling application inputs the media items’s sequence generated identifier as p_media_id, inserts generic values in the Media Lifecycles table and sets the status of the media lifecycle to active so that it can be updated.

4. The Update_MediaLifecycle API updates the media lifecycle record with values supplied by the calling application and retains its active status.

5. The Close_MediaItem API sets the status of the media item and its associated media lifecycle record to inactive so that they can no longer be updated, and performs validations to verify that the media item and media lifecycle record are associated with each other.

Note: The process of creating a customer interaction record using the cached creation APIs is not yet complete. This process is continued in steps 6 -11 as illustrated in Figure 2-6.

Interaction History Public APIs 2-23

Page 54: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

Figure 2–5 Cached Creation API Process Flow: Steps 1 - 5

Figure 2-6 provides a detailed explanation of the remaining six steps required to create a customer Interaction using the cached creation APIs.

6. The Open_Interaction API inserts generic records in the Interactions table, sets the interaction’s status to active so that it can be updated, and returns a sequence generated identifier to the calling application as x_interaction_id.

7. The Update_Interaction API updates the Interactions table with values supplied by the calling application and retains the interaction’s active status.

2-24 Oracle CRM Application Foundation API Reference Guide

Page 55: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

8. The calling application invokes the Add_Activity API, inputs the media item’s unique identifier as p_media_id, and inputs the interaction’s unique identifier as p_interaction_id. The API sends a sequence generated identifier to the calling application as x_activity_id, inserts generic records in the Activities table, and sets the activity status to active so that it can be updated.

9. The Update_Activity API updates the Activities table with values supplied by the calling application and retains the activity’s active status.

10. The Update_ActivityDuration API updates the Activities table ’s end_date_time and duration fields with values supplied by the calling application, and retains the activity’s active status so that it can still be modified.

11. The Create_Interaction API sets the status of the interaction and its associated activity to inactive so that they can no longer be updated, and performs validations to verify that the interaction and activity are associated with each other.

Note: One or more activities must be created and associated with the interaction before closing the interaction record. Once the interaction record is closed it cannot be modified.

Interaction History Public APIs 2-25

Page 56: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

Figure 2–6 Cached Creation API Process Flow: Steps 6 -1 1

2-26 Oracle CRM Application Foundation API Reference Guide

Page 57: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

2.4.3 Open_MediaItemThe Open_MediaItem API Creates a media item in the Media Items table, sets the status of the media item to active, and returns a sequence generated media identification number as p_media_id.

Procedure Specification PROCEDURE Open_MediaItem( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media_rec in media_rec_type, x_media_id out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–8 Open Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

Interaction History Public APIs 2-27

Page 58: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4.4 Update_MediaItemThe Update_MediaItem API updates the current Media Item with values supplied by the calling application and sets the status of the media item to active.

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_media media_rec_type Enumerates the elements that comprise a media record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

See "Media Item Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–9 Open Media Item OUT Parameter

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_media_id NUMBER The record number for the created media item. It is automatically generated by sequence JTF_IH_MEDIA_ITEMS_S1.

Table 2–8 Open Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

2-28 Oracle CRM Application Foundation API Reference Guide

Page 59: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

Procedure Specification PROCEDURE Update_MediaItem( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media_rec in media_rec_type);

Current Version1.0

Parameter DescriptionsThe Update_MediaItem API does not update columns which have passed-in values corresponding to the G_MISS_X constants.

The following table describes the IN parameters associated with this API.

Table 2–10 Update Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No Corresponds to the column USER_ID in the table FND_USER, and identifies the Oracle Applications user.

Interaction History Public APIs 2-29

Page 60: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4.5 Add_MediaLifecycleThe Add_MediaLifecycle API creates a media lifecycle record in the Media Lifecycle table, associates it with a Media Item passed by the calling application, and returns a sequence generated milcs_id number. The status of the media item and its associated media lifecycle remain active.

Procedure Specification PROCEDURE Add_MediaLifecycle( p_api_version in number,

p_login_id NUMBER No* Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_media_rec media_rec_type Enumerates the elements that comprise a media record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

See "Media Item Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–11 Update Media Item OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–10 Update Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

2-30 Oracle CRM Application Foundation API Reference Guide

Page 61: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media_lc_rec in media_lc_rec_type, x_milcs_id out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–12 Add Media Lifecycle IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

Interaction History Public APIs 2-31

Page 62: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4.6 Update_MediaLifecycleThe Update_MediaLifecycle API updates the current media lifecycle record with values supplied by the calling application. The status of the media lifecycle remains active.

Procedure Specification PROCEDURE Update_MediaLifecycle( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false,

p_media_lc_rec media_lc_rec_type

Composite record that enumerates the elements that comprise a media lifecycle.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

See "Media Item Lifecycle Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–13 Add Media Lifecycle OUT Parameter

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_milcs_id NUMBER Corresponds to the sequence generated media lifecycle identifier for the record created.

Table 2–12 Add Media Lifecycle IN Parameters

Parameter Data Type Required Descriptions and Validations

2-32 Oracle CRM Application Foundation API Reference Guide

Page 63: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media_lc_rec in media_lc_rec_type);

Current Version1.0

Parameter DescriptionsThe Update_MediaLifecycle API does not update columns with pass-in values that correspond to the G_MISS_X constants.

The following table describes the IN parameters associated with this API.

Table 2–14 Update Media Lifecycle IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

Interaction History Public APIs 2-33

Page 64: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4.7 Close_MediaItemThe Close_MediaItem API sets the status of the media item and its associated media lifecycle to inactive so that it can no longer be updated.

Procedure Specification PROCEDURE Close_MediaItem( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number,

p_media_lc_rec media_lc_rec_type

Yes Composite record that enumerates the elements that comprise a media lifecycle.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

See "Media Item Lifecycle Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–15 Update Media Lifecycle OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–14 Update Media Lifecycle IN Parameters

Parameter Data Type Required Descriptions and Validations

2-34 Oracle CRM Application Foundation API Reference Guide

Page 65: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_media_rec in media_rec_type);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–16 Close Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

Interaction History Public APIs 2-35

Page 66: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4.8 Open_InteractionThe Open_Interaction API Creates an interaction in the Interactions table, sets the status of the interaction to active, and returns a sequence generated interaction_id number.

Procedure Specification PROCEDURE Open_Interaction( p_api_version in number,

p_media_rec media_rec_type Yes Enumerates the elements that comprise a media record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

If the end_date_time parameter is not supplied at the time that the Close_MediaItem API is invoked, then sysdate is inserted in its place.

See "Media Item Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–17 Close Media Item OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–16 Close Media Item IN Parameters

Parameter Data Type Required Descriptions and Validations

2-36 Oracle CRM Application Foundation API Reference Guide

Page 67: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_interaction_rec in interaction_rec_type, x_interaction_id out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–18 Open Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

Interaction History Public APIs 2-37

Page 68: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

p_interaction_rec interaction_rec_type

Yes Contains the elements that comprise the interaction record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

■ handler_id

■ outcome_id

■ result_id

■ reason_id

■ resource_id

■ party_id

■ source_code

■ source_code_id

See "Interaction Record Type" on page 2-5 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–19 Open Interaction OUT Parameter

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_interaction_id NUMBER Corresponds to a sequence generated reference for the interaction record.

Table 2–18 Open Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

2-38 Oracle CRM Application Foundation API Reference Guide

Page 69: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

2.4.9 Update_InteractionThe Update_Interaction API updates the current interaction with values supplied by the calling application. The state of the interaction remains open.

Procedure Specification PROCEDURE update_interaction( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_interaction_rec in interaction_rec_type);

Current Version1.0

Parameter DescriptionsThe Update_Interaction API does not update columns that have passed-in values corresponding to the G_MISS_X constants

The following table describes the IN parameters associated with this API.

Table 2–20 Update Interaction IN Parameters

Parameter Date Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

Interaction History Public APIs 2-39

Page 70: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_interaction_rec interaction_rec_type

Yes Used in updating the interaction record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

■ handler_id

■ outcome_id

■ result_id

■ reason_id

■ resource_id

■ party_id

■ source_code

■ source_code_id

See "Interaction Record Type" on page 2-5 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–21 Update Interaction OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–20 Update Interaction IN Parameters

Parameter Date Type Required Descriptions and Validations

2-40 Oracle CRM Application Foundation API Reference Guide

Page 71: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

2.4.10 Add_ActivityThe Add_Activity API creates an activity in the Activities table, associates it with the interaction passed by the calling application, and returns a sequence generated activity_id number. The status of the interaction and associated activity remain active.

Procedure Specification PROCEDURE Add_Activity( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_activity_rec in activity_rec_type, x_activity_id out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 2–22 Add Activity IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

Table 2–21 Update Interaction OUT Parameters

Parameter Data Type Description

Interaction History Public APIs 2-41

Page 72: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_activity_rec activity_rec_type Yes Used in updating the interaction record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

■ action_item_id

■ outcome_id

■ result_id

■ reason_id

■ action_id

■ source_code

■ source_code_id

See "Activity Record Type" on page 2-6 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–22 Add Activity IN Parameters

Parameter Data Type Required Descriptions and Validations

2-42 Oracle CRM Application Foundation API Reference Guide

Page 73: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

2.4.11 Update_ActivityThee Update_Activity API updates the current activity with values supplied by the calling application. The status of the activity remains active.

Procedure Specification PROCEDURE Update_Activity( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_activity_rec in activity_rec_type);

Current Version1.0

Parameter DescriptionsThe Update_Activity API does not update columns which have passed-in values corresponding to the G_MISS_X constants.

The following table describes the IN parameters associated with this API.

Table 2–23 Add Activity OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_activity_id NUMBER Corresponds to the sequence generated activity identifier for the record created.

Interaction History Public APIs 2-43

Page 74: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

Table 2–24 Update Activity IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_activity_rec activity_rec_type Yes Used in updating the interaction record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

■ action_item_id

■ outcome_id

■ result_id

■ reason_id

■ action_id

■ source_code

■ source_code_id

See "Activity Record Type" on page 2-6 for the record specification.

2-44 Oracle CRM Application Foundation API Reference Guide

Page 75: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the OUT parameters associated with this API.

2.4.12 Update_ActivityDurationThe Update_ActivityDuration API updates the current activity’s end_date_time and duration fields with values supplied by the calling application.

Procedure Specification PROCEDURE Update_ActivityDuration( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_activity_id in number, p_end_date_time in date, p_duration in number);

Current Version1.0

Parameter DescriptionsThe Update_ActivityDuration API does not update columns which have passed-in values corresponding to the G_MISS_X constants.

Table 2–25 Update Activity OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Interaction History Public APIs 2-45

Page 76: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

The following table describes the IN parameters associated with this API.

The following table describes the OUT parameters associated with this API.

Table 2–26 Update Activity Duration IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1

1 The application ID, responsibility ID, and user ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Application identifier

p_resp_id NUMBER Optional* Responsibility identifier

p_user_id NUMBER Optional* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_activity_id NUMBER Activity identifier. This number corresponds to a certain activity.

p_end_date_time DATE End date time. Time in date format at the end of the transaction.

p_duration NUMBER Duration. Time difference between the end_date_time and the start_date_time converted to seconds.

Table 2–27 Update Activity Duration OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

2-46 Oracle CRM Application Foundation API Reference Guide

Page 77: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

2.4.13 Close_InteractionThe Close_Interaction API Sets the status of the interaction and its associated activities to inactive so that they can no longer be updated.

Procedure SpecificationPROCEDURE Close_Interaction( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_interaction_rec in interaction_rec_type);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–28 Close Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

Interaction History Public APIs 2-47

Page 78: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Cached Creation APIs

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_interaction_rec interaction_rec_type

Yes Contains the elements that comprise the interaction record.

The following record parameters are always validated:

■ start_date_time

If the start_date_time parameter is not supplied, then sysdate is inserted in its place.

■ end_date_time

If the end_date_time parameter is not supplied at the time that the Close_Interaction API is invoked, then sysdate is inserted in its place.

■ handler_id

■ outcome_id

■ result_id

■ reason_id

■ resource_id

■ party_id

■ source_code

■ source_code_id

See "Interaction Record Type" on page 2-5 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–28 Close Interaction IN Parameters

Parameter Data Type Required Descriptions and Validations

2-48 Oracle CRM Application Foundation API Reference Guide

Page 79: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Counting APIs

The following table describes the OUT parameters associated with this API.

2.5 Counting APIsThe following are counting APIs:

■ Get_InteractionActivityCount

■ Get_InteractionCount

2.5.1 OverviewThe counting APIs are classified as selector methods. They return the count of an interaction or an activity based on filtering parameter values that are passed by the calling application.

Table 2–30 Counting APIs

2.5.2 Get_InteractionActivityCountThis Get_InteractionActivityCount API retrieves the interaction and activity count from table JTF_IH_ACTIVITIES based on the input parameters.

Procedure Specification PROCEDURE Get_InteractionActivityCount( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null,

Table 2–29 Close Interaction OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Procedure Description

Get_InteractionActivityCount Retrieves the activity count from Activities table.

Get_InteractionCount Retrieves the interaction count from Activities table.

Interaction History Public APIs 2-49

Page 80: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Counting APIs

p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_outcome_id in number, p_result_id in number, p_reason_id in number, p_script_id in number, p_media_id in number, x_activity_count out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–31 Get Interaction Activity Count IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER Yes Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_outcome_id NUMBER Yes Outcome identifier. The number corresponds to a certain outcome.

p_result_id NUMBER Yes Result identifier. The number corresponds to a certain result.

2-50 Oracle CRM Application Foundation API Reference Guide

Page 81: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Counting APIs

The following table describes the OUT parameters associated with this API.

2.5.3 Get_InteractionCountThe Get_InteractionCount API retrieves the interaction count from table JTF_IH_INTERACTIONS based on the input parameters.

Procedure Specification PROCEDURE Get_InteractionCount( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_resp_appl_id in number default null, p_resp_id in number default null, p_user_id in number, p_login_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_outcome_id in number,

p_reason_id NUMBER Yes Reason identifier. The number corresponds to certain reasons.

p_script_id NUMBER No User hook

p_media_id NUMBER No See "Media Item Record Type" on page 2-7 for the record specification.

1 The Application ID, Responsibility ID, and User ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

Table 2–32 Get Interaction Activity Count OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_activity_count NUMBER Corresponds to the number of interactions and activities found that match the search criteria.

Table 2–31 Get Interaction Activity Count IN Parameters

Parameter Data Type Required Descriptions and Validations

Interaction History Public APIs 2-51

Page 82: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Counting APIs

p_result_id in number, p_reason_id in number, p_attribute1 in varchar2 default null, p_attribute2 in varchar2 default null, p_attribute3 in varchar2 default null, p_attribute4 in varchar2 default null, p_attribute5 in varchar2 default null, p_attribute6 in varchar2 default null, p_attribute7 in varchar2 default null, p_attribute8 in varchar2 default null, p_attribute9 in varchar2 default null, p_attribute10 in varchar2 default null, p_attribute11 in varchar2 default null, p_attribute12 in varchar2 default null, p_attribute13 in varchar2 default null, p_attribute14 in varchar2 default null, p_attribute15 in varchar2 default null, p_attribute_category in varchar2 default null, x_interaction_count out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 2–33 Get Interaction Count IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_resp_appl_id NUMBER No1 Application identifier

p_resp_id NUMBER No* Responsibility identifier

p_user_id NUMBER No* Corresponds to the column USER_ID in table FND_USER, and identifies the Oracle Applications user.

2-52 Oracle CRM Application Foundation API Reference Guide

Page 83: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Counting APIs

p_login_id NUMBER No Corresponds to the column LOGIN_ID in table FND_LOGINS, and identifies the login session.

p_outcome_id NUMBER No Outcome identifier. The number corresponds to a certain outcome.

p_result_id NUMBER No Result identifier. The number corresponds to a certain result.

p_reason_id NUMBER No Reason identifier. The number corresponds to certain reasons.

p_attribute1 VARCHAR2(150) No2 Customer flex field segment.

p_attribute2 VARCHAR2(150) No** Customer flex field segment.

p_attribute3 VARCHAR2(150) No** Customer flex field segment.

p_attribute4 VARCHAR2(150) No** Customer flex field segment.

p_attribute5 VARCHAR2(150) No** Customer flex field segment.

p_attribute6 VARCHAR2(150) No** Customer flex field segment.

p_attribute7 VARCHAR2(150) No** Customer flex field segment.

p_attribute8 VARCHAR2(150) No** Customer flex field segment.

p_attribute9 VARCHAR2(150) No** Customer flex field segment.

p_attribute10 VARCHAR2(150) No** Customer flex field segment.

p_attribute11 VARCHAR2(150) No** Customer flex field segment.

p_attribute12 VARCHAR2(150) No** Customer flex field segment.

p_attribute13 VARCHAR2(150) No** Customer flex field segment.

p_attribute14 VARCHAR2(150) No** Customer flex field segment.

p_attribute15 VARCHAR2(150) No** Customer flex field segment.

p_attribute_category

VARCHAR2(30) No

1 The application ID, responsibility ID, and user ID determine which profile values are used as defaults. Those items marked with an asterisk also follow these guidelines.

2 You must pass in segment IDs for none or all descriptive flexfield columns that might be used in the descriptive flexfield. Those items marked with two asterisks also follow these guidelines.

Table 2–33 Get Interaction Count IN Parameters

Parameter Data Type Required Descriptions and Validations

Interaction History Public APIs 2-53

Page 84: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

The following table describes the OUT parameters associated with this API.

2.6 Messages and NotificationsThe following APIs contained in package JTF_IH_PUB generate messages and notifications as required:

■ Create_Interaction

■ Open_MediaItem

■ Add_MediaLifecycle

■ Close_MediaItem

■ Open_Interaction

■ Update_Interaction

■ Add_Activity

■ Update_Activity

■ Close_Interaction

Table 2–34 Get Interaction Count OUT Parameter

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_interaction_count

NUMBER Corresponds to the number of interactions found.

Note: It is not required that all status notifications provide a number identifier along with the message, although, in many cases, it is provided.

2-54 Oracle CRM Application Foundation API Reference Guide

Page 85: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1 JTF_IH_PUB

2.6.1.1 Create_InteractionThe following table lists the messages and notifications generated by the Create_Interaction API.

Table 2–35 Create Interaction Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for party_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for resource_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for party_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for resource_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for handler_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for outcome_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for result_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for reason_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for script_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for source_code_id set and source_code not set is invalid.

Interaction History Public APIs 2-55

Page 86: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.2 Open_MediaItemThe following table lists the messages and notifications generated by the Open_MediaItem API.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for source_code set and source_code_id not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for interaction_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for non_production_time_amount.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for interaction is not active.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for activity_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for activity is not active.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Create_Interaction): The value <parameter value> for cust_account_id is invalid.

Table 2–36 Open Media Item Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_MediaItem): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Open_MediaItem): The value <parameter value> for media_item_type is invalid.

Table 2–35 Create Interaction Messages

Type Name Text

2-56 Oracle CRM Application Foundation API Reference Guide

Page 87: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.3 Update_MediaItemThe following table lists the messages and notifications generated by the Update_MediaItem API.

2.6.1.4 Add_MediaLifecycleThe following table lists the messages and notifications generated by the Add_MediaLifecycle API.

Table 2–37 Update Media Item Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_MediaItem): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Update_MediaItem): The value <parameter value> for media_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Update_MediaItem): The value <parameter value> for media_item_type is invalid.

Table 2–38 Add Media Lifecycle Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Medialifecycle): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Add_Medialifecycle): The value <parameter value> for milcs_code is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Add_Medialifecycle): The value <parameter value> for milcs_type_id is invalid.

Interaction History Public APIs 2-57

Page 88: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.5 Close_MediaItemThe following table lists the messages and notifications generated by the Close_MediaItem API.

2.6.1.6 Open_InteractionThe following table lists the messages and notifications generated by the Open_Interaction API.

Table 2–39 Close Media Item Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_MediaItem): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Close_MediaItem): The value <parameter value> for media_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB. Close_MediaItem): The value <parameter value> for media_item_type is invalid.

Table 2–40 Open Interaction Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for party_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for resource_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for party_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for resource_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for handler_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for outcome_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for result_id is invalid.

2-58 Oracle CRM Application Foundation API Reference Guide

Page 89: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for reason_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for script_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for source_code_id set and source_code not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for source_code set and source_code_id not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for interaction_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for non_production_time_amount.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Open_Interaction): The value <parameter value> for interaction is not active.

Table 2–40 Open Interaction Messages

Type Name Text

Interaction History Public APIs 2-59

Page 90: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.7 Update_InteractionThe following table lists the messages and notifications generated by the Update_Interaction API.

Table 2–41 Update Interaction Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for party_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for resource_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for party_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for resource_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for handler_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for outcome_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for result_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for reason_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for script_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for source_code_id set and source_code not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for source_code set and source_code_id not set is invalid.

2-60 Oracle CRM Application Foundation API Reference Guide

Page 91: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.8 Add_ActivityThe following table lists the messages and notifications generated by the Add_Activity API.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for interaction_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for non_production_time_amount.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Interaction): The value <parameter value> for interaction is not active.

Table 2–42 Add Activity Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for outcome_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for result_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for reason_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for source_code_id set and source_code not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for source_code set and source_code_id not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for end_date_time is invalid.

Table 2–41 Update Interaction Messages

Type Name Text

Interaction History Public APIs 2-61

Page 92: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.9 Update_ActivityThe following table lists the messages and notifications generated by the Update_Activity API.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for activity_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for cust_account_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Add_Activity):The value <parameter value> for active is not active.

Table 2–43 Update Activity Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for outcome_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for result_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for reason_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for source_code_id set and source_code not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for source_code set and source_code_id not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for end_date_time is invalid.

Table 2–42 Add Activity Messages

Type Name Text

2-62 Oracle CRM Application Foundation API Reference Guide

Page 93: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

2.6.1.10 Close_InteractionThe following table lists the messages and notifications generated by the Close_Interaction API.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for activity_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for cust_account_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Update_Activity): The value <parameter value> for active is not active.

Table 2–44 Close Interaction Messages

Type Name Text

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for party_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for resource_id touchpoint1_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for party_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for resource_id touchpoint2_type is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for handler_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for outcome_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for result_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for reason_id is invalid.

Table 2–43 Update Activity Messages

Type Name Text

Interaction History Public APIs 2-63

Page 94: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

2.7 Sample CodeThis section contains SQL scripts that call the following types of Interaction History public APIs contained in the JTF_IH_PUB package and insert values as required:

■ Non-cached Creation APIs

■ Cached Creation APIs

■ Counting APIs

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for action_item_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for action_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for script_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for source_code_id set and source_code not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for source_code set and source_code_id not set is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for end_date_time is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for interaction_id is invalid.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for non_production_time_amount.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (JTF_IH_PUB.Close_Interaction): The value <parameter value> for interaction is not active.

Table 2–44 Close Interaction Messages

Type Name Text

2-64 Oracle CRM Application Foundation API Reference Guide

Page 95: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

2.7.1 Non-cached Creation APIsThe SQL scripts in this section build a customer interaction record by calling the non-cached creation APIs in succession and by providing them with the required values.

2.7.1.1 Create_MediaItemThis script calls the Create_MediaItem API and provides the following values using the Create_MediaItem IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_media: the record type, media_rec_type contained in the JTF_IH_PUB and identified here as l_media

■ p_mlcs: the record type, mlcs_tbl_type contained in the JTF_IH_PUB and identified here as l_mlcs

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER;

Interaction History Public APIs 2-65

Page 96: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id;

2-66 Oracle CRM Application Foundation API Reference Guide

Page 97: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

-- Test: Create_MediaItem,l_media.media_id := NULL;l_media.source_id := NULL;l_media.direction := NULL;--l_media.duration := null;--l_media.end_date_time := null;l_media.interaction_performed := NULL;l_media.start_date_time := SYSDATE;l_media.media_data := 'N';l_media.source_item_id := NULL;l_media.media_item_type := 'VM';l_media.media_item_ref := NULL;l_media.media_abandon_flag := NULL;l_media.media_transferred_flag := NULL;

JTF_IH_PUB.Create_MediaItem ( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_media, l_mlcs ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Create_MediaItem Method - II');

Interaction History Public APIs 2-67

Page 98: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Create_MediaItem Method - II - l_return_status: '||l_return_status);

2.7.1.2 Create_MediaLifecycleThis script calls the Create_MediaLifecycle API and provides the following values using the Create_MediaLifecycle IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_media_lc_rec: the record type, media_lc_rec_type contained in the JTF_IH_PUB and identified here as l_media_lc_rec

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER;

2-68 Oracle CRM Application Foundation API Reference Guide

Page 99: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

l_media_lc_rec.media_id := l_media_id;

Interaction History Public APIs 2-69

Page 100: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_media_lc_rec.start_date_time := sysdate;l_media_lc_rec.handler_id := 690;l_media_lc_rec.resource_id := xresource_id;l_media_lc_rec.milcs_type_id := 9; jtf_ih_pub.Create_MediaLifecycle( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_media_lc_rec); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Create_MediaLifecycle ');DBMS_OUTPUT.PUT_LINE('Create_MediaLifecycle - l_return_status: '||l_return_status);

2.7.1.3 Create_InteractionThis script calls the Create_Interaction API and provides the following values using the Create_Interaction IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

2-70 Oracle CRM Application Foundation API Reference Guide

Page 101: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_interaction_rec: the record type, interaction_rec_type contained in the JTF_IH_PUB and identified here as l_interaction_rec

■ p_activity: the record type, activity_tbl_type contained in the JTF_IH_PUB and identified here as l_activity_tbl

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1;

Interaction History Public APIs 2-71

Page 102: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));FOR K in 1..xInteraction_Count LOOP

--Create interaction

l_interaction_rec.interaction_id := NULL; l_interaction_rec.reference_form := 'Test for Create Interaction'; l_interaction_rec.follow_up_action := 'No FollowUp'; -- l_interaction_rec.duration := 15; -- l_interaction_rec.start_date_time := to_date('23-OCT-2000', 'DD-MON-YYYY'); l_interaction_rec.start_date_time := sysdate; -- l_interaction_rec.end_date_time := to_date('31-OCT-2000', 'DD-MON-YYYY'); -- l_interaction_rec.end_date_time := NULL; -- l_interaction_rec.inter_interaction_duration := 12; l_interaction_rec.non_productive_time_amount := NULL;

2-72 Oracle CRM Application Foundation API Reference Guide

Page 103: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_interaction_rec.preview_time_amount := 2; l_interaction_rec.productive_time_amount := 12; l_interaction_rec.wrapup_time_amount := 1; l_interaction_rec.handler_id := 690; -- Customers: please validate for your environment l_interaction_rec.script_id := NULL; l_interaction_rec.outcome_id := 4; l_interaction_rec.result_id := 2; l_interaction_rec.reason_id := 2; l_interaction_rec.resource_id := xresource_id; -- A environment l_interaction_rec.party_id := xparty_id; -- B environment l_interaction_rec.parent_id := NULL; -- --add an activities -- for idx in 1..xparty_id loop l_activity_rec.activity_id := NULL; l_activity_rec.duration := NULL; l_activity_rec.cust_account_id := NULL; --checked l_activity_rec.cust_org_id := null; l_activity_rec.role := 1; l_activity_rec.script_trans_id := NULL;

l_activity_rec.start_date_time := sysdate; l_activity_rec.end_date_time := NULL;

l_activity_rec.media_id := NULL; l_activity_rec.action_item_id := 17; l_activity_rec.interaction_id := NULL; l_activity_rec.outcome_id := 7; l_activity_rec.result_id := 7; l_activity_rec.reason_id := 8; l_activity_rec.description := 'test Activity 1'; l_activity_rec.interaction_action_type := 'unknown';

if nDbl = 1 then l_activity_rec.action_id := 14; nDbl := 2; else l_activity_rec.action_id := 13; nDbl := 1; end if;

l_activity_tbl(idx) := l_activity_rec; end loop; APPS.JTF_IH_PUB.Create_Interaction

Interaction History Public APIs 2-73

Page 104: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_interaction_rec, l_activity_tbl ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;END LOOP; DBMS_OUTPUT.PUT_LINE('PAST Create_Interaction ');

2.7.2 Cached Creation APIsThe SQL scripts in this section build a customer interaction record by calling the cached creation APIs in succession and by providing them with the required values.

2.7.2.1 Open_MediaItemThis script calls the Open_MediaItem API and provides the following values using the Open_MediaItem IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

2-74 Oracle CRM Application Foundation API Reference Guide

Page 105: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_media: the record type, media_rec_type contained in the JTF_IH_PUB and identified here as l_media

■ p_media_rec: the record type, mlcs_tbl_type contained in the JTF_IH_PUB and identified here as l_mlcs

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

Interaction History Public APIs 2-75

Page 106: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

JTF_IH_PUB.Open_MediaItem ( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_media, l_media_id

2-76 Oracle CRM Application Foundation API Reference Guide

Page 107: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

); if l_return_status != 'S' then/* JTF_IH_PUB.Add_MediaLifecycle ( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_mlcs, l_milcs_id);

if l_return_status != 'S' then FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; end if; else*/ FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; end if; dbms_output.put_line(l_return_status); dbms_output.put_line(l_msg_count); dbms_output.put_line(l_media_id);end;

2.7.2.2 Update_MediaItemThis script calls the Update_MediaItem API and provides the following values using the Update_MediaItem IN parameters:

■ p_api_version: 1.0

Interaction History Public APIs 2-77

Page 108: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_media_rec: the record type, media_rec_type contained in the JTF_IH_PUB and identified here as l_media. The the media_id field of this recordy type has been modified to l_media_id, and the direction field has been modified as Updated media_id.

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80);

2-78 Oracle CRM Application Foundation API Reference Guide

Page 109: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

FOR K in 1..xInteraction_Count LOOP

l_media.media_id := l_media_id;l_media.direction := 'Updated Media_ID';

JTF_IH_PUB.Update_MediaItem (

Interaction History Public APIs 2-79

Page 110: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_media ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Update_MediaItem ');DBMS_OUTPUT.PUT_LINE('Update_MediaItem - l_return_status: '||l_return_status);

2.7.2.3 Add_MediaLifecycleThis script calls the Add_MediaLifecycle API and provides the following values using the Add_MediaLifecycle IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ l_media_lc_rec: the record type, media_lc_rec_type contained in the JTF_IH_PUB and identified here as l_media_lc_rec

2-80 Oracle CRM Application Foundation API Reference Guide

Page 111: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

Interaction History Public APIs 2-81

Page 112: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

JTF_IH_Pub.Add_MediaLifecycle(1.0,'T','T',680,-1,2877,-1,l_return_status,l_msg_count,l_msg_data,l_media_lc_rec,l_milcs_id); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP;

2-82 Oracle CRM Application Foundation API Reference Guide

Page 113: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

END IF;

DBMS_OUTPUT.PUT_LINE('PAST Add_MediaLifecycle ');DBMS_OUTPUT.PUT_LINE('Add_MediaLifecycle - l_return_status: '||l_return_status);

2.7.2.4 Update_MediaLifecycleThis script calls the Update_MediaLifecycle API and provides the following values using the Update_MediaLifecycle IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ l_media_lc_rec: the record type, media_lc_rec_type contained in the JTF_IH_PUB and identified here as l_media_lc_rec. The milcs_id field of this record type has been modified as l_milcs_id.

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER;

Interaction History Public APIs 2-83

Page 114: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id;

2-84 Oracle CRM Application Foundation API Reference Guide

Page 115: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

l_media_lc_rec.milcs_id := l_milcs_id;JTF_IH_PUB.Update_MediaLifecycle(1.0,'T','T',690,-1,2877,-1,l_return_status,l_msg_count,l_msg_data,l_media_lc_rec); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Update_MediaLifecycle ');DBMS_OUTPUT.PUT_LINE('Update_MediaLifecycle - l_return_status: '||l_return_status);

2.7.2.5 Close_MediaItemThis script calls the Close_MediaItem API and provides the following values using the Close_MediaItem IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

Interaction History Public APIs 2-85

Page 116: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_media_rec: the record type, media_rec_type contained in the JTF_IH_PUB and identified here as l_media. The media_id field of this record type has been modified as l_media_id.

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER;

2-86 Oracle CRM Application Foundation API Reference Guide

Page 117: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

l_media.media_id := l_media_id;

JTF_IH_PUB.Close_MediaItem ( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_media ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F');

Interaction History Public APIs 2-87

Page 118: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;DBMS_OUTPUT.PUT_LINE('PAST Close_MediaItem ');DBMS_OUTPUT.PUT_LINE('Close_MediaItemv - l_return_status: '||l_return_status);DBMS_SESSION.SET_SQL_TRACE(FALSE);end;/

2.7.2.6 Open_InteractionThis script calls the Open_Interaction API and provides the following values using the Open_Interaction IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_interaction_rec: the record type, interaction_rec_type contained in the JTF_IH_PUB and identified here as l_interaction_rec

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER;

2-88 Oracle CRM Application Foundation API Reference Guide

Page 119: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

Interaction History Public APIs 2-89

Page 120: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_interaction_rec.interaction_id := NULL; l_interaction_rec.reference_form := 'Test for JTF Open Interaction (Will close by Method 2)'; l_interaction_rec.start_date_time := sysdate; l_interaction_rec.start_date_time := sysdate; l_interaction_rec.handler_id := 690; -- Bell South: please validate for your environment l_interaction_rec.script_id := NULL; l_interaction_rec.outcome_id := 4; l_interaction_rec.result_id := 2; l_interaction_rec.reason_id := 2; l_interaction_rec.resource_id := xresource_id; -- jtfdom environment l_interaction_rec.party_id := xparty_id; -- JTFTECH environment l_interaction_rec.parent_id := NULL;

JTF_IH_PUB.Open_Interaction( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_interaction_rec, l_interaction_id ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('PAST Open_Interaction '); DBMS_OUTPUT.PUT_LINE('Open_Interaction - l_return_status: '||l_return_status); -- --Interaction implicit notes bind --

jtf_notes_pub.create_note( p_api_version => 1.0, p_source_object_id => l_interaction_id, p_source_object_code => 'JTF_INTERACTION', p_notes => 'Service Request Interaction - Note 1 - Customer claims that automatic water softener is non-functional. Request full refund.', p_entered_by => 2877,

2-90 Oracle CRM Application Foundation API Reference Guide

Page 121: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

p_entered_date => sysdate, p_last_update_date => sysdate, p_last_updated_by => 2877, p_creation_date => sysdate, x_jtf_note_id => l_jtf_note_id, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_return_status => l_return_status); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT('return_jtf_note_id: ' || l_jtf_note_id); IF (l_msg_count >= 1) THEN --Only one error FND_MSG_PUB.Get(p_msg_index => FND_MSG_PUB.G_FIRST, p_encoded=>'F', p_data=>l_data, p_msg_index_out=>l_msg_index_out); DBMS_OUTPUT.PUT_LINE('Message(' || 1 ||'):= ' || l_data); IF (l_msg_count > 1) THEN --Display all the error messages FOR j in 2..FND_MSG_PUB.Count_Msg LOOP FND_MSG_PUB.Get(p_msg_index => FND_MSG_PUB.G_NEXT, p_encoded=>'F', p_data=>l_data, p_msg_index_out=>l_msg_index_out); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' || l_data); END LOOP; END IF; END IF; DBMS_OUTPUT.PUT_LINE(' ');

l_interaction_rec.reference_form := 'Test for JTF Open Interaction';

JTF_IH_PUB.Open_Interaction( 1.0, 'T', 'T', 690, -1, 2877,

Interaction History Public APIs 2-91

Page 122: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-1, l_return_status, l_msg_count, l_msg_data, l_interaction_rec, l_interaction_id_2 ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('PAST Open_Interaction '); DBMS_OUTPUT.PUT_LINE('PAST Open_Interaction - l_return_status: '||l_return_status);

2.7.2.7 Update_InteractionThis script calls the Update_Interaction API and provides the following values using the Update_Interaction IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_interaction_rec: the record type, interaction_rec_type contained in the JTF_IH_PUB and identified here as l_interaction_rec

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

2-92 Oracle CRM Application Foundation API Reference Guide

Page 123: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' ');

Interaction History Public APIs 2-93

Page 124: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

l_interaction_rec.interaction_id := l_interaction_id; l_interaction_rec.reference_form := 'Test for Update Interaction';

JTF_IH_PUB.Update_Interaction( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_interaction_rec ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF; DBMS_OUTPUT.PUT_LINE('PAST Update_Interaction '); DBMS_OUTPUT.PUT_LINE('Update_Interaction - l_return_status: '||l_return_status);

--

2.7.2.8 Add_ActivityThis script calls the Add_Activity API and provides the following values using the

Add_Activity IN parameters:

2-94 Oracle CRM Application Foundation API Reference Guide

Page 125: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_activity_rec: the record type, activity_rec_type contained in theJTF_IH_PUB and identified here as l_activity_rec

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80);

Note: The sample script implicitly binds the activity to a note. See Chapter 5, "Notes Public APIs" for more information about creating and updating a note.

Interaction History Public APIs 2-95

Page 126: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

l_activity_rec.activity_id := NULL; l_activity_rec.duration := NULL; l_activity_rec.cust_account_id := NULL; --checked l_activity_rec.cust_org_id := null; l_activity_rec.role := 1; l_activity_rec.script_trans_id := fnd_api.g_miss_num;

2-96 Oracle CRM Application Foundation API Reference Guide

Page 127: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_activity_rec.start_date_time := sysdate; -- l_activity_rec.start_date_time := to_date('29-SEP-2000 13:00:00', 'DD-MON-YYYY HH24:MI:SS'); l_activity_rec.end_date_time := NULL; -- l_activity_rec.end_date_time := to_date('26-JUL-2000 13:11:25', 'DD-MON-YYYY HH24:MI:SS'); -- l_activity_rec.end_date_time := to_date('29-SEP-2000 13:11:25', 'DD-MON-YYYY HH24:MI:SS');

-- l_activity_rec.task_id := 30; -- l_activity_rec.doc_id := 1; -- l_activity_rec.doc_ref := 1; l_activity_rec.media_id := NULL; l_activity_rec.action_item_id := 17; l_activity_rec.interaction_id := l_interaction_id; l_activity_rec.outcome_id := 7; l_activity_rec.result_id := 7; l_activity_rec.reason_id := 8; l_activity_rec.description := 'test Add Activity'; l_activity_rec.action_id := 13; l_activity_rec.interaction_action_type := 'unknown'; -- l_activity_rec.object_id := 1; -- l_activity_rec.object_type := 'JEZHU_Type_1'; -- l_activity_rec.source_code_id := 10000; -- l_activity_rec.source_code := 'EEXHB10000'; JTF_IH_PUB.Add_Activity(1.0, 'T', 'T', -1, 690, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_activity_rec, l_activity_id_1); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Add_Activity '); DBMS_OUTPUT.PUT_LINE('Add_Activity - l_return_status: '||l_return_status);

IF (l_msg_count >= 1) THEN

Interaction History Public APIs 2-97

Page 128: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

--Only one error FND_MSG_PUB.Get(p_msg_index => FND_MSG_PUB.G_FIRST, p_encoded=>'F', p_data=>l_data, p_msg_index_out=>l_msg_index_out); DBMS_OUTPUT.PUT_LINE('Message(' || 1 ||'):= ' || l_data); IF (l_msg_count > 1) THEN --Display all the error messages FOR j in 2..FND_MSG_PUB.Count_Msg LOOP FND_MSG_PUB.Get(p_msg_index => FND_MSG_PUB.G_NEXT, p_encoded=>'F', p_data=>l_data, p_msg_index_out=>l_msg_index_out); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' || l_data); END LOOP; END IF; END IF; DBMS_OUTPUT.PUT_LINE(' '); -- --Activity implicit notes bind --

jtf_notes_pub.create_note( p_api_version => 1.0, p_source_object_id => l_activity_id_1, p_source_object_code => 'JTF_ACTIVITY', p_notes => 'Service Request Activity 1 - Note 1 - Customer is angry. Rust color water.', p_entered_by => 2877, p_entered_date => sysdate, p_last_update_date => sysdate, p_last_updated_by => 2877, p_creation_date => sysdate, x_jtf_note_id => l_jtf_note_id, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_return_status => l_return_status); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT('return_jtf_note_id: ' || l_jtf_note_id); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT('Activity 1 Implicit Note return_status: ' || l_return_status); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT('msg_count: ' || l_msg_count); DBMS_OUTPUT.PUT_LINE(' '); IF (l_msg_count >= 1) THEN --Only one error FND_MSG_PUB.Get(p_msg_index => FND_MSG_PUB.G_FIRST, p_encoded=>'F', p_data=>l_data, p_msg_index_out=>l_msg_index_out);

2-98 Oracle CRM Application Foundation API Reference Guide

Page 129: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Message(' || 1 ||'):= ' || l_data); IF (l_msg_count > 1) THEN --Display all the error messages FOR j in 2..FND_MSG_PUB.Count_Msg LOOP FND_MSG_PUB.Get(p_msg_index => FND_MSG_PUB.G_NEXT, p_encoded=>'F', p_data=>l_data, p_msg_index_out=>l_msg_index_out); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' || l_data); END LOOP; END IF; END IF; DBMS_OUTPUT.PUT_LINE(' ');

2.7.2.9 Update_ActivityThis script calls the Update_Activity API and provides the following values using the Update_Activity IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_activity_rec: the record type, activity_rec_type contained in theJTF_IH_PUB and identified here as l_activity_rec. The activity_id field for this record type has been changed to l_activity_id_1 and the description field has been changed to "test update activity".

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER;

Interaction History Public APIs 2-99

Page 130: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count;

2-100 Oracle CRM Application Foundation API Reference Guide

Page 131: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate;

DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

l_activity_rec.activity_id := l_activity_id_1; l_activity_rec.description := 'Test Update Activity';

JTF_IH_PUB.Update_Activity(1.0, 'T', 'T', -1, 690, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_activity_rec); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

2.7.2.10 Update_ActivityDurationThis script calls the Update_ActivityDuration API and provides the following

values using the Update_ActivityDuration IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

Interaction History Public APIs 2-101

Page 132: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_activity_id: the activity identifier is l_activity_id_1

■ p_end_date_time: the end date and time is determined using the SYSDATE SQL command

■ p_duration: the activity duration is 1 second

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

2-102 Oracle CRM Application Foundation API Reference Guide

Page 133: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate;

DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

JTF_IH_PUB.Update_ActivityDuration ( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_activity_id_1, sysdate, 1 ); IF l_return_status != 'S' THEN

Interaction History Public APIs 2-103

Page 134: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

--Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Update_ActivityDuration '); DBMS_OUTPUT.PUT_LINE('Update_ActivityDuration - l_return_status: '||l_return_status);

2.7.2.11 Close_InteractionThis script contains two different methods for calling the Close_Interaction API and for providing the following values using the Close_Interaction IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_commit: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_interaction_rec: the record type, interaction_rec_type contained in theJTF_IH_PUB and identified as l_interaction_rec for method 1 andl_interaction_id_2 for method 2

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER;

2-104 Oracle CRM Application Foundation API Reference Guide

Page 135: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001');

Interaction History Public APIs 2-105

Page 136: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate;

DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

---- Method - I-- l_interaction_rec.interaction_id := l_interaction_id; JTF_IH_PUB.Close_Interaction( 1.0, 'T', 'T', 690, -1, 2877, null, l_return_status, l_msg_count, l_msg_data, l_interaction_rec); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Close_Interaction Method 1 '); DBMS_OUTPUT.PUT_LINE('Close_Interaction - l_return_status: '||l_return_status);---- Method - II--

JTF_IH_PUB.Close_Interaction( 1.0, 'T', 'T', 690, -1,

2-106 Oracle CRM Application Foundation API Reference Guide

Page 137: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

2877, null, l_return_status, l_msg_count, l_msg_data, l_interaction_id_2 ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Close_Interaction Method 2'); DBMS_OUTPUT.PUT_LINE('Close_Interaction - l_return_status: '||l_return_status);---- Close_MediaItem--l_media.media_id := l_media_id;

JTF_IH_PUB.Close_MediaItem ( 1.0, 'T', 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_media ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F');

Interaction History Public APIs 2-107

Page 138: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;DBMS_OUTPUT.PUT_LINE('PAST Close_MediaItem ');DBMS_OUTPUT.PUT_LINE('Close_MediaItemv - l_return_status: '||l_return_status);DBMS_SESSION.SET_SQL_TRACE(FALSE);end;/

2.7.3 Counting APIsThe SQL scripts in this section pass filtering parameters to the counting APIs to return the count on an interaction or an activity.

2.7.3.1 Get_InteractionActivityCountThis script calls the Get_InteractionActivityCount API and provides the following

filtering parameters using the Get_InteractionActivityCount IN parameters:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_outcome_id: the activity's outcome identifier is l_activity_rec.outcome_id

■ p_result_id: the activity's result identifier is l_activity_rec.result_id

■ p_reason_id: the activity's reason identifier is l_activity_rec.reason_id

■ p_script_id: the interaction's script identifier is l_interaction_rec.script_id

■ p_media_id: the activity's media identifier is l_activity_rec.media_id

set serveroutput on;

declare l_return_status VARCHAR2(30);

2-108 Oracle CRM Application Foundation API Reference Guide

Page 139: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80); status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values

Interaction History Public APIs 2-109

Page 140: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

JTF_IH_PUB.Get_InteractionActivityCount ( 1.0, 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_activity_rec.outcome_id, l_activity_rec.result_id, l_activity_rec.reason_id, l_interaction_rec.script_id, l_activity_rec.media_id, l_activity_count ); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Get_InteractionActivityCount '); DBMS_OUTPUT.PUT_LINE('Get_InteractionActivityCount - l_return_status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('l_activity_count - '|| to_char(l_activity_count));

2.7.3.2 Get_InteractionCountThis script calls the Get_InteractionCount API and provides the following input parameters using the Get_InteractionCount IN parameters, to derive an interaction

2-110 Oracle CRM Application Foundation API Reference Guide

Page 141: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

count:

■ p_api_version: 1.0

■ p_init_msg_list: T indicates that this parameter is set to true

■ p_resp_appl_id: the application identifier is 690

■ p_resp_id: the responsibility identifier is -1

■ p_user_id: the user identifier is 2877

■ p_login_id: the login identifier is -1

■ p_outcome_id: the interaction's outcome identifier is l_interaction_rec.outcome_id

■ p_result_id: the interaction's result identifier is l_interaction_rec.result_id

■ p_reason_id: the interaction's reason identifier is l_interaction_rec.reason_id

set serveroutput on;

declare l_return_status VARCHAR2(30); l_msg_count NUMBER; l_msg_data VARCHAR2(200);

l_interaction_rec APPS.JTF_IH_PUB.interaction_rec_type; l_interaction_id NUMBER; l_jtf_note_id NUMBER; m_count NUMBER := 0; m_active VARCHAR2(1); p_interaction_id NUMBER;

l_activity_rec APPS.JTF_IH_PUB.activity_rec_type; l_activity_id_1 NUMBER; l_activity_id_2 NUMBER; m_activitycount NUMBER := 0; m_activityactive VARCHAR2(1); l_startdatecheck VARCHAR2(30); l_enddatecheck VARCHAR2(30); l_data VARCHAR2(8000); l_msg_index_out NUMBER; xInteraction_Count NUMBER := 2; cInteraction_Count VARCHAR2(80); xparty_id NUMBER := 1000; cparty_id VARCHAR2(80); xresource_id NUMBER := 10039; cresource_id VARCHAR2(80);

Interaction History Public APIs 2-111

Page 142: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

status NUMBER; end_time_runDATE; begin_time_runDATE; total_time_runNUMBER; nDbl NUMBER := 1; l_activity_tbl JTF_IH_PUB.activity_tbl_type;

l_media APPS.JTF_IH_PUB.media_rec_type; l_media_lc_rec APPS.JTF_IH_PUB.media_lc_rec_type; l_media_id NUMBER; l_mlcs APPS.JTF_IH_PUB.mlcs_tbl_type; l_milcs_id NUMBER;

l_activity_count NUMBER; l_interaction_count NUMBER; l_interaction_id_2 NUMBER;begin DBMS_SESSION.SET_SQL_TRACE(TRUE); DBMS_TRACE.SET_PLSQL_TRACE(DBMS_TRACE.TRACE_ALL_CALLS+ DBMS_TRACE.TRACE_ALL_EXCEPTIONS+ DBMS_TRACE.TRACE_RESUME);

-- obtain loop parameter values DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Interaction History (IH) Test Script'); DBMS_OUTPUT.PUT_LINE(' '); DBMS_OUTPUT.PUT_LINE('Author: Author’s Name Here.'); DBMS_OUTPUT.PUT_LINE('Version 1.0 - Initial Version - 06.27.2001'); DBMS_OUTPUT.PUT_LINE(' '); xInteraction_Count := &xInteraction_Count; xparty_id := &xparty_id; xresource_id := &xresource_id; -- begin major loop begin_time_run := sysdate; DBMS_OUTPUT.PUT_LINE('Start Time := ' || TO_CHAR(begin_time_run, 'DD-MON-YYYY:HH:MI:SS'));

JTF_IH_PUB.Get_InteractionCount( 1.0, 'T', 690, -1, 2877, -1, l_return_status, l_msg_count, l_msg_data, l_interaction_rec.outcome_id, l_interaction_rec.result_id, l_interaction_rec.reason_id,

2-112 Oracle CRM Application Foundation API Reference Guide

Page 143: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_interaction_count => l_interaction_count); IF l_return_status != 'S' THEN --Display all the error messages FOR j in 1..FND_MSG_PUB.Count_Msg LOOP dbms_output.put_line(j); l_msg_data := FND_MSG_PUB.Get(p_msg_index => j, p_encoded=>'F'); DBMS_OUTPUT.PUT_LINE('Message(' || j ||'):= ' ||l_msg_data); END LOOP; END IF;

DBMS_OUTPUT.PUT_LINE('PAST Get_InteractionCount '); DBMS_OUTPUT.PUT_LINE('Get_InteractionCount - l_return_status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('l_interaction_count - '|| to_char(l_interaction_count));

Interaction History Public APIs 2-113

Page 144: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

2-114 Oracle CRM Application Foundation API Reference Guide

Page 145: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Resource Manager Publ

3

Resource Manager Public APIs

Resource Manager provides the CRM modules with a common framework for importing, defining and viewing resources, creating teams and groups, and organizing resources within those teams and groups. Other CRM applications access resources through Resource Manager. Resource Manager acts as the central repository and provides a consistent API interface for working with resources.

The following topics are discussed in this chapter:

■ Resource Manager Public Packages

■ Messages and Notifications

■ Sample Code

3.1 Resource Manager Public PackagesThere are three public Resource Manager packages:

■ Package JTF_RS_RESOURCE_PUB

■ Package JTF_RS_GROUPS_PUB

■ Package JTF_RS_SALESREPS_PUB

Package JTF_RS_RESOURCE_PUBAll public procedures (APIs) relating to creating or updating a resource are stored in package JTF_RS_RESOURCE_PUB. This package contains the following APIs:

■ Create_Resource

■ Update_Resource

ic APIs 3-1

Page 146: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Resource Manager Public Packages

Package JTF_RS_GROUPS_PUBAll public procedures (APIs) relating to creating or updating a resource group are stored in package JTF_RS_GROUPS_PUB. This package contains the following APIs:

■ Create_Resource_Group

■ Update_Resource_Group

Package JTF_RS_SALESREPS_PUBAll public procedures (APIs) relating to creating or updating a salesperson are stored in package JTF_RS_SALESREPS_PUB. This package contains the following APIs:

■ Create_SalesRep

■ Update_SalesRep

3.1.1 Resource Manager Public APIsThe following table describes the public APIs which are discussed in this chapter.

Table 3–1 Resource Manager Public APIs

Procedure Description

Create_Resource Creates all categories of resources like Employee, Party, Supplier Contact, Other, Partner, and To Be Hired.

Update_Resource Updates resource attributes like Resource Name, Start Date, End Date, and User Identifier.

Create_Resource_Group Creates a Resource Group.

Update_Resource_Group

Updates Resource Group attributes such as Group Name, Group Description, Start and End Date effectively.

Create_SalesRep Creates a salesperson. The API verifies the resource ID parameter from the jtf_rs_resourc_.extns table.

Update_SalesRep Updates SalesRep attributes like SalesRep Number, Sales Credit Type, Start and End Date effectively.

3-2 Oracle CRM Application Foundation API Reference Guide

Page 147: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

3.2 Package JTF_RS_RESOURCE_PUBThis package contains the following APIs:

■ Create_Resource

■ Update_Resource

3.2.1 Create_Resource The Create_Resource API create s all resource categories including Employee, Party, Supplier Contact, and Other. Before creating the resource, the Create_Resource API first determines that it does not exist in the Resources table. After in creates the resource, the API inserts Call Center, Compensation, and Account Receivables information that pertain to the resource into resource tables and generates the following unique identifiers:

■ resource_id

■ resource_number

Resource Information versus Source InformationWithin the Resource Manager, resource information and source information are two different types of information.

■ Resource information (name, number, category, and similar items) is defined within the Resource Manager, or through its APIs. This information can be changed or modified at will.

■ Source information (source_id, source_name, source_number, and similar items) are pulled into the Resource Manager from another "source." Information extracted from a source external to the Resource Manager is not changed by the Resource Manager or its APIs.

Example sources include:

■ Oracle Human Resources tables

■ Oracle HZ Party tables

Note: The calling application must pass in the resource name to both p_resource_name and p_source_name. To ensure correct operation of the API, neither of these values can be NULL.

Resource Manager Public APIs 3-3

Page 148: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

Procedure Specification PROCEDURE create_resource( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_category in jtf_rs_resource_extns.category%type, p_source_id in jtf_rs_resource_extns.source_id%type default null, p_address_id in jtf_rs_resource_extns.address_id%type default null, p_contact_id in jtf_rs_resource_extns.contact_id%type default null, p_managing_emp_id in jtf_rs_resource_extns.managing_employee_id%type default null, p_managing_emp_num in per_employees_current_x.employee_num%type default null, p_start_date_active in jtf_rs_resource_extns.start_date_active%type, p_end_date_active in jtf_rs_resource_extns.end_date_active%type default null, p_time_zone in jtf_rs_resource_extns.time_zone%type default null, p_cost_per_hr in jtf_rs_resource_extns.cost_per_hr%type default null, p_primary_language in jtf_rs_resource_extns.primary_language%type default null, p_secondary_language in jtf_rs_resource_extns.secondary_language%type default null, p_support_site_id in jtf_rs_resource_extns.support_site_id%type default null, p_ies_agent_login in jtf_rs_resource_extns.ies_agent_login%type default null, p_server_group_id in jtf_rs_resource_extns.server_group_id%type default null, p_interaction_center_name in varchar2 default null, p_assigned_to_group_id in jtf_rs_resource_extns.assigned_to_group_id%type default null, p_cost_center in jtf_rs_resource_extns.cost_center%type default null, p_charge_to_cost_center in jtf_rs_resource_extns.charge_to_cost_center%type default null, p_comp_currency_code in jtf_rs_resource_extns.compensation_currency_code%type default null, p_commissionable_flag in jtf_rs_resource_extns.commissionable_flag%type default 'y', p_hold_reason_code in jtf_rs_resource_extns.hold_reason_code%type default null, p_hold_payment in jtf_rs_resource_extns.hold_payment%type default 'n', p_comp_service_team_id in jtf_rs_resource_extns.comp_service_team_id%type default null, p_user_id in jtf_rs_resource_extns.user_id%type default null, p_transaction_number in jtf_rs_resource_extns.transaction_number%type default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, x_resource_id out jtf_rs_resource_extns.resource_id%type, x_resource_number out jtf_rs_resource_extns.resource_number%type, p_resource_name in jtf_rs_resource_extns_tl.resource_name%type default null, p_source_name in jtf_rs_resource_extns.source_name%type, p_source_number in jtf_rs_resource_extns.source_number%type default null, p_source_job_title in jtf_rs_resource_extns.source_job_title%type default null, p_source_email in jtf_rs_resource_extns.source_email%type default null, p_source_phone in jtf_rs_resource_extns.source_phone%type default null, p_source_org_id in jtf_rs_resource_extns.source_org_id%type default null, p_source_org_name in jtf_rs_resource_extns.source_org_name%type default null,

3-4 Oracle CRM Application Foundation API Reference Guide

Page 149: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_source_address1 in jtf_rs_resource_extns.source_address1%type default null, p_source_address2 in jtf_rs_resource_extns.source_address2%type default null, p_source_address3 in jtf_rs_resource_extns.source_address3%type default null, p_source_address4 in jtf_rs_resource_extns.source_address4%type default null, p_source_city in jtf_rs_resource_extns.source_city%type default null, p_source_postal_code in jtf_rs_resource_extns.source_postal_code%type default null, p_source_state in jtf_rs_resource_extns.source_state%type default null, p_source_province in jtf_rs_resource_extns.source_province%type default null, p_source_county in jtf_rs_resource_extns.source_county%type default null, p_source_country in jtf_rs_resource_extns.source_country%type default null, p_source_mgr_id in jtf_rs_resource_extns.source_mgr_id%type default null, p_source_mgr_name in jtf_rs_resource_extns.source_mgr_name%type default null, p_source_business_grp_id in jtf_rs_resource_extns.source_business_grp_id%type default null, p_source_business_grp_name in jtf_rs_resource_extns.source_business_grp_name%type default null, p_source_first_name in jtf_rs_resource_extns.source_first_name%type default null, p_source_last_name in jtf_rs_resource_extns.source_last_name%type default null, p_source_middle_name in jtf_rs_resource_extns.source_middle_name%type default null, p_source_category in jtf_rs_resource_extns.source_category%type default null, p_source_status in jtf_rs_resource_extns.source_status%type default null, p_source_office in jtf_rs_resource_extns.source_office%type default null, p_source_location in jtf_rs_resource_extns.source_location%type default null, p_source_mailstop in jtf_rs_resource_extns.source_mailstop%type default null, p_user_name varchar2, p_source_mobile_phone in jtf_rs_resource_extns.source_mobile_phone%type default null, p_source_pager in jtf_rs_resource_extns.source_pager%type default null

);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

Resource Manager Public APIs 3-5

Page 150: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_category jtf_rs_resource_extns.category%type Yes Type of resource, valid types are:

■ EMPLOYEE

■ PARTNER

■ SUPPLIER_CONTACT

■ OTHER

■ PARTY

■ TBH

■ VENUE

p_source_id jtf_rs_resource_extns.resource_id%type No Resource identifier, this parameter is only used with the following categories:

■ EMPLOYEE

■ VENUE

■ PARTY

■ SUPPLIER_CONTACT

■ PARTNER

p_address_id jtf_rs_resource_extns.address_id%type No Resource address.

p_contact_id jtf_rs_resource_extns.contact_id%type No Resource contact identifier.

p_managing_emp_id jtf_rs_resource_extns.managing_employee_id%type

No Identifier for the manager of the resource.

p_managing_emp_num per_employees_current_x.employee_num%type

No Employee number of the resource’s manager.

p_start_date_active jtf_rs_resource_extns.start_date_active%type

Yes Date on which the resource becomes active. This value can not be NULL, and the start date must be less than the end date.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

3-6 Oracle CRM Application Foundation API Reference Guide

Page 151: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_end_date_active jtf_rs_resource_extns.end_date_active%type

No Date on which the resource is no longer active. If no end date is provided, the resource is active indefinitely.

p_time_zone jtf_rs_resource_extns. time_zone %type No Time zone, this value must be a valid time zone as defined in table HZ_TIMEZONES.

p_cost_per_hr jtf_rs_resource_extns. cost_per_hr %type

No The salary cost per hour for this resource. This value is used in conjunction with the p_comp_currency_code parameter.

p_primary_language jtf_rs_resource_extns. primary_language %type

No The resource’s primary language. This value must be a valid NLS language as defined in table FND_LANGUAGES.

p_secondary_language jtf_rs_resource_extns. secondary_language %type

No The resource’s secondary language. This value must be a valid NLS language as defined in table FND_LANGUAGES.

p_support_site_id jtf_rs_resource_extns.support_site_id%type

No Value used by the Service applications.

p_ies_agent_login jtf_rs_resource_extns.ies_agent_login%type

No Value used by Interaction Center applications (if using Oracle Scripting).

p_server_group_id jtf_rs_resource_extns.server_group_id%type

No Value used by Interaction Center applications.

p_interaction_center_name

VARCHAR2 No Value used by Interaction Center applications.

p_assigned_to_group_id jtf_rs_resource_extns.assigned_to_group_id%type

No The group to which this resource is assigned.

p_cost_center jtf_rs_resource_extns.cost_centere%type No The cost center to which this resource is assigned.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

Resource Manager Public APIs 3-7

Page 152: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_charge_to_cost_center jtf_rs_resource_extns.charge_to_cost_center%type

No Cost center to charge against, this may be different than the resource’s current cost center.

p_comp_currency_code jtf_rs_resource_extns.compensation_currency_code

No Compensation currency type, this value must be a valid currency code as listed in table FND_CURRENCIES.

This value is used in conjunction with the p_cost_per_hour parameter.

p_commisionable_flag jtf_rs_resource_extns.commisionable_flag%type

No Boolean value:

■ Yes - This resource is eligible for a commission.

■ No - This resource is not eligible for a commission.

The default is Yes.

p_hold_reason_code jtf_rs_resource_extns.hold_reason_code%type

No The reason that compensation is being withheld. This value must be one of the lookup codes for JTF_RS_HOLD_REASON_TYPE in table FND_LOOKUPS.

p_hold_payment jtf_rs_resource_extns.hold_payment%type

No Boolean value:

■ Yes - Withhold compensation.

■ No - Do not withhold compensation.

The default is No.

p_comp_service_team_id

jtf_rs_resource_extns.comp_service_team_id%type

No The identifier for the team to which this resource belongs.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

3-8 Oracle CRM Application Foundation API Reference Guide

Page 153: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_user_id jtf_rs_resource_extns.user_id%type No Specify this value only if the following categories are used:

■ EMPLOYEE

■ PARTY

■ 'SUPPLIER_CONTACT'

If a category other than these three is specified, the API exits with an unexpected error condition.

This value is validated against table FND_USERS.

p_transaction_number jtf_rs_resource_extns.transaction_number%type

No Transaction identifier

p_resource_name jtf_rs_resource_extns_tl.resource_name%type

No The calling application must pass the resource name.

p_source_name jtf_rs_resource_extns.source_name%type

Yes The calling application passes the source name.

See Resource Information versus Source Information.

p_source_number jtf_rs_resource_extns.source_number%type

No See Resource Information versus Source Information.

p_source_job_title jtf_rs_resource_extns.source_job_title%type

No See Resource Information versus Source Information.

p_source_email jtf_rs_resource_extns.source_email%type

No See Resource Information versus Source Information.

p_source_phone jtf_rs_resource_extns.source_phone%type

No See Resource Information versus Source Information.

p_source_org_id jtf_rs_resource_extns.source_org_id%type

No See Resource Information versus Source Information.

p_source_org_name jtf_rs_resource_extns.source_org_name%type

No See Resource Information versus Source Information.

p_source_address1 jtf_rs_resource_extns.source_address1%type

No See Resource Information versus Source Information.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

Resource Manager Public APIs 3-9

Page 154: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_source_address2 jtf_rs_resource_extns.source_address2%type

No See Resource Information versus Source Information.

p_source_address3 jtf_rs_resource_extns.source_address3%type

No See Resource Information versus Source Information.

p_source_address4 jtf_rs_resource_extns.source_address4%type

No See Resource Information versus Source Information.

p_source_city jtf_rs_resource_extns.source_city%type No See Resource Information versus Source Information.

p_source_postal_code jtf_rs_resource_extns.source_postal_code%type

No See Resource Information versus Source Information.

p_source_state jtf_rs_resource_extns.source_state%type No See Resource Information versus Source Information.

p_source_province jtf_rs_resource_extns.source_province%type

No See Resource Information versus Source Information.

p_source_county jtf_rs_resource_extns.source_county%type

No See Resource Information versus Source Information.

p_source_country jtf_rs_resource_extns.source_country%type

No See Resource Information versus Source Information.

p_source_mgr_id jtf_rs_resource_extns.source_mgr_id%type

No See Resource Information versus Source Information.

p_source_mgr_name jtf_rs_resource_extns.source_mgr_name%type

No See Resource Information versus Source Information.

p_source_business_grp_id

jtf_rs_resource_extns.source_business_grp_id%type

No See Resource Information versus Source Information.

p_source_business_grp_name

jtf_rs_resource_extns.source_business_grp_name%type

No See Resource Information versus Source Information.

p_source_first_name jtf_rs_resource_extns.source_first_name%type

No See Resource Information versus Source Information.

p_source_last_name jtf_rs_resource_extns.source_last_name%type

No See Resource Information versus Source Information.

p_source_middle_name jtf_rs_resource_extns.source_middle_name%type

No See Resource Information versus Source Information.

p_source_category jtf_rs_resource_extns.source_category%type

No See Resource Information versus Source Information.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

3-10 Oracle CRM Application Foundation API Reference Guide

Page 155: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

The following table describes the OUT parameters associated with this API.

3.2.2 Update_Resource The Update_Resource API updates resource attributes such as Resource Name, Start Date, End Date, and User ID. Before updating these attributes, the API first verifies

p_source_status jtf_rs_resource_extns.source_status%type

No See Resource Information versus Source Information.

p_source_office jtf_rs_resource_extns.source_office%type

No See Resource Information versus Source Information.

p_source_location jtf_rs_resource_extns.source_location%type

No See Resource Information versus Source Information.

p_source_mailstop jtf_rs_resource_extns.source_mailstop%type

No See Resource Information versus Source Information.

p_user_name VARCHAR2 Yes The identifier of the person entering values into the source.

p_source_mobile_phone jtf_rs_resource_extns.source_mobile_phone%type

No See Resource Information versus Source Information.

p_source_pager jtf_rs_resource_extns.source_pager%type

No See Resource Information versus Source Information.

Table 3–3 Create_Resource OUT Parameters

Parameter Data type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_resource_id jtf_rs_resource_extns. resource_id %type

The automatically generated resource identifier that is created through an internal call to JTF_RS_RESOURCE_EXTNS_S.

x_resource_number

jtf_rs_resource_extns. resource_number %type

The automatically generated resource number that is created through an internal call to JTF_RS_RESOURCE_NUMBER_S.

Table 3–2 Create_Resource IN Parameters

Parameter Data Type RequiredDescriptions and Validations

Resource Manager Public APIs 3-11

Page 156: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

that the resource exists in the Resources table. The Update_Resource API updates resource information in the Call Center, Compensation, and the Account Receivables tables.

Procedure Specification PROCEDURE update_resource( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resource_id in jtf_rs_resource_extns.resource_id%type, p_resource_number in jtf_rs_resource_extns.resource_number%type, p_managing_emp_id in jtf_rs_resource_extns.managing_employee_id%type default fnd_api.g_miss_num, p_start_date_active in jtf_rs_resource_extns.start_date_active%type default fnd_api.g_miss_date, p_end_date_active in jtf_rs_resource_extns.end_date_active%type default fnd_api.g_miss_date, p_time_zone in jtf_rs_resource_extns.time_zone%type default fnd_api.g_miss_num, p_cost_per_hr in jtf_rs_resource_extns.cost_per_hr%type default fnd_api.g_miss_num, p_primary_language in jtf_rs_resource_extns.primary_language%type default fnd_api.g_miss_char, p_secondary_language in jtf_rs_resource_extns.secondary_language%type default fnd_api.g_miss_char, p_support_site_id in jtf_rs_resource_extns.support_site_id%type default fnd_api.g_miss_num, p_ies_agent_login in jtf_rs_resource_extns.ies_agent_login%type default fnd_api.g_miss_char, p_server_group_id in jtf_rs_resource_extns.server_group_id%type default fnd_api.g_miss_num, p_assigned_to_group_id in jtf_rs_resource_extns.assigned_to_group_id%type default fnd_api.g_miss_num, p_cost_center in jtf_rs_resource_extns.cost_center%type default fnd_api.g_miss_char, p_charge_to_cost_center in jtf_rs_resource_extns.charge_to_cost_center%type default fnd_api.g_miss_char, p_comp_currency_code in jtf_rs_resource_extns.compensation_currency_code%type default fnd_api.g_miss_char, p_commissionable_flag in jtf_rs_resource_extns.commissionable_flag%type default fnd_api.g_miss_char, p_hold_reason_code in jtf_rs_resource_extns.hold_reason_code%type default fnd_api.g_miss_char, p_hold_payment in jtf_rs_resource_extns.hold_payment%type default fnd_api.g_miss_char, p_comp_service_team_id in jtf_rs_resource_extns.comp_service_team_id%type default fnd_api.g_miss_num, p_user_id in jtf_rs_resource_extns.user_id%type default fnd_api.g_miss_num, p_resource_name in jtf_rs_resource_extns_tl.resource_name%type p_source_name in jtf_rs_resource_extns.source_name%type, p_source_number in jtf_rs_resource_extns.source_number%type default fnd_api.g_miss_char, p_source_job_title in jtf_rs_resource_extns.source_job_title%type default fnd_api.g_miss_char, p_source_email in jtf_rs_resource_extns.source_email%type default fnd_api.g_miss_char, p_source_phone in jtf_rs_resource_extns.source_phone%type default fnd_api.g_miss_char, p_source_org_id in number default fnd_api.g_miss_num, p_source_org_name in jtf_rs_resource_extns.source_org_name%type default fnd_api.g_miss_char, p_source_address1 in jtf_rs_resource_extns.source_address1%type default fnd_api.g_miss_char, p_source_address2 in jtf_rs_resource_extns.source_address2%type default fnd_api.g_miss_char, p_source_address3 in jtf_rs_resource_extns.source_address3%type default fnd_api.g_miss_char, p_source_address4 in jtf_rs_resource_extns.source_address4%type default fnd_api.g_miss_char, p_source_city in jtf_rs_resource_extns.source_city%type default fnd_api.g_miss_char, p_source_postal_code in jtf_rs_resource_extns.source_postal_code%type default fnd_api.g_miss_char, p_source_state in jtf_rs_resource_extns.source_state%type default fnd_api.g_miss_char, p_source_province in jtf_rs_resource_extns.source_province%type default fnd_api.g_miss_char,

3-12 Oracle CRM Application Foundation API Reference Guide

Page 157: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_source_county in jtf_rs_resource_extns.source_county%type default fnd_api.g_miss_char, p_source_country in jtf_rs_resource_extns.source_country%type default fnd_api.g_miss_char, p_source_mgr_id in jtf_rs_resource_extns.source_mgr_id%type default fnd_api.g_miss_num, p_source_mgr_name in jtf_rs_resource_extns.source_mgr_name%type default fnd_api.g_miss_char, p_source_business_grp_id in jtf_rs_resource_extns.source_business_grp_id%type default fnd_api.g_miss_num, p_source_business_grp_name in jtf_rs_resource_extns.source_business_grp_name%type default fnd_api.g_miss_char, p_source_first_name in jtf_rs_resource_extns.source_first_name%type default fnd_api.g_miss_char, p_source_last_name in jtf_rs_resource_extns.source_last_name%type default fnd_api.g_miss_char, p_source_middle_name in jtf_rs_resource_extns.source_middle_name%type default fnd_api.g_miss_char, p_source_category in jtf_rs_resource_extns.source_category%type default fnd_api.g_miss_char, p_source_status in jtf_rs_resource_extns.source_status%type default fnd_api.g_miss_char, p_source_office in jtf_rs_resource_extns.source_office%type default fnd_api.g_miss_char, p_source_location in jtf_rs_resource_extns.source_location%type default fnd_api.g_miss_char, p_source_mailstop in jtf_rs_resource_extns.source_mailstop%type default fnd_api.g_miss_char, p_address_id in jtf_rs_resource_extns.address_id%type default fnd_api.g_miss_num, p_object_version_num in out jtf_rs_resource_extns.object_version_number%type, p_user_name in varchar2 default fnd_api.g_miss_char, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_source_mobile_phone in jtf_rs_resource_extns.source_mobile_phone%type default null, p_source_pager in jtf_rs_resource_extns.source_pager%type default null);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 3–4 Update_Resource IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

Resource Manager Public APIs 3-13

Page 158: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_resource_id jtf_rs_resource_extns. resource_id %type

Yes This value is created through an internal call in the Create_Resource API.

The reference identifier is validated for existence in JTF_RS_RESOURCE_EXTNS.

p_resource_number jtf_rs_resource_extns.resource_number%type

Yes This value is created through an internal call in the Create_Resource API.

The reference number is validated for existence in JTF_RS_RESOURCE_EXTNS.

p_managing_emp_id jtf_rs_resource_extns.managing_employee_id%type

No Identifier for the manager of the resource.

p_managing_emp_num

per_employees_current_x.employee_num%type

No Employee number of the resource’s manager.

p_start_date_active jtf_rs_resource_extns.start_date_active%type

Yes Date on which the resource becomes active. This value can not be NULL, and the start date must be less than the end date.

p_end_date_active jtf_rs_resource_extns.end_date_active%type

No Date on which the resource is no longer active. If no end date is provided, the resource is active indefinitely.

p_time_zone jtf_rs_resource_extns. time_zone %type No Time zone, this value must be a valid time zone as defined in table HZ_TIMEZONES.

p_cost_per_hr jtf_rs_resource_extns. cost_per_hr %type

No The salary cost per hour for this resource.

p_primary_language jtf_rs_resource_extns. primary_language %type

No The resource’s primary language. This value must be a valid NLS language as defined in table FND_LANGUAGES.

p_secondary_language jtf_rs_resource_extns. secondary_language %type

No The resource’s secondary language. This value must be a valid NLS language as defined in table FND_LANGUAGES.

Table 3–4 Update_Resource IN Parameters

Parameter Data Type Required Descriptions and Validations

3-14 Oracle CRM Application Foundation API Reference Guide

Page 159: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_support_site_id jtf_rs_resource_extns.support_site_id%type

No Value used by Service applications.

p_ies_agent_login jtf_rs_resource_extns.ies_agent_login%type

No Value used by Interaction Center applications (if using Oracle Scripting).

p_server_group_id jtf_rs_resource_extns.server_group_id%type

No Value used by Interaction Center applications.

p_assigned_to_group_id

jtf_rs_resource_extns.assigned_to_group_id%type

No The group to which this resource is assigned.

p_cost_center jtf_rs_resource_extns.cost_centere%type No The cost center to which this resource is assigned.

p_charge_to_cost_center

jtf_rs_resource_extns.charge_to_cost_center%type

No Cost center to charge against, this may be different than the resources current cost center.

p_comp_currency_code

jtf_rs_resource_extns.compensation_currency_code

No Compensation currency type, this value must be a valid currency code as listed in view FND_CURRENCIES_ACTIVE_MONET_V (from table FND_CURRENCIES).

p_commisionable_flag jtf_rs_resource_extns.commisionable_flag%type

No Boolean value:

■ Yes - This resource is eligible for a commission.

■ No - This resource is not eligible for a commission.

The default is Yes.

p_hold_reason_code jtf_rs_resource_extns.hold_reason_code%type

No The reason that compensation is being withheld. This value must be one of the lookup codes for JTF_RS_HOLD_REASON_TYPE in table FND_LOOKUPS.

Table 3–4 Update_Resource IN Parameters

Parameter Data Type Required Descriptions and Validations

Resource Manager Public APIs 3-15

Page 160: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_hold_payment jtf_rs_resource_extns.hold_payment%type

No Boolean value:

■ Yes - Withhold compensation.

■ No - Do not withhold compensation.

The default is No.

p_comp_service_team_id

jtf_rs_resource_extns.comp_service_team_id%type

No The identifier for the team to which this resource belongs.

p_user_id jtf_rs_resource_extns.user_id%type No Specify this value only if the following categories are used:

■ EMPLOYEE

■ PARTY

■ 'SUPPLIER_CONTACT'

If a category other than these three is specified, the API exits with an unexpected error condition.

This value is validated against table FND_USERS.

p_resource_name jtf_rs_resource_extns_tl.resource_name%type

No The calling application must pass the resource name. This value can not be NULL.

p_source_name jtf_rs_resource_extns.source_name%type

Yes The calling application must pass the resource name. This value can not be NULL.

See Resource Information versus Source Information.

p_source_number jtf_rs_resource_extns.source_number%type

No See Resource Information versus Source Information.

p_source_job_title jtf_rs_resource_extns.source_job_title%type

No See Resource Information versus Source Information.

p_source_email jtf_rs_resource_extns.source_email%type

No See Resource Information versus Source Information.

p_source_phone jtf_rs_resource_extns.source_phone%type

No See Resource Information versus Source Information.

Table 3–4 Update_Resource IN Parameters

Parameter Data Type Required Descriptions and Validations

3-16 Oracle CRM Application Foundation API Reference Guide

Page 161: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

p_source_org_id jtf_rs_resource_extns.source_org_id%type

No See Resource Information versus Source Information.

p_source_org_name jtf_rs_resource_extns.source_org_name%type

No See Resource Information versus Source Information.

p_source_address1 jtf_rs_resource_extns.source_address1%type

No See Resource Information versus Source Information.

p_source_address2 jtf_rs_resource_extns.source_address2%type

No See Resource Information versus Source Information.

p_source_address3 jtf_rs_resource_extns.source_address3%type

No See Resource Information versus Source Information.

p_source_address4 jtf_rs_resource_extns.source_address4%type

No See Resource Information versus Source Information.

p_source_city jtf_rs_resource_extns.source_city%type No See Resource Information versus Source Information.

p_source_postal_code jtf_rs_resource_extns.source_postal_code%type

No See Resource Information versus Source Information.

p_source_state jtf_rs_resource_extns.source_state%type No See Resource Information versus Source Information.

p_source_province jtf_rs_resource_extns.source_province%type

No See Resource Information versus Source Information.

p_source_county jtf_rs_resource_extns.source_county%type

No See Resource Information versus Source Information.

p_source_country jtf_rs_resource_extns.source_country%type

No See Resource Information versus Source Information.

p_source_mgr_id jtf_rs_resource_extns.source_mgr_id%type

No See Resource Information versus Source Information.

p_source_mgr_name jtf_rs_resource_extns.source_mgr_name%type

No See Resource Information versus Source Information.

p_source_business_grp_id

jtf_rs_resource_extns.source_business_grp_id%type

No See Resource Information versus Source Information.

p_source_business_grp_name

jtf_rs_resource_extns.source_business_grp_name%type

No See Resource Information versus Source Information.

p_source_first_name jtf_rs_resource_extns.source_first_name%type

No See Resource Information versus Source Information.

Table 3–4 Update_Resource IN Parameters

Parameter Data Type Required Descriptions and Validations

Resource Manager Public APIs 3-17

Page 162: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_RESOURCE_PUB

The following table describes the OUT parameters associated with this API.

p_source_last_name jtf_rs_resource_extns.source_last_name%type

No See Resource Information versus Source Information.

p_source_middle_name

jtf_rs_resource_extns.source_middle_name%type

No See Resource Information versus Source Information.

p_source_category jtf_rs_resource_extns.source_category%type

No See Resource Information versus Source Information.

p_source_status jtf_rs_resource_extns.source_status%type

No See Resource Information versus Source Information.

p_source_office jtf_rs_resource_extns.source_office%type

No See Resource Information versus Source Information.

p_source_location jtf_rs_resource_extns.source_location%type

No See Resource Information versus Source Information.

p_source_mailstop jtf_rs_resource_extns.source_mailstop%type

No See Resource Information versus Source Information.

p_address_id jtf_rs_resource_extns.address_id%type No See Resource Information versus Source Information.

p_object_version_num jtf_rs_resource_extns.object_version_number%type,

Yes The object version number of the resource ID derives from the jtf_rs_resource_extns table.

p_user_name VARCHAR2 Yes The name of the person entering values into the source.

p_source_mobile_phone

jtf_rs_resource_extns.source_mobile_phone%type

No See Resource Information versus Source Information.

p_source_pager jtf_rs_resource_extns.source_pager%type

No See Resource Information versus Source Information.

Table 3–5 Update_Resource OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 3–4 Update_Resource IN Parameters

Parameter Data Type Required Descriptions and Validations

3-18 Oracle CRM Application Foundation API Reference Guide

Page 163: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_GROUPS_PUB

3.3 Package JTF_RS_GROUPS_PUB This package contains the following APIs:

■ Create_Resource_Group

■ Update_Resource_Group

3.3.1 Create_Resource_Group The Create_Resource Group API creates a Resource Group and generates the group_id number.

Procedure Specification PROCEDURE create_resource_group( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_group_name in jtf_rs_groups_vl.group_name%type, p_group_desc in jtf_rs_groups_vl.group_desc%type default null, p_exclusive_flag in jtf_rs_groups_vl.exclusive_flag%type default 'n', p_email_address in jtf_rs_groups_vl.email_address%type default null, p_start_date_active in jtf_rs_groups_vl.start_date_active%type, p_end_date_active in jtf_rs_groups_vl.end_date_active%type default null, p_accounting_code in jtf_rs_groups_vl.accounting_code%type default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, x_group_id out jtf_rs_groups_vl.group_id%type, x_group_number out jtf_rs_groups_vl.group_number%type);

Current Version1.0

Resource Manager Public APIs 3-19

Page 164: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_GROUPS_PUB

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 3–6 Create_Resource_Group IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_group_name jtf_rs_groups_vl.group_name%type Yes The name of the resource group.

p_group_desc jtf_rs_groups_vl.group_desc%type No A description of the resource group.

p_exclusive_flag jtf_rs_groups_vl. exclusive_flag%type No Boolean value:

■ Yes - Assign resources only to this group with a particular member role and group usage that is not assigned to any other exclusive group with the same role and usage in the same time frame.

■ No - Disable this feature.

If p_exclusive_flag is set to yes, then you can assign resources only to this group with a particular member role and group usage that is not assigned to any other exclusive group with the same role and usage in the same time frame.

Because you specify the resource in this group exclusively, the same resource with the same member roles cannot be assigned to another group during the overlapping time frame.

3-20 Oracle CRM Application Foundation API Reference Guide

Page 165: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_GROUPS_PUB

The following table describes the OUT parameters associated with this API.

3.3.2 Update_Resource_Group The Update_Resource API updates resource group attributes such as Group Name, Group Description, Start and End Date effectively.

Procedure Specification PROCEDURE update_resource_group(

p_email_address jtf_rs_groups_vl. email_address%type No The email address of the group owner.

p_start_date_active jtf_rs_groups_vl.start_date_active%type Yes Date on which the resource group becomes active. This value can not be NULL, and the start date must be less than the end date.

p_end_date_active jtf_rs_groups_vl. end_date_active%type No Date on which the resource group is no longer active. If no end date is provided, the group is active indefinitely.

p_accounting_code jtf_rs_groups_vl. accounting_code%type

No Account code, for internal use only.

Table 3–7 Create_Resource OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_group_id jtf_rs_groups_vl.group_id%type, The automatically generated group identifier that is created through an internal call to JTF_RS_GROUPS_S.

x_group_number jtf_rs_groups_vl.group_number%type

The automatically generated group number that is created through an internal call to JTF_RS_GROUP_NUMBER_S.

Table 3–6 Create_Resource_Group IN Parameters

Parameter Data Type Required Descriptions and Validations

Resource Manager Public APIs 3-21

Page 166: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_GROUPS_PUB

p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_group_id in jtf_rs_groups_vl.group_id%type, p_group_number in jtf_rs_groups_vl.group_number%type, p_group_name in jtf_rs_groups_vl.group_name%type default fnd_api.g_miss_char, p_group_desc in jtf_rs_groups_vl.group_desc%type default fnd_api.g_miss_char, p_exclusive_flag in jtf_rs_groups_vl.exclusive_flag%type default fnd_api.g_miss_char, p_email_address in jtf_rs_groups_vl.email_address%type default fnd_api.g_miss_char, p_start_date_active in jtf_rs_groups_vl.start_date_active%type default fnd_api.g_miss_date, p_end_date_active in jtf_rs_groups_vl.end_date_active%type default fnd_api.g_miss_date, p_accounting_code in jtf_rs_groups_vl.accounting_code%type default fnd_api.g_miss_char, p_object_version_num in out jtf_rs_groups_vl.object_version_number%type, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 3–8 Update_Resource_Group IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_group_id jtf_rs_groups_vl. group_id%type Yes The value is created through an internal call in the Create_Resource API.

This parameter is validated for existence in table JTF_RS_GROUPS_B.

p_group_number jtf_rs_groups. group_id%type No The value is created through an internal call in the Create_Resource API.

3-22 Oracle CRM Application Foundation API Reference Guide

Page 167: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_GROUPS_PUB

p_group_name jtf_rs_groups_vl. group_name%type Yes The name of the resource group.

p_group_desc jtf_rs_groups_vl. group_desc%type No A description of the resource group.

p_exclusive_flag jtf_rs_groups_vl. exclusive_flag%type No Boolean value:

■ Yes - Assign resources only to this group with a particular member role and group usage that is not assigned to any other exclusive group with the same role and usage in the same time frame.

■ No - Disable this feature.

If p_exclusive_flag is set to yes, then you can assign resources only to this group with a particular member role and group usage that is not assigned to any other exclusive group with the same role and usage in the same time frame.

Because you specify the resource in this group exclusively, the same resource with the same member roles cannot be assigned to another group during the overlapping time frame.

The default is No.

p_email_address jtf_rs_groups_vl. email_address%type No The email address of the group owner.

p_start_date_active jtf_rs_groups_vl. start_date_active%type

Yes Date on which the resource group becomes active. This value can not be NULL, and the start date must be less than the end date.

Table 3–8 Update_Resource_Group IN Parameters

Parameter Data Type Required Descriptions and Validations

Resource Manager Public APIs 3-23

Page 168: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

The following table describes the OUT parameters associated with this API.

3.4 Package JTF_RS_SALESREPS_PUBThis package contains the following APIs:

■ Create_SalesRep

■ Update_SalesRep

3.4.1 Create_SalesRep The Create_SalesRep API create a resource of type Salesrep. The API verifies the resource ID parameter from the JTF_RS_RESOURC_.EXTNS table which is created using theCreate_Resource API.

Procedure Specification PROCEDURE create_salesrep(

p_end_date_active jtf_rs_groups_vl. end_date_active%type No Date on which the resource group is no longer active. If no end date is provided, the resource is active indefinitely.

p_accounting_code jtf_rs_groups_vl. accounting_code%type

No Account Code, for internal use only.

p_object_version_num jtf_rs_groups_vl.object_version_number%type

Yes The object version number of the group ID derives from the jtf_rs_groups_extns table.

Table 3–9 Update_Resource_Group OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 3–8 Update_Resource_Group IN Parameters

Parameter Data Type Required Descriptions and Validations

3-24 Oracle CRM Application Foundation API Reference Guide

Page 169: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_resource_id in jtf_rs_salesreps.resource_id%type, p_sales_credit_type_id in jtf_rs_salesreps.sales_credit_type_id%type, p_name in jtf_rs_salesreps.name%type default null, p_status in jtf_rs_salesreps.status%type default null, p_start_date_active in jtf_rs_salesreps.start_date_active%type default null, p_end_date_active in jtf_rs_salesreps.end_date_active%type default sysdate, p_gl_id_rev in jtf_rs_salesreps.gl_id_rev%type default null, p_gl_id_freight in jtf_rs_salesreps.gl_id_freight%type default null, p_gl_id_rec in jtf_rs_salesreps.gl_id_rec%type default null, p_set_of_books_id in jtf_rs_salesreps.set_of_books_id%type default null, p_salesrep_number in jtf_rs_salesreps.salesrep_number%type default null, p_email_address in jtf_rs_salesreps.email_address%type default null, p_wh_update_date in jtf_rs_salesreps.wh_update_date%type default null, p_sales_tax_geocode in jtf_rs_salesreps.sales_tax_geocode%type default null, p_sales_tax_inside_city_limits in jtf_rs_salesreps.sales_tax_inside_city_limits%type default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, x_salesrep_id out jtf_rs_salesreps.salesrep_id%type);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 3–10 Create_SalesRep IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

Resource Manager Public APIs 3-25

Page 170: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

p_resource_id jtf_rs_salesreps. resource_id%type Yes This value is created through an internal call in the Create_Resource API.

The reference identifier is validated for existence in JTF_RS_RESOURCE_EXTNS.

p_sales_credit_type_id jtf_rs_salesreps. sales_credit_type_id%type

Yes This value is validated against table OE_SALES_CREDIT_TYPES.

p_name jtf_rs_salesreps.name%type No The sales person’s name.

p_status jtf_rs_salesreps. status%type No The status of this salesperson. For example, this could be set to Active.

p_start_date_active jtf_rs_salesreps. start_date_active%type No Date on which the salesperson becomes active. This value can not be NULL, and the start date must be less than the end date.

p_end_date_active jtf_rs_salesreps. end_date_active%type No The effective end date for the salespersons. If no end date is provided, the salesperson is active indefinitely.

p_gl_id_rev jtf_rs_salesreps.gl_id_rev%type No Accounting flexfield used for Revenue accounts.

This value is used by Oracle Accounts Receivables only to determine the revenue accounts for invoices assigned to this salesperson.

p_gl_id_freight jtf_rs_salesreps.gl_id_frieght%type No Accounting flexfield used for Freight accounts.

This value is used by Oracle Accounts Receivables only to determine the freight accounts for invoices assigned to this salesperson.

Table 3–10 Create_SalesRep IN Parameters

Parameter Data Type Required Descriptions and Validations

3-26 Oracle CRM Application Foundation API Reference Guide

Page 171: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

p_gl_id_rec jtf_rs_salesreps.gl_id_rec%type No Accounting flexfield used for Receivables accounts.

This value is used by Oracle Accounts Receivables only to determine the receivable accounts for invoices assigned to this salesperson.

p_set_of_books_id jtf_rs_salesreps.set_of_books_id%type No Set of books identifier, used by Oracle Accounts Receivables.

p_salesrep_number jtf_rs_salesreps.salesrep_number%type No This typical alphanumeric designation is user generated.

p_email_address jtf_rs_salesreps.email_address%type No Email address of the salesperson.

p_wh_update_date jtf_rs_salesreps.wh_update_date%type No This date is sent to the data warehouse.

This parameter is used for backwards compatibility with Oracle Accounts Receivables and is written to table RA_SALESREPS_ALL.

p_sales_tax_geocode jtf_rs_salesreps.sales_tax_geocode%type

No Sales tax code, it associates the salesperson with a unique tax jurisdiction.

Use only if a sales tax vendor is also installed.

p_sales_tax_inside_city_limits

jtf_rs_salesreps.sales_tax_inside_city_limits%type

No Indicates that the tax jurisdiction for this address is within city limits.

Use only if a value for p_sales_tax_geocode is supplied.

Table 3–10 Create_SalesRep IN Parameters

Parameter Data Type Required Descriptions and Validations

Resource Manager Public APIs 3-27

Page 172: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

The following table describes the OUT parameters associated with this API.

3.4.2 Update_SalesRep The Update_SalesRep API updates SalesRep attributes such as Salesperson Number, Sales Credit Type, Start and End Date.

Procedure Specification PROCEDURE update_salesrep( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_ false, p_commit in varchar2 default fnd_api.g_false, p_salesrep_id in jtf_rs_salesreps.salesrep_id%type, p_sales_credit_type_id in jtf_rs_salesreps.sales_credit_type_id%type, p_name in jtf_rs_salesreps.name%type default fnd_api.g_miss_char, p_status in jtf_rs_salesreps.status%type default fnd_api.g_miss_char, p_start_date_active in jtf_rs_salesreps.start_date_active%typ default fnd_api.g_miss_date, p_end_date_active in jtf_rs_salesreps.end_date_active%type default fnd_api.g_miss_date, p_gl_id_rev in jtf_rs_salesreps.gl_id_rev%type default fnd_api.g_miss_num, p_gl_id_freight in jtf_rs_salesreps.gl_id_freight%type default fnd_api.g_miss_num, p_gl_id_rec in jtf_rs_salesreps.gl_id_rec%type default fnd_api.g_miss_num, p_set_of_books_id in jtf_rs_salesreps.set_of_books_id%type default fnd_api.g_miss_num, p_salesrep_number in jtf_rs_salesreps.salesrep_number%type default fnd_api.g_miss_char, p_email_address in jtf_rs_salesreps.email_address%type default fnd_api.g_miss_char, p_wh_update_date in jtf_rs_salesreps.wh_update_date%type default fnd_api.g_miss_date, p_sales_tax_geocode in jtf_rs_salesreps.sales_tax_geocode%type default fnd_api.g_miss_char, p_sales_tax_inside_city_limits in jtf_rs_salesreps.sales_tax_inside_city_limits%type default fnd_api.g_miss_char, p_org_id in jtf_rs_salesreps.org_id%type, p_object_version_number in out jtf_rs_salesreps.object_version_number%type, x_return_status out varchar2,

Table 3–11 Create_SalesRep OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_salesrep_id jtf_rs_salesrep.salesrep_id%type The automatically generated salesperson identifier that is created through an internal call to JTF_RS_SALESREPS_S.

3-28 Oracle CRM Application Foundation API Reference Guide

Page 173: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

x_msg_count out number, x_msg_data out varchar2);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 3–12 Update_SalesRep IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_salesrep_id jtf_rs_salesreps. salesrep_id%type Yes This value is created through an internal call in the Create_SalesRep API.

If a valid value is not supplied, the API exits with an unexpected error condition.

p_sales_credit_type_id jtf_rs_salesreps.sales_credit_type_id%type

Yes This value is validated against table OE_SALES_CREDIT_TYPES.

p_name jtf_rs_salesreps.name%type No The sales person’s name.

p_status jtf_rs_salesreps.status%type No The status of this salesperson. For example, this could be set to Active.

p_start_date_active jtf_rs_slaesreps.start_date_active%type No Date on which the salesperson becomes active. This value can not be NULL, and the start date must be less than the end date.

Resource Manager Public APIs 3-29

Page 174: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_RS_SALESREPS_PUB

p_end_date_active jtf_rs_salesreps. end_date_active%type No The effective end date for the salesperson. If no end date is provided, the salesperson is active indefinitely.

p_gl_id_rev jtf_rs_salesreps.gl_id_freight%type No Accounting flexfield used for Revenue accounts.

This value is used by Oracle Accounts Receivables only to determine the revenue accounts for invoices assigned to this salesperson.

p_gl_id_freight jtf_rs_salesreps.gl_id_freight%type No Accounting flexfield used for Freight accounts.

This value is used by Oracle Accounts Receivables only to determine the freight accounts for invoices assigned to this salesperson.

p_gl_id_rec jtf_rs_salesreps.gl_id_rec%type No Accounting flexfield used for Receivables accounts.

This value is used by Oracle Accounts Receivables only to determine the receivable accounts for invoices assigned to this salesperson.

p_set_of_books_id jtf_rs_salesreps.set_of_books_id%type No Parameter used by Oracle Accounts Receivables.

p_salesrep_number jtf_rs_salesreps.salesrep_number%type No This typical alphanumeric designation is user generated.

p_email_address jtf_rs_salesreps.email_address%type No Email address of the salesperson.

p_wh_update_date jtf_rs_salesreps.wh_update_date%type No This date is sent to the data warehouse.

This parameter is used for backwards compatibility with Oracle Accounts Receivables and is written to table RS_SALESREPS_ALL.

Table 3–12 Update_SalesRep IN Parameters

Parameter Data Type Required Descriptions and Validations

3-30 Oracle CRM Application Foundation API Reference Guide

Page 175: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

The following table describes the OUT parameters associated with this API.

3.5 Messages and NotificationsThe APIs contained in the Resource Manager public packages generate messages and notifications as needed. These messages are detailed in the following sections.

■ JTF_RS_RESOURCE_PUB

■ JTF_RS_GROUPS_PUB

■ JTF_RS_SALESREPS_PUB

p_sales_tax_geocode jtf_rs_salesreps.sales_tax_geocode%type

No Sales tax code, it associates the salesperson with a unique tax jurisdiction.

Use only if a sales tax vendor is also installed.

p_sales_tax_inside_city_limits

jtf_rs_salesreps.sales_tax_inside_city_limits%type

No Indicates that the tax jurisdiction for this address is within city limits.

Use only if a value for p_sales_tax_geocode is supplied.

p_org_id jtf_rs_salesreps.org_id%type No Organization Identifier

p_object_version_number

jtf_rs_salesreps.object_version_number%type

No The object version number of the salesrep ID derives from the jtf_rs_salesreps_extns table.

Table 3–13 Update_SalesRep OUT Parameters

Parameter Data Type Descriptions and Validations

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 3–12 Update_SalesRep IN Parameters

Parameter Data Type Required Descriptions and Validations

Resource Manager Public APIs 3-31

Page 176: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

3.5.1 JTF_RS_RESOURCE_PUBThis section describes the messages and notifications generated by the APIs contained in the JTF_RS_RESOURCE_PUB package.

3.5.1.1 Create_ResourceThe following table lists the messages and notifications generated by the Create_Resource API.

Note: It is not required that all status notifications provide a number identifier along with the message, although, in many cases, it is provided.

Table 3–14 Create_Resource Messages

Number Type Name Text

210209 E JTF_RS_INVALID_EMP_RESOURCE_ID

Employee Resource ID &P_EMP_RESOURCE_ID is not Valid or the Resource is Inactive.

210211 E JTF_RS_RESOURCE_CATEGORY_NULL

Resource Category should not be NULL.

210212 E JTF_RS_INVALID_RES_CATEGORY Resource Category &P_RESOURCE_CATEGORY is not Valid.

210213 E JTF_RS_TIME_ZONE_NULL Time Zone is Null.

210214 E JTF_RS_INVALID_TIME_ZONE Time Zone ID &P_TIME_ZONE_ID is not Valid.

210215 E JTF_RS_LANGUAGE_NULL Language is Null.

210216 E JTF_RS_INVALID_LANGUAGE NLS Language &P_LANGUAGE is not Valid.

210224 U JTF_RS_SOURCE_ID_NULL Source Identifier should not be NULL.

210328 U JTF_RS_USERID_ERROR For the specified Category, User ID should be NULL.

210229 U JTF_RS_EMP_IDS_NOT_NULL For Resource Category EMPLOYEE address_id and contact_id should be NULL.

210230 U JTF_RS_ERR_ASSIGN_TO_GRP_ID Assigned To Group ID, p_assigned_to_group_id is not Valid.

210231 U JTF_RS_INVALID_FLAG_VALUE Flag value should either be "Y" or "N."

210235 E JTF_RS_SUPPORT_SITE_NULL Support Site should Not be Null.

3-32 Oracle CRM Application Foundation API Reference Guide

Page 177: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

210236 E JTF_RS_INVALID_SUPPORT_SITE Support Site &P_SUPPORT_SITE is Not Valid.

210237 E JTF_RS_INVALID_SRV_GROUP_ID Server Group ID &P_SERVER_GROUP_ID is Not Valid.

210238 E JTF_RS_INVALID_SVR_GROUP_NAME

Interaction Center Name &P_SERVER_GROUP_NAME is Not Valid.

210239 E JTF_RS_CURRENCY_NULL Currency Code should Not be Null.

210240 E JTF_RS_INVALID_CURRENCY Currency Code &P_CURRENCY is Not Valid.

210241 E JTF_RS_HOLD_REASON_CODE_NULL

Hold Reason Code should Not be Null.

210242 E JTF_RS_INVALID_HOLD_REASON_COD

Hold Reason Code &P_HOLD_REASON_CODE is Not Valid.

210243 E JTF_RS_TEAM_NULL Team ID and Team Number are Null.

210244 E JTF_RS_INVALID_TEAM Team ID &P_TEAM_ID is Not Valid.

210245 E JTF_RS_INVALID_TEAM_NUMBER Team Number &P_TEAM_NUMBER is Not Valid.

210259 E JTF_RS_USER_ID_NULL User ID cannot be Null.

210260 E JTF_RS_INVALID_USER_ID User ID &P_USER_ID is Not Valid.

210340 U JTF_RS_INVALID_RL_RES_TYPE Role Resource Type does not exist in JTF Objects.

210346 U JTF_RS_INVALID_OBJ_USER_CODE Invalid Object User code.

210393 U JTF_RS_UNEXP_ERROR An unexpected error was encountered in &P_API_NAME.

210218 E JTF_RS_TABLE_HANDLER_ERROR Error in the Table Handler.

210265 E JTF_RS_ERR_POST_CUST_USR_HOOK

Returned Error status from the Post Customer User Hook.

210266 E JTF_RS_ERR_POST_VERT_USR_HOOK

Returned Error status from the Post Vertical User Hook.

210327 E JTF_RS_ERR_POST_INT_USR_HOOK Returned Error status from the Post Internal User Hook.

210267 E JTF_RS_ERR_MESG_GENERATE_API Returned Error status from the Message Generation API.

210393 E JTF_RS_UNEXP_ERROR Program Error: An unexpected error was encountered in &P_API_NAME.

Table 3–14 Create_Resource Messages

Number Type Name Text

Resource Manager Public APIs 3-33

Page 178: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

210207 U JTF_RS_RESOURCE_NULL Resource identifier and Resource Number are NULL.

210219 U JTF_RS_START_DATE_NULL Start Date Active cannot be NULL.

210220 U JTF_RS_OTHER_IDS_NOT_NULL For Resource Category OTHER/TBH the Source identifier, Address identifier, Contact identifier, and Managing Emp identifier should be NULL.

210221 U JTF_RS_PARTNER_IDS_NULL For Resource Category PARTNER the Source_id should not be NULL.

210222 U JTF_RS_INVALID_PARTNER_IDS Partner does not exist for the passed Source_id.

210223 U JTF_RS_ERR_PARTNER_CONTACT_ID

Partner contact id p_contact_id is not valid.

210225 U JTF_RS_INVALID_SOURCE_ID Source identifier p_source_id is not valid.

210226 U JTF_RS_INVALID_PARTY_ADDRESS Party Address identifier <Address_id> is Not Valid.

210227 U JTF_RS_ERR_PARTY_CONTACT_ID Party Contact identifier <Contact_id> is Not Valid.

210228 U JTF_RS_SC_IDS_NOT_NULL For Resource Category SUPPLIER_CONTACT Address_id and Contact_id should be NULL.

210374 U JTF_RS_ERR_DUPLICATE_USER_ID The user identifier <User_id> already exist.

380060 E JTF_RS_NOT_PRIMARY_ADDR The address ID passed in is not the primary address of the PARTY/PARTNER.

210383 U JTF_RS_ERR_PARTNER_ADDRESS_ID Partner address identifier p_address_id is not valid.

Table 3–14 Create_Resource Messages

Number Type Name Text

3-34 Oracle CRM Application Foundation API Reference Guide

Page 179: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

3.5.1.2 Update_ResourceThe following table lists the messages and notifications generated by the Update_Resource API.

Table 3–15 Update_Resource Messages

Number Type Name Text

210204 U JTF_RS_INVALID_RESOURCE Resource identifier <Resource_id> is not valid or is inactive.

210208 U JTF_RS_INVALID_RESOURCE_NUMBER

Resource Number <Resource_number> is not valid or the resource is inactive.

210209 E JTF_RS_INVALID_EMP_RESOURCE_ID

Employee Resource ID &P_EMP_RESOURCE_ID is not Valid or the Resource is Inactive.

210213 E JTF_RS_TIME_ZONE_NULL Time Zone is Null.

210214 E JTF_RS_INVALID_TIME_ZONE Time Zone ID &P_TIME_ZONE_ID is not Valid.

210215 E JTF_RS_LANGUAGE_NULL Language is Null.

210216 E JTF_RS_INVALID_LANGUAGE NLS Language &P_LANGUAGE is not Valid.

210218 U JTF_RS_TABLE_HANDLER_ERROR Error in the Table Handler.

210219 U JTF_RS_START_DATE_NULL Start Date Active cannot be NULL.

210327 E JTF_RS_ERR_POST_INT_USR_HOOK Returned Error status from the Post Internal User Hook.

210230 U JTF_RS_ERR_ASSIGN_TO_GRP_ID Assigned To Group identifier <Assigned_to_group_id> is not valid.

210231 U JTF_RS_INVALID_FLAG_VALUE Flag value should either be "Y" or "N."

210232 E JTF_RS_ERR_STDT_GREATER_EDDT Start Date Active cannot be greater than the End Date Active.

210236 E JTF_RS_INVALID_SUPPORT_SITE Support Site &P_SUPPORT_SITE is Not Valid.

210237 E JTF_RS_INVALID_SRV_GROUP_ID Server Group ID &P_SERVER_GROUP_ID is Not Valid.

210238 E JTF_RS_INVALID_SVR_GROUP_NAME

Interaction Center Name &P_SERVER_GROUP_NAME is Not Valid.

210239 E JTF_RS_CURRENCY_NULL Currency Code should Not be Null.

210240 E JTF_RS_INVALID_CURRENCY Currency Code &P_CURRENCY is Not Valid.

210241 E JTF_RS_HOLD_REASON_CODE_NULL

Hold Reason Code should Not be Null.

Resource Manager Public APIs 3-35

Page 180: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

210242 E JTF_RS_INVALID_HOLD_REASON_COD

Hold Reason Code &P_HOLD_REASON_CODE is Not Valid.

210243 E JTF_RS_TEAM_NULL Team ID and Team Number are Null.

210244 E JTF_RS_INVALID_TEAM Team ID &P_TEAM_ID is Not Valid.

210245 E JTF_RS_INVALID_TEAM_NUMBER Team Number &P_TEAM_NUMBER is Not Valid.

210254 E JTF_RS_ROW_LOCK_ERROR This record has been updated by another user. Please requery and try again.

210259 E JTF_RS_USER_ID_NULL User ID cannot be Null.

210260 E JTF_RS_INVALID_USER_ID User ID &P_USER_ID is Not Valid.

210265 E JTF_RS_ERR_POST_CUST_USR_HOOK

Returned Error status from the Post Customer User Hook.

210266 E JTF_RS_ERR_POST_VERT_USR_HOOK

Returned Error status from the Post Vertical User Hook.

210267 E JTF_RS_ERR_MESG_GENERATE_API Returned Error status from the Message Generation API.

210275 E JTF_RS_ERR_RES_ROLE_START_DATE

Resource Start Date out of range for the role related start dates of the Resource.

210276 E JTF_RS_ERR_RES_ROLE_END_DATE Resource End Date out of range for the role related End dates of the Resource.

210277 E JTF_RS_ERR_RES_GMBR_START_DATE

Resource Start Date out of range for the group member role related start dates for the Resource.

210278 E JTF_RS_ERR_RES_GMBR_END_DATE Resource End Date out of range for the group member role related end dates for the Resource.

210279 E JTF_RS_ERR_RES_TMBR_START_DATE

Resource Start Date out of range for the Team Member role related start dates for the Resource, where the Team Member is a Resource.

210280 E JTF_RS_ERR_RES_TMBR_END_DATE Resource End Date out of range for the Team Member role related end dates for the Resource, where the Team Member is a Resource.

210281 E JTF_RS_ERR_RES_SRP_START_DATE Resource Start Date out of range for the salesperson related start dates of the resource.

210282 E JTF_RS_ERR_RES_SRP_END_DATE Resource End Date out of range for the salesperson related End dates of the Resource.

Table 3–15 Update_Resource Messages

Number Type Name Text

3-36 Oracle CRM Application Foundation API Reference Guide

Page 181: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

3.5.2 JTF_RS_GROUPS_PUBThis section describes the messages and notifications generated by the APIs contained in the JTF_RS_GROUPS_PUB package.

3.5.2.1 Create_Resource_GroupThe following table lists the messages and notifications generated by the Create_Resource_Group API.

210328 U JTF_RS_USERID_ERROR For the specified Category, User identifier should be NULL.

210374 U JTF_RS_ERR_DUPLICATE_USER_ID The user identifier <User_id> already exist.

210393 U JTF_RS_UNEXP_ERROR An unexpected error was encountered in &P_API_NAME.

380001 E JTF_RS_XMLGEN_ERR Package JTF_USR_HKS is invalid.

380002 E JTF_RS_JUHK_ERR Package JTF_USR_HKS is invalid.

380060 E JTF_RS_NOT_PRIMARY_ADDR The address ID passed in is not the primary address of the PARTY/PARTNER.

Table 3–16 Create_Resource_Group Messages

Number Type Name Text

210201 U JTF_RS_GROUP_NAME_NULL Group Name cannot be NULL.

210218 U JTF_RS_TABLE_HANDLER_ERROR Error in the Table Handler.

210219 U JTF_RS_START_DATE_NULL Start Date Active cannot be NULL.

210232 E JTF_RS_ERR_STDT_GREATER_EDDT Start Date Active cannot be greater than the End Date Active.

210261 E JTF_RS_ERR_PRE_CUST_USR_HOOK Returned Error status from the Pre Customer User Hook.

210262 E JTF_RS_ERR_PRE_VERT_USR_HOOK Returned Error status from the Pre Vertical User Hook.

210265 E JTF_RS_ERR_POST_CUST_USR_HOOK

Returned Error status from the Post Customer User Hook.

Table 3–15 Update_Resource Messages

Number Type Name Text

Resource Manager Public APIs 3-37

Page 182: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

3.5.2.2 Update_Resource_GroupThe following table lists the messages and notifications generated by the Update_Resource_Group API.

210266 E JTF_RS_ERR_POST_VERT_USR_HOOK

Returned Error status from the Post Vertical User Hook.

210267 E JTF_RS_ERR_MESG_GENERATE_API Returned Error status from the Message Generation API.

210327 E JTF_RS_ERR_POST_INT_USR_HOOK Returned Error status from the Post Internal User Hook.

210371 E JTF_RS_ERR_PRE_INT_USR_HOOK Returned Error status from the Pre Internal User Hook.

Table 3–17 Update_Resource_Group Messages

Number Type Name Text

210201 U JTF_RS_GROUP_NAME_NULL Group Name cannot be NULL.

210246 E JTF_RS_ERR_ROLE_START_DATE Group Start Date Out of Range for the Related Roles Start dates for the Group.

210247 E JTF_RS_ERR_ROLE_END_DATE Group End Date Out of Range for the Related Roles End dates for the Group.

210248 E JTF_RS_ERR_GRP_MBR_START_DATE Group Start Date Out of Range for the Group Member Role Related Start Dates.

210249 E JTF_RS_ERR_GRP_MBR_END_DATE Group End Date Out of Range for the Group Member Role Related End Dates.

210250 E JTF_RS_ERR_GRP_REL_START_DATE Group Start Date Out of Range for the Group Relations Related Start Dates.

210251 E JTF_RS_ERR_GRP_REL_END_DATE Group End Date Out of Range for the Group Relations Related End Dates.

210252 E JTF_RS_ERR_TEAM_MBR_START_DATE

Group Start Date Out of Range for the Team Member Role Related Start Dates for the Group, where the Team Member is a Group.

210253 E JTF_RS_ERR_TEAM_MBR_END_DATE Group End Date Out of Range for the Team Member Role Related End Dates for the Group, where the Team Member is a Group.

Table 3–16 Create_Resource_Group Messages

Number Type Name Text

3-38 Oracle CRM Application Foundation API Reference Guide

Page 183: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

3.5.3 JTF_RS_SALESREPS_PUBThis section describes the messages and notifications generated by the APIs contained in the JTF_RS_SALESREPS_PUB package.

3.5.3.1 Create_SalesRepThe following table lists the messages and notifications generated by the Create_SalesRep API.

210254 E JTF_RS_ROW_LOCK_ERROR This record has been updated by another user. Please requery and try again.

210261 E JTF_RS_ERR_PRE_CUST_USR_HOOK Returned Error status from the Pre Customer User Hook.

210262 E JTF_RS_ERR_PRE_VERT_USR_HOOK Returned Error status from the Pre Vertical User Hook.

210264 E JTF_RS_EXCLUSIVE_GROUP Group usage cannot be created as one of the member dates overlap with another record for the same resource assigned to another exclusive group with the same usage in the same time period.

210266 E JTF_RS_ERR_POST_VERT_USR_HOOK

Returned Error status from the Post Vertical User Hook.

210268 E JTF_RS_INVALID_GROUP Usage &P_USAGE is not setup for the Group ID &P_GROUP_ID.

210371 E JTF_RS_ERR_PRE_INT_USR_HOOK Returned Error status from the Pre Internal User Hook.

Table 3–18 Create_SalesRep Messages

Number Type Name Text

210204 E JTF_RS_INVALID_RESOURCE Resource identifier <Resource_id> is not valid or is inactive.

210207 U JTF_RS_RESOURCE_NULL Resource identifier and Resource Number are NULL.

210208 E JTF_RS_INVALID_RESOURCE_NUMBER

Resource Number <Resource_number> is not valid or the resource is inactive.

Table 3–17 Update_Resource_Group Messages

Number Type Name Text

Resource Manager Public APIs 3-39

Page 184: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

210218 U JTF_RS_TABLE_HANDLER_ERROR Error in the Table Handler.

210219 E JTF_RS_START_DATE_NULL Start Date Active cannot be null.

210232 E JTF_RS_ERR_STDT_GREATER_EDDT Start Date Active cannot be greater than the End Date Active.

210261 E JTF_RS_ERR_PRE_CUST_USR_HOOK Returned Error status from the Pre Customer User Hook.

210262 E JTF_RS_ERR_PRE_VERT_USR_HOOK Returned Error status from the Pre Vertical User Hook.

210265 E JTF_RS_ERR_POST_CUST_USR_HOOK

Returned Error status from the Post Customer User Hook.

210266 E JTF_RS_ERR_POST_VERT_USR_HOOK

Returned Error status from the Post Vertical User Hook.

210267 E JTF_RS_ERR_MESG_GENERATE_API Returned Error status from the Message Generation API.

210283 E JTF_RS_ERR_SALESREP_NUMBER Salesperson Number &P_SALESREP_NUMBER already exists.

210284 E JTF_RS_SALESREP_NUMBER_NULL Salesperson Number cannot be Null.

210285 E JTF_RS_ERR_SALES_CREDIT_TYPE Sales Credit Type identifier <Sales_credit_type_id> is invalid.

210286 E JTF_RS_SALES_CREDIT_TYPE_NULL Sales Credit Type identifier cannot be NULL.

210327 E JTF_RS_ERR_POST_INT_USR_HOOK Returned Error status from the Post Internal User Hook.

210371 E JTF_RS_ERR_PRE_INT_USR_HOOK Returned Error status from the Pre Internal User Hook.

Table 3–18 Create_SalesRep Messages

Number Type Name Text

3-40 Oracle CRM Application Foundation API Reference Guide

Page 185: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

3.5.3.2 Update_SalesRepThe following table lists the messages and notifications generated by the Update_SalesRep API.

Table 3–19 Update_SalesRep Messages

Number Type Name Text

210218 E JTF_RS_TABLE_HANDLER_ERROR Error in the Table Handler.

210219 U JTF_RS_START_DATE_NULL Start Date Active cannot be NULL.

210232 E JTF_RS_ERR_STDT_GREATER_EDDT Start Date Active cannot be greater than the End Date Active.

210261 E JTF_RS_ERR_PRE_CUST_USR_HOOK Returned Error status from the Pre Customer User Hook.

210262 E JTF_RS_ERR_PRE_VERT_USR_HOOK Returned Error status from the Pre Vertical User Hook.

210265 E JTF_RS_ERR_POST_CUST_USR_HOOK

Returned Error status from the Post Customer User Hook.

210266 E JTF_RS_ERR_POST_VERT_USR_HOOK

Returned Error status from the Post Vertical User Hook.

210267 E JTF_RS_ERR_MESG_GENERATE_API Returned Error status from the Message Generation API.

210283 E JTF_RS_ERR_SALESREP_NUMBER Salesperson Number &P_SALESREP_NUMBER already exists.

210284 E JTF_RS_SALESREP_NUMBER_NULL Salesperson Number cannot be Null.

210285 E JTF_RS_ERR_SALES_CREDIT_TYPE Sales Credit Type identifier <Sales_credit_type_id> is invalid.

210286 E JTF_RS_SALES_CREDIT_TYPE_NULL Sales Credit Type identifier cannot be NULL.

210315 E JTF_RS_SALESREP_ID_NULL Salesperson identifier cannot be NULL.

210316 E JTF_RS_INVALID_SALESREP_ID Salesperson identifier <Salesrep_id> is invalid.

210327 E JTF_RS_ERR_POST_INT_USR_HOOK Returned Error status from the Post Internal User Hook.

210371 E JTF_RS_ERR_PRE_INT_USR_HOOK Returned Error status from the Pre Internal User Hook.

Resource Manager Public APIs 3-41

Page 186: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

3.6 Sample CodeThis section contains SQL scripts that call the Resource Manager public APIs stored in the following packages and insert values as required:

■ JTF_RS_RESOURCE_PUB

■ JTF_RS_GROUPS_PUB

■ JTF_RS_SALESREPS_PUB

3.6.1 JTF_RS_RESOURCE_PUBThe SQL scripts in this section create and update a resource by calling the APIs contained in the JTF_RS_RESOURCE_PUB package in succession and by providing them with the appropriate values.

3.6.1.1 Create_ResourceThis script calls the Create_Resource API and provides the values listed in the following table using the Create_Resource IN parameters. Calling applications can optionally insert more values than the ones listed in this section.

Table 3–20 Create_Resource API Sample Code Variables

Variable Description

l_api_version Version is 1.0.

l_category Category is Employee.

l_source_id Source ID is equal to 10001.

l_resource_name Resource name is Rachel Abbott.

l_managing_emp_id Her employee ID number is 1100.

l_user_id User ID is 2294.

l_time_zone Time zone is 92.

l_cost_per_hr Her rate is $25.00 per hour.

l_primary_language The primary language is American English.

l_secondary_language The secondary language is Candian French.

l_support_site_id The support site ID number is 22917.

l_ies_agent_login The agent login is "guest".

3-42 Oracle CRM Application Foundation API Reference Guide

Page 187: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

SET SERVEROUTPUT ON

declare

l_api_version number := 1.0;l_category jtf_rs_resource_extns.category%type := 'EMPLOYEE';l_source_id jtf_rs_resource_extns.source_id%type := 10001;l_resource_name jtf_rs_resource_extns_tl.resource_name%type := 'Rachel Abbott';l_managing_emp_id jtf_rs_resource_extns.managing_employee_id%type := 1100;l_user_id jtf_rs_resource_extns.user_id%type := 2294;l_time_zone jtf_rs_resource_extns.time_zone%type := 92;l_cost_per_hr jtf_rs_resource_extns.cost_per_hr%type := 25;l_primary_language jtf_rs_resource_extns.primary_language%type := 'AMERICAN';l_secondary_language jtf_rs_resource_extns.secondary_language%type := 'CANADIAN FRENCH'; l_support_site_id jtf_rs_resource_extns.support_site_id%type := 22917;l_ies_agent_login jtf_rs_resource_extns.ies_agent_login%type := 'guest';l_server_group_id jtf_rs_resource_extns.server_group_id%type := 112;

l_server_group_id The server group ID number is 112.

l_interaction_center_name The interaction center name for the group is "CCTAGENT01'.

l_assigned_to_group_id The assigned group ID number is 1548.

l_cost_center The cost center number is OA55.

l_charge_to_cost_center The charge to the cost center is 250.

l_comp_currency_code The currency code is AUD.

l_commissionable_flag The flag is set to "Y".

l_hold_reason_code The hold reason code is HRC-1.

l_hold_payment The hold payment flag is set to "N".

l_comp_service_team_id The comp service team ID is 10072.

l_source_name The source name is Abbott, Ms. Rachel (Rachel).

l_source_number The source number is 159.

l_source_job_title The source title is SAL600.Sales Representative.

l_source_email Her email address is [email protected].

l_source_phone Her phone number is 650-555-1212.

Table 3–20 Create_Resource API Sample Code Variables

Variable Description

Resource Manager Public APIs 3-43

Page 188: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_interaction_center_name ieo_svr_groups.group_name%type := 'CCTAGENT01';l_assigned_to_group_id jtf_rs_resource_extns.assigned_to_group_id%type := 1548;l_cost_center jtf_rs_resource_extns.cost_center%type := '0A55';l_charge_to_cost_center jtf_rs_resource_extns.charge_to_cost_center%type := '250';l_comp_currency_code jtf_rs_resource_extns.compensation_currency_code%type := 'AUD';l_commissionable_flag jtf_rs_resource_extns.commissionable_flag%type := 'Y';l_hold_reason_code jtf_rs_resource_extns.hold_reason_code%type := 'HRC-1';l_hold_payment jtf_rs_resource_extns.hold_payment%type := 'N';l_comp_service_team_id jtf_rs_resource_extns.comp_service_team_id%type := 10072;l_source_name jtf_rs_resource_extns.source_name%type := 'Abbott, Ms. Rachel (Rachel)';l_source_number jtf_rs_resource_extns.source_number%type := 159;l_source_job_title jtf_rs_resource_extns.source_job_title%type := 'SAL600.Sales Representative';l_source_email jtf_rs_resource_extns.source_email%type := '[email protected]';l_source_phone jtf_rs_resource_extns.source_phone%type := '650-555-1212';

l_return_status varchar2(1);l_msg_count number;l_msg_data varchar2(2000);l_resource_id jtf_rs_resource_extns.resource_id%type;l_resource_number jtf_rs_resource_extns.resource_number%type;

l_msg_data1 varchar2(2000);l_msg_index_out number;

begin

jtf_rs_resource_pub.create_resource (P_API_VERSION => l_api_version, P_CATEGORY => l_category, P_START_DATE_ACTIVE => sysdate, P_END_DATE_ACTIVE => null, P_SOURCE_ID => l_source_id, P_RESOURCE_NAME => l_resource_name, P_MANAGING_EMP_ID => l_managing_emp_id, P_USER_ID => l_user_id, P_TIME_ZONE => l_time_zone, P_COST_PER_HR => l_cost_per_hr, P_PRIMARY_LANGUAGE => l_primary_language, P_SECONDARY_LANGUAGE => l_secondary_language, P_SUPPORT_SITE_ID => l_support_site_id, P_IES_AGENT_LOGIN => l_ies_agent_login, P_SERVER_GROUP_ID => l_server_group_id, P_INTERACTION_CENTER_NAME => l_interaction_center_name, P_ASSIGNED_TO_GROUP_ID => l_assigned_to_group_id, P_COST_CENTER => l_cost_center, P_CHARGE_TO_COST_CENTER => l_charge_to_cost_center, P_COMP_CURRENCY_CODE => l_comp_currency_code, P_COMMISSIONABLE_FLAG => l_commissionable_flag,

3-44 Oracle CRM Application Foundation API Reference Guide

Page 189: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

P_HOLD_REASON_CODE => l_hold_reason_code, P_HOLD_PAYMENT => l_hold_payment, P_COMP_SERVICE_TEAM_ID => l_comp_service_team_id, P_SOURCE_NAME => l_source_name, P_SOURCE_NUMBER => l_source_number, P_SOURCE_JOB_TITLE => l_source_job_title, P_SOURCE_EMAIL => l_source_email, P_SOURCE_PHONE => l_source_phone, X_RETURN_STATUS => l_return_status, X_MSG_COUNT => l_msg_count, X_MSG_DATA => l_msg_data, X_RESOURCE_ID => l_resource_id, X_RESOURCE_NUMBER => l_resource_number ); if (l_return_status <> 'S') then if (fnd_msg_pub.count_msg > 0) then for i in 1..fnd_msg_pub.count_msg loop fnd_msg_pub.get (p_msg_index => i, p_data => l_msg_data, p_encoded => 'F', p_msg_index_out => l_msg_index_out ); l_msg_data1 := l_msg_data1 ||' '|| l_msg_data; end loop; fnd_message.set_encoded(l_msg_data1); dbms_output.put_line(l_msg_data1); end if; else dbms_output.put_line ('Return Status - ' || l_return_status); dbms_output.put_line ('Resource ID - ' || l_resource_id); dbms_output.put_line ('Resource Number - '|| l_resource_number); end if;

end;/

3.6.1.2 Update_ResourceThis script calls the Update_Resource API and provides the values listed in the following table using the Update_Resource IN parameters. Calling applications can optionally insert more values than the ones listed in this section.

Table 3–21 Update_Resource API Sample Code Variables

Variable Description

l_api_version Version is 1.0.

Resource Manager Public APIs 3-45

Page 190: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

SET SERVEROUTPUT ON

1_resource_id The resource ID is 10000.

1_resource_number The resource number is 10005.

l_resource_name Resource name is Rachel Abbott.

l_managing_emp_id Her employee ID number is 1100.

l_user_id User ID is 2294.

l_time_zone Time zone is 92.

l_cost_per_hr Her rate is $25.00 per hour.

l_primary_language The primary language is American English.

l_secondary_language The secondary language is Candian French.

l_support_site_id The support site ID number is 22917.

l_ies_agent_login The agent login is "guest".

l_server_group_id The server group ID number is 112.

l_assigned_to_group_id The assigned group ID number is 1548.

l_cost_center The cost center number is OA55.

l_charge_to_cost_center The charge to the cost center is 250.

l_comp_currency_code The currency code is AUD.

l_commissionable_flag The flag is set to "Y".

l_hold_reason_code The hold reason code is HRC-1.

l_hold_payment The hold payment flag is set to "N".

l_comp_service_team_id The comp service team ID is 10072.

l_source_name The source name is Abbott, Ms. Rachel (Rachel).

l_source_number The source number is 159.

l_source_job_title The source title is SAL600.Sales Representative.

l_source_email Her email address is [email protected].

l_source_phone Her phone number is 650-555-1212.

Table 3–21 Update_Resource API Sample Code Variables

Variable Description

3-46 Oracle CRM Application Foundation API Reference Guide

Page 191: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

declare

l_api_version number := 1.0;l_resource_id jtf_rs_resource_extns.resource_id%type := 10000;l_resource_number jtf_rs_resource_extns.resource_number%type := '10005';l_resource_name jtf_rs_resource_extns_tl.resource_name%type := 'Rachel Abbott';l_managing_emp_id jtf_rs_resource_extns.managing_employee_id%type := 1100;l_user_id jtf_rs_resource_extns.user_id%type := 2294;l_time_zone jtf_rs_resource_extns.time_zone%type := 92;l_cost_per_hr jtf_rs_resource_extns.cost_per_hr%type := 25;l_primary_language jtf_rs_resource_extns.primary_language%type := 'AMERICAN';l_secondary_language jtf_rs_resource_extns.secondary_language%type := 'CANADIAN FRENCH'; l_support_site_id jtf_rs_resource_extns.support_site_id%type := 22917;l_ies_agent_login jtf_rs_resource_extns.ies_agent_login%type := 'guest';l_server_group_id jtf_rs_resource_extns.server_group_id%type := 112;l_assigned_to_group_id jtf_rs_resource_extns.assigned_to_group_id%type := 1548;l_cost_center jtf_rs_resource_extns.cost_center%type := '0A55';l_charge_to_cost_center jtf_rs_resource_extns.charge_to_cost_center%type := '250';l_comp_currency_code jtf_rs_resource_extns.compensation_currency_code%type := 'AUD';l_commissionable_flag jtf_rs_resource_extns.commissionable_flag%type := 'Y';l_hold_reason_code jtf_rs_resource_extns.hold_reason_code%type := 'HRC-1';l_hold_payment jtf_rs_resource_extns.hold_payment%type := 'N';l_comp_service_team_id jtf_rs_resource_extns.comp_service_team_id%type := 10072;l_source_name jtf_rs_resource_extns.source_name%type := 'Abbott, Ms. Rachel (Rachel)';l_source_number jtf_rs_resource_extns.source_number%type := 159;l_source_job_title jtf_rs_resource_extns.source_job_title%type := 'SAL600.Sales Representative';l_source_email jtf_rs_resource_extns.source_email%type := '[email protected]';l_source_phone jtf_rs_resource_extns.source_phone%type := '650-555-1212';l_object_version_number jtf_rs_resource_extns.object_version_number%type;

l_return_status varchar2(1);l_msg_count number;l_msg_data varchar2(2000);l_msg_data1 varchar2(2000);l_msg_index_out number;

begin

select object_version_number into l_object_version_number from jtf_rs_resource_extns where resource_id = l_resource_id;

jtf_rs_resource_pub.update_resource (P_API_VERSION => l_api_version, P_RESOURCE_ID => l_resource_id, P_RESOURCE_NUMBER => l_resource_number,

Resource Manager Public APIs 3-47

Page 192: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

P_START_DATE_ACTIVE => sysdate, P_END_DATE_ACTIVE => null, P_RESOURCE_NAME => l_resource_name, P_MANAGING_EMP_ID => l_managing_emp_id, P_USER_ID => l_user_id, P_TIME_ZONE => l_time_zone, P_COST_PER_HR => l_cost_per_hr, P_PRIMARY_LANGUAGE => l_primary_language, P_SECONDARY_LANGUAGE => l_secondary_language, P_SUPPORT_SITE_ID => l_support_site_id, P_IES_AGENT_LOGIN => l_ies_agent_login, P_SERVER_GROUP_ID => l_server_group_id, P_ASSIGNED_TO_GROUP_ID => l_assigned_to_group_id, P_COST_CENTER => l_cost_center, P_CHARGE_TO_COST_CENTER => l_charge_to_cost_center, P_COMP_CURRENCY_CODE => l_comp_currency_code, P_COMMISSIONABLE_FLAG => l_commissionable_flag, P_HOLD_REASON_CODE => l_hold_reason_code, P_HOLD_PAYMENT => l_hold_payment, P_COMP_SERVICE_TEAM_ID => l_comp_service_team_id, P_SOURCE_NAME => l_source_name, P_SOURCE_NUMBER => l_source_number, P_SOURCE_JOB_TITLE => l_source_job_title, P_SOURCE_EMAIL => l_source_email, P_SOURCE_PHONE => l_source_phone, P_OBJECT_VERSION_NUM => l_object_version_number, X_RETURN_STATUS => l_return_status, X_MSG_COUNT => l_msg_count, X_MSG_DATA => l_msg_data ); if (l_return_status <> 'S') then if (fnd_msg_pub.count_msg > 0) then for i in 1..fnd_msg_pub.count_msg loop fnd_msg_pub.get (p_msg_index => i, p_data => l_msg_data, p_encoded => 'F', p_msg_index_out => l_msg_index_out ); l_msg_data1 := l_msg_data1 ||' '|| l_msg_data; end loop; fnd_message.set_encoded(l_msg_data1); dbms_output.put_line(l_msg_data1); end if; else dbms_output.put_line ('Return Status - ' || l_return_status); end if;

end;

3-48 Oracle CRM Application Foundation API Reference Guide

Page 193: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

/

3.6.2 JTF_RS_GROUPS_PUBThe SQL scripts in this section create and update a resource group by calling the APIs contained in the JTF_RS_GROUPS_PUB package in succession and by providing them with the appropriate values.

3.6.2.1 Create_Resource_Group Sample CodeThis script calls the Create_Resource_Group API and provides the values listed in the following table using the Create_Resource_Group IN parameters. Calling applications can optionally insert more values than the ones listed in this section..

SET SERVEROUTPUT ON

declare

l_api_version number := 1.0;l_group_name jtf_rs_groups_vl.group_name%type := 'Sales Group';l_group_desc jtf_rs_groups_vl.group_desc%type := 'Sales Group Representative';l_exclusive_flag jtf_rs_groups_b.exclusive_flag%type := 'Y';l_email_address jtf_rs_groups_b.email_address%type := '[email protected]';l_start_date_active jtf_rs_groups_b.start_date_active%type := sysdate;l_end_date_active jtf_rs_groups_b.end_date_active%type := null;

Table 3–22 Create_Resource_Group API Sample Code Variables

Variable Description

l_api_version Version is 1.0.

l_group_name The group name is Sales Group.

l_group_desc The description of the group is Sales Group Representative.

l_exclusive_flag The exclusive flag is set to "Y".

l_email_address The group’s email address is [email protected].

l_start_date_active The start date is the same as the sysdate.

l_end_date_active The active end date is set to null.

l_accounting_code The accounting code is "Payment".

Resource Manager Public APIs 3-49

Page 194: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_accounting_code jtf_rs_groups_b.accounting_code%type := 'Payment';

l_return_status varchar2(1);l_msg_count number;l_msg_data varchar2(2000);l_group_id jtf_rs_groups_b.group_id%type;l_group_number jtf_rs_groups_b.group_number%type;

l_msg_data1 varchar2(2000);l_msg_index_out number;

begin

jtf_rs_groups_pub.create_resource_group (P_API_VERSION => l_api_version, P_GROUP_NAME => l_group_name, P_GROUP_DESC => l_group_desc, P_EXCLUSIVE_FLAG => l_exclusive_flag, P_ACCOUNTING_CODE => l_accounting_code, P_EMAIL_ADDRESS => l_email_address, P_START_DATE_ACTIVE => l_start_date_active, P_END_DATE_ACTIVE => l_end_date_active, X_RETURN_STATUS => l_return_status, X_MSG_COUNT => l_msg_count, X_MSG_DATA => l_msg_data, X_GROUP_ID => l_group_id, X_GROUP_NUMBER => l_group_number ); if (l_return_status <> 'S') then if (fnd_msg_pub.count_msg > 0) then for i in 1..fnd_msg_pub.count_msg loop fnd_msg_pub.get (p_msg_index => i, p_data => l_msg_data, p_encoded => 'F', p_msg_index_out => l_msg_index_out ); l_msg_data1 := l_msg_data1 ||' '|| l_msg_data; end loop; fnd_message.set_encoded(l_msg_data1); dbms_output.put_line(l_msg_data1); end if; else dbms_output.put_line ('Return Status - ' || l_return_status);

3-50 Oracle CRM Application Foundation API Reference Guide

Page 195: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

dbms_output.put_line ('Group ID - ' || l_group_id); dbms_output.put_line ('Group Number - ' || l_group_number); end if;

end;/

3.6.2.2 Update_Resource_Group Sample CodeThis script calls theUpdate_Resource_Group API and provides the values listed in the following table using the Update_Resource_Group IN parameters. Calling applications can optionally insert more values than the ones listed in this section.

SET SERVEROUTPUT ON

declare

l_api_version number := 1.0;l_group_id jtf_rs_groups_b.group_id%type := 10000;l_group_number jtf_rs_groups_b.group_number%type := '10005';l_group_name jtf_rs_groups_vl.group_name%type := 'Sales Group';l_group_desc jtf_rs_groups_vl.group_desc%type := 'Sales Group Representative';l_exclusive_flag jtf_rs_groups_b.exclusive_flag%type := 'Y';l_email_address jtf_rs_groups_b.email_address%type := '[email protected]';

Table 3–23 Update_Resource_Group API Sample Code Variables

Variable Description

l_api_version Version is 1.0.

l_group_id The group ID is 10000.

l_group_desc The description of the group is Sales Group Representative.

l_group_number The group number is 10005.

l_group_name The group name is "Sales Group".

l_group_desc The group description is Sales Group Representative.

l_exclusive_flag The exclusive flag is set to "Y".

l_email_address The group’s email address is [email protected].

l_start_date_active The start date is the same as the sysdate.

l_end_date_active The active end date is set to null.

l_accounting_code The accounting code is "Payment".

Resource Manager Public APIs 3-51

Page 196: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_start_date_active jtf_rs_groups_b.start_date_active%type := sysdate;l_end_date_active jtf_rs_groups_b.end_date_active%type := null;l_accounting_code jtf_rs_groups_b.accounting_code%type := 'Payment';

l_object_version_number jtf_rs_groups_b.object_version_number%type; l_return_status varchar2(1);l_msg_count number;l_msg_data varchar2(2000);l_msg_data1 varchar2(2000);l_msg_index_out number;

begin

select object_version_number into l_object_version_number from jtf_rs_groups_b where group_id = l_group_id;

jtf_rs_groups_pub.update_resource_group (P_API_VERSION => l_api_version, P_GROUP_ID => l_group_id, P_GROUP_NUMBER => l_group_number, P_GROUP_NAME => l_group_name, P_GROUP_DESC => l_group_desc, P_EXCLUSIVE_FLAG => l_exclusive_flag, P_ACCOUNTING_CODE => l_accounting_code, P_EMAIL_ADDRESS => l_email_address, P_START_DATE_ACTIVE => l_start_date_active, P_END_DATE_ACTIVE => l_end_date_active, P_OBJECT_VERSION_NUM => l_object_version_number, X_RETURN_STATUS => l_return_status, X_MSG_COUNT => l_msg_count, X_MSG_DATA => l_msg_data ); if (l_return_status <> 'S') then if (fnd_msg_pub.count_msg > 0) then for i in 1..fnd_msg_pub.count_msg loop fnd_msg_pub.get (p_msg_index => i, p_data => l_msg_data, p_encoded => 'F', p_msg_index_out => l_msg_index_out ); l_msg_data1 := l_msg_data1 ||' '|| l_msg_data; end loop; fnd_message.set_encoded(l_msg_data1); dbms_output.put_line(l_msg_data1); end if; else

3-52 Oracle CRM Application Foundation API Reference Guide

Page 197: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

dbms_output.put_line ('Return Status - ' || l_return_status); end if;

end;/

3.6.3 JTF_RS_SALESREPS_PUBThe SQL scripts in this section create and update a sales representative by calling the APIs contained in the JTF_RS_SALESREPS_PUB package in succession and by providing them with the appropriate values.

3.6.3.1 Create_SalesRep Sample CodeThis script calls the Create_SalesRep API and provides the values listed in the following table using the Create_SalesRep IN parameters. Calling applications can optionally insert more values than the ones listed in this section.

Table 3–24 Create_SalesRep API Sample Code Variables

Variable Description

l_api_version Version is 1.0.

l_resource_id The resouce ID number is 10001.

l_sales_credit_type_id The sales credit type ID is 5.

l_name The name is set to John Doe.

l_status The status is set to "A".

l_start_date_active The start date is equal to the sysdate.

l_end_date_active The end date is set to null.

l_gl_id_rev The global ID is 17736.

l_gl_id_freight The global freight ID is 17734.

l_gl_id_rec The global REC ID is 17703.

l_set_of_books_id The set of books ID is 23.

l_salesrep_number The salesrep number is 42549.

l_email_address The email address is [email protected]

Resource Manager Public APIs 3-53

Page 198: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

SET SERVEROUTPUT ON

declare

l_api_version number := 1.0;l_resource_id jtf_rs_salesreps.resource_id%type := 10001;l_sales_credit_type_id jtf_rs_salesreps.sales_credit_type_id%type := 5; l_name jtf_rs_salesreps.name%type := 'John Doe';l_status jtf_rs_salesreps.status%type := 'A';l_start_date_active jtf_rs_salesreps.start_date_active%type := sysdate;l_end_date_active jtf_rs_salesreps.end_date_active%type := null;l_gl_id_rev jtf_rs_salesreps.gl_id_rev%type := 17736;l_gl_id_freight jtf_rs_salesreps.gl_id_freight%type := 17734;l_gl_id_rec jtf_rs_salesreps.gl_id_rec%type := 17703;l_set_of_books_id jtf_rs_salesreps.set_of_books_id%type := 23;l_salesrep_number jtf_rs_salesreps.salesrep_number%type := '42549';l_email_address jtf_rs_salesreps.email_address%type := '[email protected]';l_wh_update_date jtf_rs_salesreps.wh_update_date%type := sysdate;l_sales_tax_geocode jtf_rs_salesreps.sales_tax_geocode%type := null;l_sales_tax_inside_city_limits jtf_rs_salesreps.sales_tax_inside_city_limits%type := null;

l_return_status varchar2(1);l_msg_count number;l_msg_data varchar2(2000);l_salesrep_id jtf_rs_salesreps.salesrep_id%type;

l_msg_data1 varchar2(2000);l_msg_index_out number;

begin

jtf_rs_salesreps_pub.create_salesrep (P_API_VERSION => l_api_version, P_RESOURCE_ID => l_resource_id, P_SALES_CREDIT_TYPE_ID => l_sales_credit_type_id, P_NAME => l_name, P_STATUS => l_status,

l_wh_update_date Wh_update is equal to the sysdate.

l_sales_tax_geocode The sales tax geocode is set to null.

l_sales_tax_inside_city_limits

The sales tax inside city limits is set to null.

Table 3–24 Create_SalesRep API Sample Code Variables

Variable Description

3-54 Oracle CRM Application Foundation API Reference Guide

Page 199: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

P_START_DATE_ACTIVE => l_start_date_active, P_END_DATE_ACTIVE => l_end_date_active, P_GL_ID_REV => l_gl_id_rev, P_GL_ID_FREIGHT => l_gl_id_freight, P_GL_ID_REC => l_gl_id_rec, P_SET_OF_BOOKS_ID => l_set_of_books_id, P_SALESREP_NUMBER => l_salesrep_number, P_EMAIL_ADDRESS => l_email_address, P_WH_UPDATE_DATE => l_wh_update_date, P_SALES_TAX_GEOCODE => l_sales_tax_geocode, P_SALES_TAX_INSIDE_CITY_LIMITS => l_sales_tax_inside_city_limits, X_RETURN_STATUS => l_return_status, X_MSG_COUNT => l_msg_count, X_MSG_DATA => l_msg_data, X_SALESREP_ID => l_salesrep_id ); if (l_return_status <> 'S') then if (fnd_msg_pub.count_msg > 0) then for i in 1..fnd_msg_pub.count_msg loop fnd_msg_pub.get (p_msg_index => i, p_data => l_msg_data, p_encoded => 'F', p_msg_index_out => l_msg_index_out ); l_msg_data1 := l_msg_data1 ||' '|| l_msg_data; end loop; fnd_message.set_encoded(l_msg_data1); dbms_output.put_line(l_msg_data1); end if; else dbms_output.put_line ('Return Status - ' || l_return_status); dbms_output.put_line ('Salesperson ID - ' || l_salesrep_id); end if;

end;/

3.6.3.2 Update_SalesRep Sample CodeThis script calls the Update_SalesRep API and provides the values listed in the following table using the Update_SalesRep IN parameters. Calling applications can optionally insert more values than the ones listed in this section.

Resource Manager Public APIs 3-55

Page 200: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

SET SERVEROUTPUT ON

declare

l_api_version number := 1.0;l_salesrep_id jtf_rs_salesreps.salesrep_id%type := 1000;l_sales_credit_type_id jtf_rs_salesreps.sales_credit_type_id%type := 5; l_name jtf_rs_salesreps.name%type := 'John Doe';l_status jtf_rs_salesreps.status%type := 'A';l_start_date_active jtf_rs_salesreps.start_date_active%type := sysdate;l_end_date_active jtf_rs_salesreps.end_date_active%type := null;

Table 3–25 Update_SalesRep API Sample Code Variables

Variable Description

l_api_version Version is 1.0.

l_salesrep_id The salesrep ID is 1000.

l_sales_credit_type_id The sales credit type ID is 5.

l_name The name is set to John Doe.

l_status The status is set to "A".

l_start_date_active The start date is equal to the sysdate.

l_end_date_active The end date is set to null.

l_gl_id_rev The global ID is 17736.

l_gl_id_freight The global freight ID is 17734.

l_gl_id_rec The global REC ID is 17703.

l_set_of_books_id The set of books ID is 23.

l_salesrep_number The salesrep number is 42549.

l_email_address The email address is [email protected]

l_wh_update_date Wh_update is equal to the sysdate.

l_sales_tax_geocode The sales tax geocode is set to null.

l_sales_tax_inside_city_limits

The sales tax inside city limits is set to null.

l_org_id The org ID is set to 204.

3-56 Oracle CRM Application Foundation API Reference Guide

Page 201: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_gl_id_rev jtf_rs_salesreps.gl_id_rev%type := 17736;l_gl_id_freight jtf_rs_salesreps.gl_id_freight%type := 17734;l_gl_id_rec jtf_rs_salesreps.gl_id_rec%type := 17703;l_set_of_books_id jtf_rs_salesreps.set_of_books_id%type := 23;l_salesrep_number jtf_rs_salesreps.salesrep_number%type := '42549';l_email_address jtf_rs_salesreps.email_address%type := '[email protected]';l_wh_update_date jtf_rs_salesreps.wh_update_date%type := sysdate;l_sales_tax_geocode jtf_rs_salesreps.sales_tax_geocode%type := null;l_sales_tax_inside_city_limits jtf_rs_salesreps.sales_tax_inside_city_limits%type := null;l_org_id jtf_rs_salesreps.org_id%type := 204;

l_object_version_number jtf_rs_salesreps.object_version_number%type;l_return_status varchar2(1);l_msg_count number;l_msg_data varchar2(2000);l_msg_data1 varchar2(2000);l_msg_index_out number;

begin

select object_version_number into l_object_version_number from jtf_rs_salesreps where salesrep_id = l_salesrep_id;

jtf_rs_salesreps_pub.update_salesrep (P_API_VERSION => l_api_version, P_SALESREP_ID => l_salesrep_id, P_SALES_CREDIT_TYPE_ID => l_sales_credit_type_id, P_NAME => l_name, P_STATUS => l_status, P_START_DATE_ACTIVE => l_start_date_active, P_END_DATE_ACTIVE => l_end_date_active, P_GL_ID_REV => l_gl_id_rev, P_GL_ID_FREIGHT => l_gl_id_freight, P_GL_ID_REC => l_gl_id_rec, P_SET_OF_BOOKS_ID => l_set_of_books_id, P_SALESREP_NUMBER => l_salesrep_number, P_EMAIL_ADDRESS => l_email_address, P_WH_UPDATE_DATE => l_wh_update_date, P_SALES_TAX_GEOCODE => l_sales_tax_geocode, P_SALES_TAX_INSIDE_CITY_LIMITS => l_sales_tax_inside_city_limits, P_ORG_ID => l_org_id, P_OBJECT_VERSION_NUMBER => l_object_version_number,

Resource Manager Public APIs 3-57

Page 202: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

X_RETURN_STATUS => l_return_status, X_MSG_COUNT => l_msg_count, X_MSG_DATA => l_msg_data ); if (l_return_status <> 'S') then if (fnd_msg_pub.count_msg > 0) then for i in 1..fnd_msg_pub.count_msg loop fnd_msg_pub.get (p_msg_index => i, p_data => l_msg_data, p_encoded => 'F', p_msg_index_out => l_msg_index_out ); l_msg_data1 := l_msg_data1 ||' '|| l_msg_data; end loop; fnd_message.set_encoded(l_msg_data1); dbms_output.put_line(l_msg_data1); end if; else dbms_output.put_line ('Return Status - ' || l_return_status); end if;

end;/

3-58 Oracle CRM Application Foundation API Reference Guide

Page 203: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Task Manager Public

4

Task Manager Public APIs

Task Manager provides Oracle CRM products with task management capability. Task Manager can be accessed as a standalone module or as an integrated component of other applications. When Task Manager is called by another application the values supplied by that application populate the relevant Task Manager fields. Other CRM modules call the Task Manager public APIs to insert, update, delete, and query task records.

This chapter discusses the following topics:

■ Task Manager Public Packages

■ Messages and Notifications

■ Sample Code

4.1 Task Manager Public PackagesAll public procedures (APIs) relating to creating, updating, or deleting tasks, task references, or task assignments are stored in the following public packages:

■ JTF_TASKS_PUB

■ JTF_TASK_ASSIGNMENTS_PUB

■ JTF_TASK_REFERENCES_PUB

APIs 4-1

Page 204: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Task Manager Public Packages

The following tables describe the Task Manager public APIs.

Table 4–1 Tasks APIs

Procedure Description

Create_Task Creates a task and provides the task with values supplied by the calling application. It also creates the dependencies, resource requirements, assignments, references, dates, recurrences, and contacts.

Update_Task Updates a task with values supplied by the calling application.

Delete_Task Soft deletes a task by marking the task as deleted without removing the task record from the database table in which it is stored.

Table 4–2 Task Assignments APIs

Procedure Description

Create_Task_Assignment Creates a task assignment for a specified task. The level of effort can be specified for each resource assigned to the task.

Update_Task_Assignment Updates a task assignment for a given task. For each resource assigned to the task, the actual effort can be specified.

Delete_Task_Assignment Deletes a task assignment for a specified task.

Table 4–3 Task References APIs

Procedure Description

Create_References Creates references to a task. For example, a task created for a service request can establish reference to an inventory part number using references.

Update_References Updates references to a task.

Delete_References Deletes references to a task.

4-2 Oracle CRM Application Foundation API Reference Guide

Page 205: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Task Manager Public Packages

Note: The following are referenced throughout the table’s "Validations and Descriptions" column in all of the Task APIs.

1. The Task APIs support calls by values not internal IDs. For example, the Account Number can be passed to the API instead of the Account ID. However, using these IDs improves the API performance.

2. The customer account should belong to the same customer which is specified for the task.

3. The address (party_site_id and party_site_number) specified for the task, should be the address registered for the customer in the TCA schema. The address can only be specified if the customer for the task is specified. In addition, the customer address specified for the task must be specified for the same customer at the task level.

4. To specifiy the unit of measure (UOM) for the effort and duration fields, the profile jtf_time_uom_class must be populated with the unit of measure class. For example, the customer can create a unit of measure class called TIME. The profile must be populated with this value. Further, the customer should create unit of measure codes such as minutes, hours, and days for the Time class. While specifying values to the APIs, the customer can pass values for these unit of measure codes.

5. Child and Parent tasks must have the same source. For example, the child task cannot have the source as Lead and the Parent task cannot have the source as Service Request.

6. Each task must have an owner associated with it. The owner for a task can be populated with the following two fields:

* Owner_type_code (for example rs_employee)

* Owner_id (for example resource_id of the employee)

The owner_type_code is a Foreign Key to jtf_objects_vl for objects with a usage of "Resources." The object definition in jtf_objects contains all the relevant information to create a PL/SQL statement. Using this PL/SQL statement, the owner_id is validated.

For example, for rs_employee, the SELECT statement that is created at run time is:

SELECT resource_id, full_name from JTF_RS_EMP_DTLS_VL Owner IDs passed to this API are validated against resources in the system.

Task Manager Public APIs 4-3

Page 206: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Task Manager Public Packages

7. Every task is associated with a source. Some examples of sources are: Service Requests, Leads, Opportunity, Campaigns, Defects, and Contracts. The source of a task drives most of the business rules for the task.

For example, Service Request #100 is the source for Task #101, Task #105, and Task #107. Therefore, the parent entity, Service Request #100, can create multiple tasks with the same source.

To create a source, the entity must be defined in JTF_OBJECTS. This can be accomplished by logging into CRM Administrator Responsibility >Task and Escalation Manager > Setups > Objects Meta > Data.

Continuing with the previous example, you will have the values of the parameters to create a task with a source of Service Request # 100.

p_source_object_type_code = SR

p_source_object_id = 100

p_source_object_name = A101

The Source_object_type_code is a Foreign Key to the JTF_OBJECTS with a usage of Task.

The source_object_id is the internal identifier which represents the instance of the source, in this case, service request identifier. This is generally the Primary Key of the "Source table," in this case, service request table.

The p_source_object_name is the external identifier which represents the instance of the source, in this case, service request number. The source object name is displayed on the user interface.

The same concept is used to established references to a task.

8. While updating or deleting any of the three public packages: tasks, task assignments, or task references, the object_version_number must be passed to the APIs. If the object_version_number that is passed into the API is the same as in the tables (tasks, assignments, and references), then the attempt is made to update or delete the record. Otherwise, an error is returned. You should get the object_version_number when selecting the record, then pass it to the update and delete APIs.

4-4 Oracle CRM Application Foundation API Reference Guide

Page 207: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

4.2 Package JTF_TASKS_PUBThe JTF_TASKS_PUB API contains the following APIs:

■ Create_Task

■ Update_Task

■ Delete_Task

4.2.1 Data Structure SpecificationsThe following data structures are used in the JTF_TASKS_PUB API:

■ Task Assign Record Type

■ Task Dependency Record Type

■ Task Reference Record Type

■ Task Recurrence Record Type

■ Task Dates Record Type

■ Task Contact Record Type

■ Task Notes Record Type

■ Sort Record Type

4.2.1.1 Task Assign Record TypeThis composite record type enumerates task assignment details that are ultimately stored in the JTF_TASK_ASSIGN table.

TYPE task_assign_rec IS RECORD.( resource_type_code number, resource_id number, actual_start_date date := null, actual_end_date date := null, actual_effort_duration number := null, actual_effort_dur_uom varchar2(3) := null, scheduled_travel_distance number :=null, scheduled_travel_duration number :=null, scheduled_travel_duration_uom varchar2(3) :=null, actual_travel_distance number :=null, actual_travel_duration number :=null, scheduled_travel_duration_uom varchar2(3) :=null,

Task Manager Public APIs 4-5

Page 208: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

schedule_flag varchar2(1) := null, alarm_type_code varchar2(30) := null, alarm_contact varchar2(200) := null);

4.2.1.2 Task Dependency Record TypeThis composite record type enumerates the dependency information between two tasks that is ultimately stored in the JTF_TASK_DEPENDS table. When template_flag =’Y’, the dependency exists between the templates. When this field is not set to ’Y’ the dependency exists between the tasks. The Adjustment_time and adjustment_time_uom fields indicate the lead or lag time between the two tasks.

TYPE task_depends_rec IS RECORD.( dependent_on_task_id number, dependent_on_task_number number := null, dependency_type_code varchar2(30), adjustment_time number := null, adjustment_time_uom varchar2(3) := null);

4.2.1.3 Task Reference Record TypeThis composite record type enumerates the reference details for a specific task that are ultimately stored in the JTF_TASK_REFERENCES table. The reference_code field retreives the value from Lookup code stored in the JTF_TASK_REFERENCE_CODES table.

TYPE task_refer_rec IS RECORD.( object_type_code varchar2(10), object_type_name varchar2(80) object_name varchar2(80), object_id number, object_details varchar2(2000), reference_code varchar2(30), usage varchar2(2000));

4.2.1.4 Task Recurrence Record TypeThis composite record type enumerates recurring task information that is ultimately stored in the JTF_TASK_RECUR_REC table.

TYPE task_recur_rec IS RECORD.

4-6 Oracle CRM Application Foundation API Reference Guide

Page 209: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

( occurs_which number, day_of_week number, date_of_month number, occurs_month number, occurs_uom varchar2(3), occurs_every number, occurs_number number start_date_active date := null, end_date_active date := null);

4.2.1.5 Task Dates Record TypeThis composite record type enumerates task date values that are ultimately stored in the JTF_TASK_DATES table. The date_type_id field is a foreign key to the JTF_TASK_DATE_TYPES table.

TYPE task_dates_rec IS RECORD.( date_type_id number default null, date_type_name varchar2(30) default null, date_type varchar2(30) default null, date_value date);

4.2.1.6 Task Contact Record TypeThis composite record type enumerates customer contact information that is ultimately stored in the JTF_TASK_CONTACTS table.

TYPE task_contacts_rec IS RECORD.( contact_id number default null, contact_type_code varchar2(30) default null, escalation_notify_flag varchar2(1) default null, escalation_requester_flag varchar2(1) default null);

4.2.1.7 Task Notes Record TypeThis composite record type enumerates notes information that is ultimately stored in the JTF_TASK_NOTES table.

TYPE task_notes_rec IS RECORD (

Task Manager Public APIs 4-7

Page 210: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

parent_note_id number, org_id number, notes varchar2(4000), notes_detail varchar2(32767), note_status varchar2(1), entered_by number, entered_date date, note_type varchar2(30), jtf_note_id number, attribute1 varchar2(150), attribute2 varchar2(150), attribute3 varchar2(150), attribute4 varchar2(150), attribute5 varchar2(150), attribute6 varchar2(150), attribute7 varchar2(150), attribute8 varchar2(150), attribute9 varchar2(150), attribute10 varchar2(150), attribute11 varchar2(150), attribute12 varchar2(150), attribute13 varchar2(150), attribute14 varchar2(150), attribute15 varchar2(150), context varchar2(30) );

4.2.1.8 Sort Record TypeThis composite record type enumerates task sorting information that is ultimately stored in the SORT_REC table.

TYPE sort_rec IS RECORD ( field_name varchar2(30), asc_dsc_flag char(1) default 'A' );

4-8 Oracle CRM Application Foundation API Reference Guide

Page 211: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

4.2.2 Create_TaskThis procedure creates a task with the given specifications. Also, it creates the dependencies, resource requirements, assignments, references, dates, recurrences, and contacts for the task created.

Procedure SpecificationPROCEDURE create_task( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_task_id in number default null, p_task_name in varchar2, P_task_type_name in varchar2 default null, p_task_type_id in number default null, p_description in varchar2 default null, p_task_status_name in varchar2 default null, p_task_status_id in number default null, p_task_priority_name in varchar2 default null, p_task_priority_id in number default null, p_owner_type_name in varchar2 default null, p_owner_type_code in varchar2 default null, p_owner_id in number default null, p_owner_territory_id in number default null, p_assigned_by_name in varchar2 default null, p_assigned_by_id in number default null, p_customer_number in varchar2 default null, p_customer_id in number default null, p_cust_account_number in varchar2 default null, p_cust_account_id in number default null, p_address_id in number default null, p_address_number in varchar2 default null, p_planned_start_date in date default null, p_planned_end_date in date default null, p_scheduled_start_date in date default null, p_scheduled_end_date in date default null, p_actual_start_date in date default null, p_actual_end_date in date default null, p_timezone_id in number default null, p_timezone_name in varchar2 default null, p_source_object_type_code in varchar2 default null, p_source_object_id in number default null, p_source_object_name in varchar2 default null,

Task Manager Public APIs 4-9

Page 212: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_duration in number default null, p_duration_uom in varchar2 default null, p_planned_effort in number default null, p_planned_effort_uom in varchar2 default null, p_actual_effort in number default null, p_actual_effort_uom in varchar2 default null, p_percentage_complete in number default null, p_reason_code in varchar2 default null, p_private_flag in varchar2 default null, p_publish_flag in varchar2 default null, p_restrict_closure_flag in varchar2 default null, p_multi_booked_flag in varchar2 default null, p_milestone_flag in varchar2 default null, p_holiday_flag in varchar2 default null, p_billable_flag in varchar2 default null, p_bound_mode_code in varchar2 default null, p_soft_bound_flag in varchar2 default null, p_workflow_process_id in number default null, p_notification_flag in varchar2 default null, p_notification_period in number default null, p_notification_period_uom in varchar2 default null, p_parent_task_number in varchar2 default null, p_parent_task_id in number default null, p_alarm_start in number default null, p_alarm_start_uom in varchar2 default null, p_alarm_on in varchar2 default null, p_alarm_count in number default null, p_alarm_interval in number default null, p_alarm_interval_uom in varchar2 default null, p_palm_flag in varchar2 default null, p_wince_flag in varchar2 default null, p_laptop_flag in varchar2 default null, p_device1_flag in varchar2 default null, p_device2_flag in varchar2 default null, p_device3_flag in varchar2 default null, p_costs in number default null, p_currency_code in varchar2 default null, p_escalation_level in varchar2 default null, p_task_assign_tbl in task_assign_tbl default g_miss_task_assign_tbl, p_task_depends_tbl in task_depends_tbl default g_miss_task_depends_tbl, p_task_rsrc_req_tbl in task_rsrc_req_tbl default g_miss_task_rsrc_req_tbl, p_task_refer_tbl in task_refer_tbl default g_miss_task_refer_tbl, p_task_dates_tbl in task_dates_tbl default g_miss_task_dates_tbl, p_task_notes_tbl in task_notes_tbl default g_miss_task_notes_tbl, p_task_recur_rec in task_recur_rec default g_miss_task_recur_rec,

4-10 Oracle CRM Application Foundation API Reference Guide

Page 213: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_task_contacts_tbl in task_contacts_tbl default g_miss_task_contacts_tbl, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, x_task_id out number, p_attribute1 in varchar2 default null, p_attribute2 in varchar2 default null, p_attribute3 in varchar2 default null, p_attribute4 in varchar2 default null, p_attribute5 in varchar2 default null, p_attribute6 in varchar2 default null, p_attribute7 in varchar2 default null, p_attribute8 in varchar2 default null, p_attribute9 in varchar2 default null, p_attribute10 in varchar2 default null, p_attribute11 in varchar2 default null, p_attribute12 in varchar2 default null, p_attribute13 in varchar2 default null, p_attribute14 in varchar2 default null, p_attribute15 in varchar2 default null, p_attribute_category in varchar2 default null, p_date_selected in varchar2 default null, p_category_id in number default null, p_show_on_calendar in varchar2 default null, p_owner_status_id in number default null, p_template_id in number default null, p_template_group_id in number default null, p_enable_workflow in varchar2, p_abort_workflow in varchar2);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

Task Manager Public APIs 4-11

Page 214: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_task_id NUMBER No Unique task identifier (Primary Key).

If task_id is not specificied, then the task_id is automatically generated and passed as an out parameter x_task_id.

p_task_name VARCHAR2 Yes This defines the task name.

p_task_type_name

VARCHAR2 Yes This defines the task type name.

p_task_type_id NUMBER Yes This is the task type identifier.

p_description VARCHAR2 No This is the description of the task.

p_task_status_name

VARCHAR2 No This defines the task status name.

p_task_status_id NUMBER No Unique task status identifier

p_task_priority_name

VARCHAR2 No Currently not supported

p_task_priority_id

NUMBER No This defines the task priority (Foreign Key to JTF_TASK_PRIORITIES).

p_owner_type_code

VARCHAR2 Yes Owner type of the task (Foreign Key to JTF_OBJECTS_VL for an object with a usage of "Resources").

p_owner_id NUMBER Yes Owner of the task (resource ID of the task owner. Foreign key to JTF_RS_RESOURCE_EXTNS_VL, JTF_RS_GROUPS_VL, JTF_RS_TEAMS_VL depending on the value of owner_type_code).

p_owner_territory_id

NUMBER No Territory of the owner. Currently not supported

p_assigned_by_name

VARCHAR2 No Currently not supported

p_assigned_by_id

NUMBER No This is the user who assigned the task, (Foreign Key to FND_USER).

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-12 Oracle CRM Application Foundation API Reference Guide

Page 215: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_customer_number

VARCHAR2 No Customer number (Foreign Key to hz_parties.party_number).

p_customer_id NUMBER No This is the customer identifier (Foreign Key to hz_parties.party_id).

p_cust_account_number

VARCHAR2 No Customer account number (Foreign Key to hz_cust_accounts.cust_account_number).

p_cust_account_id

NUMBER No Customer account identifier (Foreign Key to hz_cust_accounts.cust_account_id).

The customer account should belong to the same customer which is specified for the task.

p_address_id NUMBER No This is the address identifier (Foreign Key to hz_party_sites.party_site_id).

See Note: 3 on page 4-3.

p_address_number

VARCHAR2 No Address number (Foreign Key to hz_party_sites.party_site_number).

See Note: 3 on page 4-3.

p_planned_start_date

DATE No This defines the Planned Start Date.

p_planned_end_date

DATE No This defines the Planned End Date.

p_scheduled_start_date

DATE No This defines the Scheduled Start Date.

p_scheduled_end_date

DATE No This defines the Scheduled End Date.

p_actual_start_date

DATE No This defines the Actual Start Date.

p_actual_end_date

DATE No This defines the Actual End Date.

p_timezone_id NUMBER No This is the time zone identifier (timezone for the planned, scheduled, and actual dates.)

Foreign Key to hz_timezones.timezone_id.

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-13

Page 216: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_timezone_name

VARCHAR2 No Currently not supported.

p_source_object_type_code

VARCHAR2 No The Source object code for the task. (Foreign Key to JTF_OBJECTS_VL for objects with a usage of "Task").

p_source_object_id

NUMBER No This is the internal ID of source object.

Validated from the table registered in JTF_OBJECTS_VL for the object_type_code.

p_source_object_name

VARCHAR2 No This is the user–visible source object identifier.

Validated from the table registered in JTF_OBJECTS_VL for the object_type_code.

p_duration NUMBER No This defines the duration of task.

p_duration_uom VARCHAR2 No This defines the unit of measure for duration.

See Note: 5 on page 4-3.

p_planned_effort NUMBER No This defines the planned effort.

p_planned_effort_uom

VARCHAR2 No This defines the unit of measure for planned effort.

p_actual_effort NUMBER No This defines the actual amount of effort spent on a task by all assignees.

p_actual_effort_uom

VARCHAR2 No This defines the unit of measure for actual work.

See Note: 5 on page 4-3.

p_percentage_complete

NUMBER No This defines the percentage of completion of the task.

p_reason_code VARCHAR2 No Reason for rejecting a task, reassigning a task, etc.

p_private_flag VARCHAR2 No Indicates whether the task is private or public. Checks if the value is Y or N.

p_publish_flag VARCHAR2 No Indicates whether the task should be published. Checks if the value is Y or N.

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-14 Oracle CRM Application Foundation API Reference Guide

Page 217: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_restrict_closure_flag

VARCHAR2 No Indicates whether completing the task is necessary for the source object to be deemed complete. Checks if the value is Y or N.

p_multi_booked_flag

VARCHAR2 No Indicates whether the task can book resources that are already assigned to other tasks. Checks if the value is Y or N.

p_milestone_flag VARCHAR2 No Indicates whether the task is a milestone delivery date. Checks if the value is Y or N.

p_holiday_flag VARCHAR2 No Indicates whether the task can be performed on holidays. Checks if the value is Y or N.

p_billable_flag VARCHAR2 No Indicates whether the task is billable. Checks if the value is Y or N.

p_bound_mode_code

VARCHAR2 No For internal use only

p_soft_bound_flag

VARCHAR2 No For internal use only

p_workflow_process_id

NUMBER No Identifier of last workflow process launched for this task.

p_notification_flag

VARCHAR2 No Flag indicating whether notification workflow will be automatically launched.

p_notification_period

NUMBER No Time before the scheduled start date that a notification is sent to the assignees.

p_notification_period_uom

VARCHAR2 No This is the unit of measure for the notification period.

p_parent_task_number

VARCHAR2 No The Task number of the parent task.

p_parent_task_id NUMBER No The Task identifier of the parent task.

p_alarm_start NUMBER No Indicates when the first alarm should be fired. This parameter is currently not supported.

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-15

Page 218: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_alarm_start_uom

VARCHAR2 No Unit of measure for alarm_start. This parameter is currently not supported.

p_alarm_on VARCHAR2 No Indicates whether the alarm is on. This parameter is currently not supported.

p_alarm_count NUMBER No Total number of alarms to fire. This parameter is currently not supported.

p_alarm_interval NUMBER No Alarm interval. This parameter is currently not supported.

p_alarm_interval_uom

VARCHAR2 No Unit of measure for alarm interval. This parameter is currently not supported.

p_palm_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_wince_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_laptop_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_device1_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_device2_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_device3_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_costs NUMBER No For internal use only

p_currency_code VARCHAR2 No For internal use only

p_escalation_level

VARCHAR2 No Escalation level. This parameter is not used for the Task Module

p_task_assign_tbl

TASK_ASSIGN_TBL

No Table of PL/SQL records to specify the assignment specifications of the task.

p_task_depends_tbl

TASK_DEPENDS_TBL

No Table of PL/SQL records to specify the task dependencies.

p_task_rsrc_req_tbl

TASK_RSRC_REQ_TBL

No Table of PL/SQL records to specify the resource requirements. This is not supported.

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-16 Oracle CRM Application Foundation API Reference Guide

Page 219: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_task_refer_tbl TASK_REFER_TBL

No Table of PL/SQL records to specify the task references.

p_task_dates_tbl TASK_DATES_TBL

No Table of PL/SQL records to specify the task dates. Currently not supported.

p_task_notes_tbl TASK_NOTES_TBL

No Table of PL/SQL records to specify the notes.

p_task_recur_rec TASK_RECUR_REC

No Table of PL/SQL records to specify the task recurrences.

p_task_contacts_tbl

TASK_CONTACTS_TBL

No Table of PL/SQL records to specify the task contacts.

p_attribute1 VARCHAR2 No Descriptive flexfield segment column

p_attribute2 VARCHAR2 No Descriptive flexfield segment column

p_attribute3 VARCHAR2 No Descriptive flexfield segment column

p_attribute4 VARCHAR2 No Descriptive flexfield segment column

p_attribute5 VARCHAR2 No Descriptive flexfield segment column

p_attribute6 VARCHAR2 No Descriptive flexfield segment column

p_attribute7 VARCHAR2 No Descriptive flexfield segment column

p_attribute8 VARCHAR2 No Descriptive flexfield segment column

p_attribute9 VARCHAR2 No Descriptive flexfield segment column

p_attribute10 VARCHAR2 No Descriptive flexfield segment column

p_attribute11 VARCHAR2 No Descriptive flexfield segment column

p_attribute12 VARCHAR2 No Descriptive flexfield segment column

p_attribute13 VARCHAR2 No Descriptive flexfield segment column

p_attribute14 VARCHAR2 No Descriptive flexfield segment column

p_attribute15 VARCHAR2 No Descriptive flexfield segment column

p_attribute_category

VARCHAR2 No Descriptive flexfield structure defining column

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-17

Page 220: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

The following table describes the OUT parameters associated with this API.

p_date_selected VARCHAR2 No This date is copied from the Task profile option and copied to the Calendar Start date. Valid values include Planned, Scheduled, or Actual.

p_category_id NUMBER No This defines the task category ID.

p_show_on_calendar

VARCHAR2 No Displays Tasks on the HTML Calendar.Checks if the Value is Y or N.

p_owner_status_id

NUMBER Yes The status of the task level.

p_template_id NUMBER No Identifier for when you are creating a task from a template.

p_template_group_id

NUMBER No Identifier for when you are creating a task from a template group.

p_enable_workflow

VARCHAR2 Yes Determines whether or not to send automatic notifications from the application. Checks if the value is Y or N.

p_abort_workflow

VARCHAR2 Yes Determines whether or not to abort the previous Workflow process before starting the next one. Checks if the value is Y or N.

Table 4–5 Create_Task Out Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_task_id NUMBER This is the task identifier.

Table 4–4 Create_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-18 Oracle CRM Application Foundation API Reference Guide

Page 221: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

4.2.3 Update_TaskThis procedure updates a task with the given specifications. While calling the Update_Task API, task_id and task_number should be input to the API. The task_id or the task_number must be specified to indicate the task that is being updated.

Procedure Specification PROCEDURE update_task( p_api_version in number p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_object_version_number in out number, p_task_id in number default fnd_api.g_miss_num, p_task_number in varchar2 default fnd_api.g_miss_char, p_task_name in varchar2 default fnd_api.g_miss_char, p_task_type_name in varchar2 default fnd_api.g_miss_char, p_task_type_id in number default fnd_api.g_miss_num, p_description in varchar2 default fnd_api.g_miss_char, p_task_status_name in varchar2 default fnd_api.g_miss_char, p_task_status_id in number default fnd_api.g_miss_num, p_task_priority_name in varchar2 default fnd_api.g_miss_char, p_task_priority_id in number default fnd_api.g_miss_num, p_owner_type_name in varchar2 default fnd_api.g_miss_char, p_owner_type_code in varchar2 default fnd_api.g_miss_char, p_owner_id in number default fnd_api.g_miss_num, p_owner_territory_id in number default fnd_api.g_miss_num, p_assigned_by_name in varchar2 default fnd_api.g_miss_char, p_assigned_by_id in number default fnd_api.g_miss_num, p_customer_number in varchar2 default fnd_api.g_miss_char, p_customer_id in number default fnd_api.g_miss_num, p_cust_account_number in varchar2 default fnd_api.g_miss_char, p_cust_account_id in number default fnd_api.g_miss_num, p_address_id in number default fnd_api.g_miss_num, p_address_number in varchar2 default fnd_api.g_miss_char, p_planned_start_date in date default fnd_api.g_miss_date, p_planned_end_date in date default fnd_api.g_miss_date, p_scheduled_start_date in date default fnd_api.g_miss_date, p_scheduled_end_date in date default fnd_api.g_miss_date, p_actual_start_date in date default fnd_api.g_miss_date, p_actual_end_date in date default fnd_api.g_miss_date, p_timezone_id in number default fnd_api.g_miss_num, p_timezone_name in varchar2 default fnd_api.g_miss_char, p_source_object_type_code in varchar2 default fnd_api.g_miss_char,

Task Manager Public APIs 4-19

Page 222: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_source_object_id in number default fnd_api.g_miss_num, p_source_object_name in varchar2 default fnd_api.g_miss_char, p_duration in number default fnd_api.g_miss_num, p_duration_uom in varchar2 default fnd_api.g_miss_char, p_planned_effort in number default fnd_api.g_miss_num, p_planned_effort_uom in varchar2 default fnd_api.g_miss_char, p_actual_effort in number default fnd_api.g_miss_num, p_actual_effort_uom in varchar2 default fnd_api.g_miss_char, p_percentage_complete in number default fnd_api.g_miss_num, p_reason_code in varchar2 default fnd_api.g_miss_char, p_private_flag in varchar2 default fnd_api.g_miss_char, p_publish_flag in varchar2 default fnd_api.g_miss_char, p_restrict_closure_flag in varchar2 default fnd_api.g_miss_char, p_multi_booked_flag in varchar2 default fnd_api.g_miss_char, p_milestone_flag in varchar2 default fnd_api.g_miss_char, p_holiday_flag in varchar2 default fnd_api.g_miss_char, p_billable_flag in varchar2 default fnd_api.g_miss_char, p_bound_mode_code in varchar2 default fnd_api.g_miss_char, p_soft_bound_flag in varchar2 default fnd_api.g_miss_char, p_workflow_process_id in number default fnd_api.g_miss_num, p_notification_flag in varchar2 default fnd_api.g_miss_char, p_notification_period in number default fnd_api.g_miss_num, p_notification_period_uom in varchar2 default fnd_api.g_miss_char, p_alarm_start in number default fnd_api.g_miss_num, p_alarm_start_uom in varchar2 default fnd_api.g_miss_char, p_alarm_on in varchar2 default fnd_api.g_miss_char, p_alarm_count in number default fnd_api.g_miss_num, p_alarm_fired_count in number default fnd_api.g_miss_num, p_alarm_interval in number default fnd_api.g_miss_num, p_alarm_interval_uom in varchar2 default fnd_api.g_miss_char, p_palm_flag in varchar2 default fnd_api.g_miss_char, p_wince_flag in varchar2 default fnd_api.g_miss_char, p_laptop_flag in varchar2 default fnd_api.g_miss_char, p_device1_flag in varchar2 default fnd_api.g_miss_char, p_device2_flag in varchar2 default fnd_api.g_miss_char, p_device3_flag in varchar2 default fnd_api.g_miss_char, p_costs in number default fnd_api.g_miss_num, p_currency_code in varchar2 default fnd_api.g_miss_char, p_escalation_level in varchar2 default fnd_api.g_miss_char, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_attribute1 in varchar2 default jtf_task_utl.g_miss_char, p_attribute2 in varchar2 default jtf_task_utl.g_miss_char, p_attribute3 in varchar2 default jtf_task_utl.g_miss_char,

4-20 Oracle CRM Application Foundation API Reference Guide

Page 223: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_attribute4 in varchar2 default jtf_task_utl.g_miss_char, p_attribute5 in varchar2 default jtf_task_utl.g_miss_char, p_attribute6 in varchar2 default jtf_task_utl.g_miss_char, p_attribute7 in varchar2 default jtf_task_utl.g_miss_char, p_attribute8 in varchar2 default jtf_task_utl.g_miss_char, p_attribute9 in varchar2 default jtf_task_utl.g_miss_char, p_attribute10 in varchar2 default jtf_task_utl.g_miss_char, p_attribute11 in varchar2 default jtf_task_utl.g_miss_char, p_attribute12 in varchar2 default jtf_task_utl.g_miss_char, p_attribute13 in varchar2 default jtf_task_utl.g_miss_char, p_attribute14 in varchar2 default jtf_task_utl.g_miss_char, p_attribute15 in varchar2 default jtf_task_utl.g_miss_char, p_attribute_category in varchar2 default jtf_task_utl.g_miss_char p_date_selected in varchar2 default jtf_task_utl.g_miss_char, p_category_id in number default jtf_task_utl.g_miss_number, p_show_on_calendar in varchar2 default jtf_task_utl.g_miss_char, p_owner_status_id in number default jtf_task_utl.g_miss_number, p_parent_task_id in number default jtf_task_utl.g_miss_number, p_parent_task_number in varchar2 default jtf_task_utl.g_miss_char);

Current Version1.0

Parameter DescriptionsThe following tables describes the IN parameters associated with this API.

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_object_version_number

NUMBER Yes This parameter is for internal use only. Do not modify in any way.

Task Manager Public APIs 4-21

Page 224: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_task_id NUMBER No This is the unique task identifier (Primary Key).

If task_id is not specificied, then the task_id is automatically generated and passed as an OUT parameter x_task_id.

p_task_number VARCHAR2 No This defines the task number.

p_task_name VARCHAR2 Yes This defines the task name.

p_task_type_name

VARCHAR2 No This defines the task type name.

p_task_type_id NUMBER Yes This defines the task type identifier.

p_description VARCHAR2 No This is the description of the task.

p_task_status_name

VARCHAR2 No This is the task status name.

p_task_status_id NUMBER No This is the unique task status identifier.

p_task_priority_name

VARCHAR2 No Currently not supported.

p_task_priority_id

NUMBER No Task priority (Foreign Key to JTF_TASK_PRIORITIES).

p_owner_type_name

VARCHAR2 No Currently not supported.

p_owner_type_code

VARCHAR2 Yes Owner type of the task (Foreign Key to JTF_OBJECTS_VL for an object with a usage of "Resources").

p_owner_id NUMBER Yes Owner of the task (resource ID of the task owner. Foreign Key to JTF_RS_RESOURCE_EXTNS_VL, JTF_RS_GROUPS_VL, JTF_RS_TEAMS_VL depending on the value of owner_type_code).

p_owner_territory_id

NUMBER No Territory identifier of the owner.

p_assigned_by_name

VARCHAR2 No Currently not supported.

p_assigned_by_id

NUMBER No User who assigned the task, (Foreign Key to FND_USER).

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-22 Oracle CRM Application Foundation API Reference Guide

Page 225: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_customer_number

VARCHAR2 No Customer number (Foreign Key to hz_parties.party_number).

p_customer_id NUMBER No Customer identifier (Foreign Key to hz_parties.party_id).

p_cust_account_number

VARCHAR2 No Customer account number (Foreign Key to hz_cust_accounts.cust_account_number).

p_cust_account_id

NUMBER No Customer account identifier (Foreign Key to hz_cust_accounts.cust_account_id).

The customer account should belong to the same customer who is specified for the task.

p_address_id NUMBER No This is the address identifier.

p_address_number

VARCHAR2 No Address number (Foreign key to hz_party_sites.party_site_number).

See Note: 3 on page 4-3.

p_planned_start_date

DATE No This defines the Planned start date.

p_planned_end_date

DATE No This defines the Planned end date.

p_scheduled_start_date

DATE No This defines the Scheduled start date.

p_scheduled_end_date

DATE No This defines the Scheduled end date.

p_actual_start_date

DATE No This defines the Actual start date.

p_actual_end_date

DATE No This defines the Actual end date.

p_timezone_id NUMBER No Time zone identifier (timezone for the planned, scheduled, and actual dates.)

Foreign Key to hz_timezones.timezone_id.

p_timezone_name

VARCHAR2 No Currently not supported.

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-23

Page 226: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_source_object_type_code

VARCHAR2 No Only supported in Create Tasks.

p_source_object_id

NUMBER No Only supported in Create Tasks.

p_source_object_name

VARCHAR2 No Only supported in Create Tasks.

p_duration NUMBER No The duration of task.

p_duration_uom VARCHAR2 No Unit of measure for duration.

See Note: 5 on page 4-3.

p_planned_effort NUMBER No This defines the planned effort.

p_planned_effort_uom

VARCHAR2 No The unit of measure for planned effort.

p_actual_effort NUMBER No Actual amount of effort spent on a task by all assignees.

p_actual_effort_uom

VARCHAR2 No Unit of measure for actual work.

See Note: 5 on page 4-3.

p_percentage_complete

NUMBER No Percentage completion of task.

p_reason_code VARCHAR2 No Reason for rejecting a task, reassigning a task, etc.

p_private_flag VARCHAR2 No Indicates whether the task is private or public. Checks if the value is Y or N.

p_publish_flag VARCHAR2 No Indicates whether the task should be published. Checks if the value is Y or N.

p_restrict_closure_flag

VARCHAR2 No Indicates whether completing the task is necessary for the source object to be deemed complete. Checks if the value is Y or N.

p_multi_booked_flag

VARCHAR2 No Indicates whether the task can book resources that are already assigned to other tasks. Checks if the value is Y or N.

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-24 Oracle CRM Application Foundation API Reference Guide

Page 227: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_milestone_flag VARCHAR2 No Indicates whether the task is a milestone delivery date. Checks if the value is Y or N.

p_holiday_flag VARCHAR2 No Indicates whether the task can be performed on holidays. Checks if the value is Y or N.

p_billable_flag VARCHAR2 No Indicates whether the task is billable. Checks if the value is Y or N.

p_bound_mode_code

VARCHAR2 No For internal use only.

p_soft_bound_flag

VARCHAR2 No For internal use only.

p_workflow_process_id

NUMBER No Identifier of last workflow process launched for this task.

p_notification_flag

VARCHAR2 No Flag indicating whether notification workflow will be automatically launched.

p_notification_period

NUMBER No Time before the scheduled start date that a notification is sent to the assignees.

p_notification_period_uom

VARCHAR2 No Unit of measure for notification period.

p_alarm_start NUMBER No Indicates when the first alarm should be fired. This parameter is currently not supported.

p_alarm_start_uom

VARCHAR2 No The unit of measure for alarm_start. This parameter is currently not supported.

p_alarm_on VARCHAR2 No Indicates whether the alarm is on. This parameter is currently not supported.

p_alarm_count NUMBER No Total number of alarms to fire. This parameter is currently not supported.

p_alarm_fired_count

NUMBER No Number of times the alarm has been fired.

p_alarm_interval NUMBER No Alarm interval. This parameter is currently not supported.

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-25

Page 228: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

p_alarm_interval_uom

VARCHAR2 No Unit of measure for alarm interval. This parameter is currently not supported.

p_palm_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_wince_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_laptop_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_device1_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_device2_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_device3_flag VARCHAR2 No Used by mobile devices. Checks if the value is Y or N.

p_costs NUMBER No For internal use only.

p_currency_code VARCHAR2 No For internal use only.

p_escalation_level

VARCHAR2 No Escalation level. This parameter is not used for the Task Module.

p_attribute1 VARCHAR2 No Descriptive flexfield segment column.

p_attribute2 VARCHAR2 No Descriptive flexfield segment column.

p_attribute3 VARCHAR2 No Descriptive flexfield segment column.

p_attribute4 VARCHAR2 No Descriptive flexfield segment column.

p_attribute5 VARCHAR2 No Descriptive flexfield segment column.

p_attribute6 VARCHAR2 No Descriptive flexfield segment column.

p_attribute7 VARCHAR2 No Descriptive flexfield segment column.

p_attribute8 VARCHAR2 No Descriptive flexfield segment column.

p_attribute9 VARCHAR2 No Descriptive flexfield segment column.

p_attribute10 VARCHAR2 No Descriptive flexfield segment column.

p_attribute11 VARCHAR2 No Descriptive flexfield segment column.

p_attribute12 VARCHAR2 No Descriptive flexfield segment column.

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

4-26 Oracle CRM Application Foundation API Reference Guide

Page 229: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

The following table describes the OUT parameters associated with this API.

4.2.4 Delete_TaskThis procedure soft deletes a task with the given specifications. It marks the task as deleted but does not physically remove the record from the table. If the task is recurring, then all the future tasks can be deleted by setting the value of the parameter p_delete_future_recurrences to fnd_api.g_true.

p_attribute13 VARCHAR2 No Descriptive flexfield segment column.

p_attribute14 VARCHAR2 No Descriptive flexfield segment column.

p_attribute15 VARCHAR2 No Descriptive flexfield segment column.

p_attribute_category

VARCHAR2 No Descriptive flexfield structure defining column.

p_date_selected VARCHAR2 No This date is copied from the task profile option and copied to the Calendar Start date. Valid values include Planned, Scheduled, or Actual.

p_category_id NUMBER No Task Category ID

p_show_on_calendar

VARCHAR2 No Displays Tasks on the HTML Calendar.Checks if the Value is Y or N.

p_owner_status_id

NUMBER Yes The status of the task level.

p_parent_task_id NUMBER No Identifier for the parent task.

p_parent_task_number

VARCHAR2 No The parent task number.

Table 4–7 Update_Task OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 4–6 Update_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-27

Page 230: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_PUB

Procedure Specification PROCEDURE delete_task( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_object_version_number in number, p_task_id in number default null, p_task_number in varchar2 default null, p_delete_future_recurrences in varchar2 default fnd_api.g_false, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–8 Delete_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_object_version_number

NUMBER No This parameter is for internal use only. Do not modify in any way.

p_task_id NUMBER No Unique task identifier (Primary Key).

If task_id is not specificied, then the task_id is automatically generated and passed as an out parameter x_task_id.

p_task_number VARCHAR2 No This defines the task number.

4-28 Oracle CRM Application Foundation API Reference Guide

Page 231: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

The following table describes the OUT parameters associated with this API.

4.3 Package JTF_TASKS_ASSIGNMENTS_PUBThe Task Assignment APIs contains the following APIs:

■ Create_Task_Assignment

■ Update_Task_Assignment

■ Delete_Task_Assignment

4.3.1 Data Structure SpecificationsThe following data structure is used in the JTF_TASKS_ASSIGNMENTS_PUB API.

4.3.1.1 Task Assignments Record TypeThe JTF_TASK_ASSIGNMENTS_REC creates the assignment details for a given task.

TYPE task_assignments_rec IS RECORD ( task_assignment_id number, object_version_number number, task_id number, resource_type_code varchar2(30), resource_id number, assignment_status_id number, actual_effort number,

p_delete_future_recurrences

VARCHAR2 No Used for recurring tasks. If the value of the parameter is set to: fnd_api.g_true, then all the future recurring tasks are deleted.

Table 4–9 Delete_Task OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 4–8 Delete_Task IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-29

Page 232: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

resource_territory_id number, actual_effort_uom varchar2(3), schedule_flag varchar2(1), alarm_type_code varchar2(30), alarm_contact varchar2(200), shift_construct_id number, sched_travel_distance number, sched_travel_duration number, sched_travel_duration_uom varchar2(3), actual_travel_distance number, actual_travel_duration number, actual_travel_duration_uom varchar2(3), actual_start_date date, actual_end_date date, palm_flag varchar2(1), wince_flag varchar2(1), laptop_flag varchar2(1), device1_flag varchar2(1), device2_flag varchar2(1), device3_flag varchar2(1), attribute1 varchar2(150), attribute2 varchar2(150), attribute3 varchar2(150), attribute4 varchar2(150), attribute5 varchar2(150), attribute6 varchar2(150), attribute7 varchar2(150), attribute8 varchar2(150), attribute9 varchar2(150), attribute10 varchar2(150), attribute11 varchar2(150), attribute12 varchar2(150), attribute13 varchar2(150), attribute14 varchar2(150), attribute15 varchar2(150), attribute_category varchar2(30), show_on_calendar varchar2(1), category_id number );

4.3.2 Create_Task_AssignmentThis procedure creates a task assignment for a given task with the following specifications. Each task has a single owner, however, the task can have multiple

4-30 Oracle CRM Application Foundation API Reference Guide

Page 233: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

assignees. For each resource assigned to the task, the actual effort can be specified. The task identifier or the task number for which the assignments are being created must be specified.

PROCEDURE create_task_assignment( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_task_assignment_id in number default null, p_task_id in number default null, p_task_number in varchar2 default null, p_task_name in varchar2, default null, p_resource_type_code in varchar2, p_resource_id in number, p_resource_name in varchar2 default null, p_actual_effort in number default null, p_actual_effort_uom in varchar2 default null, p_schedule_flag in varchar2 default null, p_alarm_type_code in varchar2 default null, p_alarm_contact in varchar2 default null, p_sched_travel_distance in number default null, p_sched_travel_duration in number default null, p_sched_travel_duration_uom in varchar2 default null, p_actual_travel_distance in number default null, p_actual_travel_duration in number default null, p_actual_travel_duration_uom in varchar2 default null, p_actual_start_date in date default null, p_actual_end_date in date default null, p_palm_flag in varchar2 default null, p_wince_flag in varchar2 default null, p_laptop_flag in varchar2 default null, p_device1_flag in varchar2 default null, p_device2_flag in varchar2 default null, p_device3_flag in varchar2 default null, p_resource_territory_id in number, default null, p_assignment_status_id in number, p_shift_construct_id in number default null, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, x_task_assignment_id out number, p_attribute1 in varchar2 default null, p_attribute2 in varchar2 default null, p_attribute3 in varchar2 default null,

Task Manager Public APIs 4-31

Page 234: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

p_attribute4 in varchar2 default null, p_attribute5 in varchar2 default null, p_attribute6 in varchar2 default null, p_attribute7 in varchar2 default null, p_attribute8 in varchar2 default null, p_attribute9 in varchar2 default null, p_attribute10 in varchar2 default null, p_attribute11 in varchar2 default null, p_attribute12 in varchar2 default null, p_attribute13 in varchar2 default null, p_attribute14 in varchar2 default null, p_attribute15 in varchar2 default null, p_attribute_category in varchar2 default null p_show_on_calendar in varchar2 default jtf_task_utl.g_yes_char, p_category_id in number default null, p_enable_workflow in varchar2, p_abort_workflow in varchar2);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–10 Create_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_task_assignment_id

NUMBER Yes For internal use only.

p_task_id NUMBER Yes The is the unique task identifier (Primary Key).

p_task_number VARCHAR2 No This defines the task number.

See Note: 1 on page 4-3.

4-32 Oracle CRM Application Foundation API Reference Guide

Page 235: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

p_task_name VARCHAR2 No This defines the task name.

p_resource_type_code

VARCHAR2 Yes Assignee type of the task.

(Foreign Key to JTF_OBJECTS_VL for a object with a usage of “Resources”).

p_resource_id NUMBER Yes Assignee of the task.

Resource identifier of the task owner.(Foreign Key to JTF_RS_RESOURCE_EXTNS_VL, JTF_RS_GROUPS_VL, JTF_RS_TEAMS_VL depending on the value of resource_type_code).

p_resource_name VARCHAR2 No This defines the resource name. Not supported.

p_actual_effort NUMBER No Actual amount of effort spent on a task by the assignees.

p_actual_effort_uom

VARCHAR2 No Unit of measure for actual work.

See Note: 5 on page 4-3.

p_schedule_flag VARCHAR2 No Indicates whether the resource should be scheduled by the Scheduler.

The value must be Y, N, or NULL.

p_alarm_type_code

VARCHAR2 No A lookup code that indicates how alarms should be sent to the resource. For example, e-mail, pager, phone. Not supported.

p_alarm_contact VARCHAR2 No Contact information for sending alarms. This field may store e-mail address, pager number, or phone number. Not supported.

p_sched_travel_distance

NUMBER No Scheduled travel distance. Not supported.

p_sched_travel_duration

NUMBER No Scheduled travel duration. Not supported.

p_sched_travel_duration_uom

VARCHAR2 No Unit of measure for scheduled travel duration. Not supported.

p_actual_travel_distance

NUMBER No Actual travel duration. Not supported.

Table 4–10 Create_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-33

Page 236: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

p_actual_travel_duration

NUMBER No Actual travel duration. Not supported.

p_actual_travel_duration_uom

VARCHAR2 No Unit of measure for actual travel duration. Not supported.

p_actual_start_date

DATE No This defines the actual start date.

p_actual_end_date

DATE No This defines the actual end date.

p_palm_flag VARCHAR2 No Used by mobile devices. Not supported.

p_wince_flag VARCHAR2 No Used by mobile devices. Not supported.

p_laptop_flag VARCHAR2 No Used by mobile devices. Not supported.

p_device1_flag VARCHAR2 No Used by mobile devices. Not supported.

p_device2_flag VARCHAR2 No Used by mobile devices. Not supported.

p_device3_flag VARCHAR2 No Used by mobile devices. Not supported.

p_resource_territory_id

NUMBER No Currently not supported.

p_assignment_status_id

NUMBER No Status identifier of the assignee.

(Foreign Key to JTF_TASK_STATUSES_VL).

p_shift_construct_id

NUMBER No Shift construct identifier for the assignment.

p_attribute1 VARCHAR2 No Descriptive flexfield segment column.

p_attribute2 VARCHAR2 No Descriptive flexfield segment column.

p_attribute3 VARCHAR2 No Descriptive flexfield segment column.

p_attribute4 VARCHAR2 No Descriptive flexfield segment column.

p_attribute5 VARCHAR2 No Descriptive flexfield segment column.

p_attribute6 VARCHAR2 No Descriptive flexfield segment column.

p_attribute7 VARCHAR2 No Descriptive flexfield segment column.

p_attribute8 VARCHAR2 No Descriptive flexfield segment column.

p_attribute9 VARCHAR2 No Descriptive flexfield segment column.

Table 4–10 Create_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

4-34 Oracle CRM Application Foundation API Reference Guide

Page 237: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

The following table describes the OUT parameters associated with this API.

p_attribute10 VARCHAR2 No Descriptive flexfield segment column.

p_attribute11 VARCHAR2 No Descriptive flexfield segment column.

p_attribute12 VARCHAR2 No Descriptive flexfield segment column.

p_attribute13 VARCHAR2 No Descriptive flexfield segment column.

p_attribute14 VARCHAR2 No Descriptive flexfield segment column.

p_attribute15 VARCHAR2 No Descriptive flexfield segment column.

p_attribute_category

VARCHAR2 No Descriptive flexfield structure defining column.

p_show_on_calendar

VARCHAR2 No Displays Tasks on the HTML Calendar.Checks if the Value is Y or N.

p_category_id NUMBER No This defines the task category ID.

p_enable_workflow

VARCHAR2 No Determines whether or not to send automatic notifications from the application. Checks if the value is Y or N.

p_abort_workflow

VARCHAR2 No Determines whether or not to abort the previous Workflow process before starting the next one. Checks if the value is Y or N.

Table 4–11 Create_Task_Assignment OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_task_assignment_id

NUMBER This is the unique task assignment identifier.

Table 4–10 Create_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-35

Page 238: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

4.3.3 Update_Task_AssignmentThis procedure updates a task assignment for a given task. The resource_ type_code parameter indicates the type of resource. Resource_id indicates an actual identifier. For each resource assigned to the task, the actual effort can be specified. The task assignment identifier must be specified.

Procedure Specification PROCEDURE update_task_assignment( p_api_version in number, p_object_version_number in out number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_task_assignment_id in number, p_task_id in number default fnd_api.g_miss_num, p_task_number in varchar2 default fnd_api.g_miss_char, p_task_name in varchar2 default fnd_api.g_miss_char, p_resource_type_code in varchar2 default fnd_api.g_miss_char, p_resource_id in number default fnd_api.g_miss_num, p_resource_name in varchar2 default fnd_api.g_miss_char, p_actual_effort in number default fnd_api.g_miss_num, p_actual_effort_uom in varchar2 default fnd_api.g_miss_char, p_schedule_flag in varchar2 default fnd_api.g_miss_char, p_alarm_type_code in varchar2 default fnd_api.g_miss_char, p_alarm_contact in varchar2 default fnd_api.g_miss_char, p_sched_travel_distance in number default fnd_api.g_miss_num, p_sched_travel_duration in number default fnd_api.g_miss_num, p_sched_travel_duration_uom in varchar2 default fnd_api.g_miss_char, p_actual_travel_distance in number default fnd_api.g_miss_num, p_actual_travel_duration in number default fnd_api.g_miss_num, p_actual_travel_duration_uom in varchar2 default fnd_api.g_miss_char, p_actual_start_date in date default fnd_api.g_miss_date, p_actual_end_date in date default fnd_api.g_miss_date, p_palm_flag in varchar2 default fnd_api.g_miss_char, p_wince_flag in varchar2 default fnd_api.g_miss_char, p_laptop_flag in varchar2 default fnd_api.g_miss_char, p_device1_flag in varchar2 default fnd_api.g_miss_char, p_device2_flag in varchar2 default fnd_api.g_miss_char, p_device3_flag in varchar2 default fnd_api.g_miss_char, p_resource_territory_id in number default fnd_api.g_miss_num, p_assignment_status_id in number default fnd_api.g_miss_num, p_shift_construct_id in number default fnd_api.g_miss_num, x_return_status out varchar2,

4-36 Oracle CRM Application Foundation API Reference Guide

Page 239: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

x_msg_count out number, x_msg_data out varchar2, p_attribute1 in varchar2 default jtf_task_utl.g_miss_char, p_attribute2 in varchar2 default jtf_task_utl.g_miss_char, p_attribute3 in varchar2 default jtf_task_utl.g_miss_char, p_attribute4 in varchar2 default jtf_task_utl.g_miss_char, p_attribute5 in varchar2 default jtf_task_utl.g_miss_char, p_attribute6 in varchar2 default jtf_task_utl.g_miss_char, p_attribute7 in varchar2 default jtf_task_utl.g_miss_char, p_attribute8 in varchar2 default jtf_task_utl.g_miss_char, p_attribute9 in varchar2 default jtf_task_utl.g_miss_char, p_attribute10 in varchar2 default jtf_task_utl.g_miss_char, p_attribute11 in varchar2 default jtf_task_utl.g_miss_char, p_attribute12 in varchar2 default jtf_task_utl.g_miss_char, p_attribute13 in varchar2 default jtf_task_utl.g_miss_char, p_attribute14 in varchar2 default jtf_task_utl.g_miss_char, p_attribute15 in varchar2 default jtf_task_utl.g_miss_char, p_attribute_category in varchar2 default jtf_task_utl.g_miss_char p_show_on_calendar in varchar2 default jtf_task_utl.g_miss_char, p_category_id in number default jtf_task_utl.g_miss_number, p_enable_workflow in varchar2, p_abort_workflow in varchar2 );

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–12 Update_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_object_version_number

NUMBER Yes This parameter is for internal use only. Do not modify in any way.

Task Manager Public APIs 4-37

Page 240: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

p_task_assignment_id

NUMBER No This is the unique task assignment identifier.

p_task_id NUMBER No This is the unique task identifier (Primary Key).

p_task_number VARCHAR2 No This defines the task number.

p_task_name VARCHAR2 No This defines the task name.

p_resource_type_code

VARCHAR2 No This is the resource type identifier.

p_resource_id NUMBER No This is the resource identifier.

p_resource_name VARCHAR2 No This defines the resource name. Not supported.

p_actual_effort NUMBER No The actual amount of effort spent on a task by all assignees.

p_actual_effort_uom

VARCHAR2 No The unit of measure for actual work.

See Note: 5 on page 4-3.

p_schedule_flag VARCHAR2 No Indicates whether the resource should be scheduled by the Scheduler.

p_alarm_type_code

VARCHAR2 No A lookup code that indicates how alarms should be sent to the resource. For example, e-mail, pager, phone.

p_alarm_contact VARCHAR2 No Contact information for sending alarms. This field may store an e-mail address, pager number, or phone number.

p_sched_travel_distance

NUMBER No This defines the scheduled travel distance.

p_sched_travel_duration

NUMBER No This defines the scheduled travel duration.

p_sched_travel_duration_uom

VARCHAR2 No This defines the unit of measure for scheduled travel duration.

p_actual_travel_distance

NUMBER No This defines the actual travel duration.

p_actual_travel_duration

NUMBER No This defines the actual travel duration.

Table 4–12 Update_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

4-38 Oracle CRM Application Foundation API Reference Guide

Page 241: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

p_actual_travel_duration_uom

VARCHAR2 No This defines the unit of measure for actual travel duration.

p_actual_start_date

DATE No This defines the actual start date.

p_actual_end_date

DATE No This defines the actual end date.

p_palm_flag VARCHAR2 No Used by mobile devices.

p_wince_flag VARCHAR2 No Used by mobile devices.

p_laptop_flag VARCHAR2 No Used by mobile devices.

p_device1_flag VARCHAR2 No Used by mobile devices.

p_device2_flag VARCHAR2 No Used by mobile devices.

p_device3_flag VARCHAR2 No Used by mobile devices.

p_resource_territory_id

NUMBER No Currently not supported.

p_assignment_status_id

NUMBER No The status identifier of the assignee.

p_shift_construct_id

NUMBER No The shift construct identifier for the assignment.

p_attribute1 VARCHAR2 No Descriptive flexfield segment column.

p_attribute2 VARCHAR2 No Descriptive flexfield segment column.

p_attribute3 VARCHAR2 No Descriptive flexfield segment column.

p_attribute4 VARCHAR2 No Descriptive flexfield segment column.

p_attribute5 VARCHAR2 No Descriptive flexfield segment column.

p_attribute6 VARCHAR2 No Descriptive flexfield segment column.

p_attribute7 VARCHAR2 No Descriptive flexfield segment column.

p_attribute8 VARCHAR2 No Descriptive flexfield segment column.

p_attribute9 VARCHAR2 No Descriptive flexfield segment column.

p_attribute10 VARCHAR2 No Descriptive flexfield segment column.

p_attribute11 VARCHAR2 No Descriptive flexfield segment column.

Table 4–12 Update_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-39

Page 242: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

The following table describes the OUT parameters associated with this API.

4.3.4 Delete_Task_AssignmentThis procedure deletes a task assignment for a given task. The task assignment must be specified.

Procedure Specification PROCEDURE delete_task_assignment(

p_attribute12 VARCHAR2 No Descriptive flexfield segment column.

p_attribute13 VARCHAR2 No Descriptive flexfield segment column.

p_attribute14 VARCHAR2 No Descriptive flexfield segment column.

p_attribute15 VARCHAR2 No Descriptive flexfield segment column.

p_attribute_category

VARCHAR2 No Descriptive flexfield structure defining column.

p_show_on_calendar

VARCHAR2 No Displays Tasks on the HTML Calendar.Checks if the Value is Y or N.

p_category_id NUMBER No This defines the task category ID.

p_enable_workflow

VARCHAR2 No Determines whether or not to send automatic notifications from the application. Checks if the value is Y or N.

p_abort_workflow

VARCHAR2 No Determines whether or not to abort the previous Workflow process before starting the next one. Checks if the value is Y or N.

Table 4–13 Update_Task_Assignment OUT Parameters

Parameter Data Type Descriptions and Validations

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Table 4–12 Update_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

4-40 Oracle CRM Application Foundation API Reference Guide

Page 243: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASKS_ASSIGNMENTS_PUB

p_api_version in number, p_object_version_number in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_task_assignment_id in number, x_return_status out varchar2, x_msg_count out number, x_msg_data out varchar2, p_enable_workflow in varchar2, p_abort_workflow in varchar2 );

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–14 Delete_Task_Assignment IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_object_version_number

NUMBER Yes This parameter is for internal use only. Do not modify in any way.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_task_assignment_id

NUMBER No This is the unique task assignment identifier.

p_enable_workflow

VARCHAR2 No Determines whether or not to send automatic notifications from the application. Checks if the value is Y or N.

p_abort_workflow

VARCHAR2 No Determines whether or not to abort the previous Workflow process before starting the next one. Checks if the value is Y or N.

Task Manager Public APIs 4-41

Page 244: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

The following table describes the OUT parameters associated with this API.

4.4 Package JTF_TASK_REFERENCES_PUBThe JTF_Task_References_Pub package contains the following APIs:

■ Create_References

■ Update_References

■ Delete_References

4.4.1 Data Structure SpecificationsThe following data structure is used in the JTF_TASK_REFERENCES_PUB API.

4.4.1.1 References Record TypeThe REFERENCES_REC creates the reference for a given task.

TYPE references_rec IS RECORD( task_reference_id number, task_id number, object_type_code varchar2(30), object_name varchar2(80), object_id number, object_details varchar2(2000), reference_code varchar2(30), attribute1 varchar2(150), attribute2 varchar2(150), attribute3 varchar2(150), attribute4 varchar2(150), attribute5 varchar2(150), attribute6 varchar2(150), attribute7 varchar2(150), attribute8 varchar2(150),

Table 4–15 Delete_Task_Assignment OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

4-42 Oracle CRM Application Foundation API Reference Guide

Page 245: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

attribute9 varchar2(150), attribute10 varchar2(150), attribute11 varchar2(150), attribute12 varchar2(150), attribute13 varchar2(150), attribute14 varchar2(150), attribute15 varchar2(150), attribute_category varchar2(30), usage varchar2(2000), object_version_number number );

4.4.2 Create_ReferencesThis API establishes references to a task. For example, a task created for a service request can establish reference to an inventory part number using references. The following information applies to this API:

■ Every task is associated with a source. It can also be associated with multiple references.

■ Task_id or task_number must be passed.

■ If the API executes successfully, then the output parameter is task_reference_id.

Procedure Specification PROCEDURE create_references( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_task_id in number default null, p_task_number in varchar2 default null, p_object_type_code in varchar2 default null, p_object_name in varchar2, p_object_id in number, p_object_details in varchar2 default null, p_reference_code in varchar2 default null, p_usage in varchar2 default null, x_return_status out varchar2, x_msg_data out varchar2, x_msg_count out number, x_task_reference_id out number, p_attribute1 in varchar2 default null, p_attribute2 in varchar2 default null,

Task Manager Public APIs 4-43

Page 246: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

p_attribute3 in varchar2 default null, p_attribute4 in varchar2 default null, p_attribute5 in varchar2 default null, p_attribute6 in varchar2 default null, p_attribute7 in varchar2 default null, p_attribute8 in varchar2 default null, p_attribute9 in varchar2 default null, p_attribute10 in varchar2 default null, p_attribute11 in varchar2 default null, p_attribute12 in varchar2 default null, p_attribute13 in varchar2 default null, p_attribute14 in varchar2 default null, p_attribute15 in varchar2 default null, p_attribute_category in varchar2 default null);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–16 Create_References IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_task_id NUMBER Yes This is the unique task identifier (Primary Key).

p_task_number VARCHAR2 No This defines the task number.

p_object_type_code

VARCHAR2 No Reference object type code (Foreign Key to JTF_OBJECTS_VL for objects with a usage of “Task”.)

4-44 Oracle CRM Application Foundation API Reference Guide

Page 247: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

p_object_name VARCHAR2 No This is the name of reference object.

Validated from the table registered in JTF_OBJECTS_VL for the object_type_code.

p_object_id NUMBER No This defines the internal identifier of reference object.

Validated from the table registered in jtf_objects_vl for the object_type_code.

p_object_details VARCHAR2 No Additional information of the reference object.

p_reference_code VARCHAR2 No Lookup code indicating the context of the reference.

Not supported and not used in the context of the Tasks module.

p_usage VARCHAR2 No User comment on the usage of the reference.

p_attribute1 VARCHAR2 No Descriptive flexfield segment column.

p_attribute2 VARCHAR2 No Descriptive flexfield segment column.

p_attribute3 VARCHAR2 No Descriptive flexfield segment column.

p_attribute4 VARCHAR2 No Descriptive flexfield segment column.

p_attribute5 VARCHAR2 No Descriptive flexfield segment column.

p_attribute6 VARCHAR2 No Descriptive flexfield segment column.

p_attribute7 VARCHAR2 No Descriptive flexfield segment column.

p_attribute8 VARCHAR2 No Descriptive flexfield segment column.

p_attribute9 VARCHAR2 No Descriptive flexfield segment column.

p_attribute10 VARCHAR2 No Descriptive flexfield segment column.

p_attribute11 VARCHAR2 No Descriptive flexfield segment column.

p_attribute12 VARCHAR2 No Descriptive flexfield segment column.

p_attribute13 VARCHAR2 No Descriptive flexfield segment column.

p_attribute14 VARCHAR2 No Descriptive flexfield segment column.

p_attribute15 VARCHAR2 No Descriptive flexfield segment column.

Table 4–16 Create_References IN Parameters

Parameter Data Type Required Descriptions and Validations

Task Manager Public APIs 4-45

Page 248: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

The following table describes the OUT parameters associated with this API.

4.4.3 Update_ReferencesThis API is used to update references to a task.

Procedure Specification PROCEDURE update_references( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_object_version_number in out number, p_task_reference_id in number, p_object_type_code in varchar2 default fnd_api.g_miss_char, p_object_name in varchar2 default fnd_api.g_miss_char, p_object_id in number default fnd_api.g_miss_num, p_object_details in varchar2 default fnd_api.g_miss_char, p_reference_code in varchar2 default fnd_api.g_miss_char, p_usage in varchar2 default fnd_api.g_miss_char, x_return_status out varchar2, x_msg_data out varchar2, x_msg_count out number,

p_attribute_category

VARCHAR2 No Descriptive flexfield structure defining column.

Table 4–17 Create_References OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_task_reference_id

NUMBER This is the unique task reference identifier.

Note: Task_reference_id must be an input parameter.

Table 4–16 Create_References IN Parameters

Parameter Data Type Required Descriptions and Validations

4-46 Oracle CRM Application Foundation API Reference Guide

Page 249: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

p_attribute1 in varchar2 default jtf_task_utl.g_miss_char, p_attribute2 in varchar2 default jtf_task_utl.g_miss_char, p_attribute3 in varchar2 default jtf_task_utl.g_miss_char, p_attribute4 in varchar2 default jtf_task_utl.g_miss_char, p_attribute5 in varchar2 default jtf_task_utl.g_miss_char, p_attribute6 in varchar2 default jtf_task_utl.g_miss_char, p_attribute7 in varchar2 default jtf_task_utl.g_miss_char, p_attribute8 in varchar2 default jtf_task_utl.g_miss_char, p_attribute9 in varchar2 default jtf_task_utl.g_miss_char, p_attribute10 in varchar2 default jtf_task_utl.g_miss_char, p_attribute11 in varchar2 default jtf_task_utl.g_miss_char, p_attribute12 in varchar2 default jtf_task_utl.g_miss_char, p_attribute13 in varchar2 default jtf_task_utl.g_miss_char, p_attribute14 in varchar2 default jtf_task_utl.g_miss_char, p_attribute15 in varchar2 default jtf_task_utl.g_miss_char, p_attribute_category in varchar2 default jtf_task_utl.g_miss_char);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–18 Update_References IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_object_version_number

NUMBER Yes This parameter is for internal use only. Do not modify in any way.

p_task_reference_id

NUMBER Yes Unique task reference identifier.

p_object_type_code

VARCHAR2 No Reference object type code (Foreign Key to JTF_TASK_OBJECT_TYPES).

Task Manager Public APIs 4-47

Page 250: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

The following table describes the OUT parameters associated with this API.

p_object_name VARCHAR2 No This defines the name of the reference object.

p_object_id NUMBER No This is the internal identifier of reference object.

p_object_details VARCHAR2 No This provides additional information for the reference object.

p_reference_code VARCHAR2 No Lookup code indicating the context of the reference.

p_usage VARCHAR2 No User comment on the usage of the reference.

p_attribute1 VARCHAR2 No Descriptive flexfield segment column.

p_attribute2 VARCHAR2 No Descriptive flexfield segment column.

p_attribute3 VARCHAR2 No Descriptive flexfield segment column.

p_attribute4 VARCHAR2 No Descriptive flexfield segment column.

p_attribute5 VARCHAR2 No Descriptive flexfield segment column.

p_attribute6 VARCHAR2 No Descriptive flexfield segment column.

p_attribute7 VARCHAR2 No Descriptive flexfield segment column.

p_attribute8 VARCHAR2 No Descriptive flexfield segment column.

p_attribute9 VARCHAR2 No Descriptive flexfield segment column.

p_attribute10 VARCHAR2 No Descriptive flexfield segment column.

p_attribute11 VARCHAR2 No Descriptive flexfield segment column.

p_attribute12 VARCHAR2 No Descriptive flexfield segment column.

p_attribute13 VARCHAR2 No Descriptive flexfield segment column.

p_attribute14 VARCHAR2 No Descriptive flexfield segment column.

p_attribute15 VARCHAR2 No Descriptive flexfield segment column.

p_attribute_category

VARCHAR2 No Descriptive flexfield structure defining column.

Table 4–18 Update_References IN Parameters

Parameter Data Type Required Descriptions and Validations

4-48 Oracle CRM Application Foundation API Reference Guide

Page 251: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_TASK_REFERENCES_PUB

4.4.4 Delete_ReferencesThis API is used to delete references to a task.

Procedure SpecificationPROCEDURE delete_references( p_api_version in number, p_init_msg_list in varchar2 default fnd_api.g_false, p_commit in varchar2 default fnd_api.g_false, p_object_version_number in number, p_task_reference_id in number default null, x_return_status out varchar2, x_msg_data out varchar2, x_msg_count out number);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 4–19 Update_References OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Note: Task_reference_id must be an input parameter.

Table 4–20 Delete_References IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

Task Manager Public APIs 4-49

Page 252: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

The following table describes the OUT parameters associated with this API.

4.5 Messages and NotificationsThe APIs contained in the Task Manager public packages generate messages and notifications as needed. Some of these messages are common to all of the Task Manager APIs and others are generated by APIs in specific Task Manager packages. Both types of messages are detailed in the following sections.

■ Common Messages

■ JTF_TASK_ASSIGNMENTS_PUB

■ JTF_TASK_REFERENCES_PUB

■ JTF_TASKS_PUB

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_object_version_number

NUMBER Yes This parameter is for internal use only. Do not modify in any way.

p_task_reference_id

NUMBER Yes Unique task reference identifier.

Table 4–21 Delete_References OUT Parameters

Parameter Data Type Descriptions

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Note: It is not required that all status notifications provide a number identifier along with the message, although, in many cases, it is provided.

Table 4–20 Delete_References IN Parameters

Parameter Data Type Required Descriptions and Validations

4-50 Oracle CRM Application Foundation API Reference Guide

Page 253: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

4.5.1 Common Messages The following table lists the messages and notifications generated by many of the APIs contained in Task Manager public packages.

Table 4–22 Common Task API Messages

Number Type Name Text

N/A E JTF_TASK_DISTANCE_UNITS Quantity for p_distance_tag is invalid.

N/A E JTF_TASK_INVALID_CONTACT Contacts details are invalid.

N/A E JTF_TASK_INVALID_DEFAULT_OWNER

Default owner for the task is not setup correctly.

N/A E JTF_TASK_INVALID_PHONE_ID Phone details are invalid. (Contact point identifier = p_phone_id).

N/A E JTF_TASK_MISSING_CONTACT Contact details are missing.

N/A E JTF_TASK_MISSING_PHONE Phone details are missing.

N/A E JTF_TASK_MISSING_USER_MAPPING User is not mapped to a resource.

210000 E JTF_TASK_MISSING_UOM Unit of measure for p_tag should be specified.

210001 E JTF_TASK_INVALID_PRIORITY_ID Task Priority p_task_priority_id is either disabled or invalid.

210002 E JTF_TASK_INVALID_PRIORITY_NAME

Task Priority p_task_priority_name is either disabled or invalid.

210003 E JTF_TASK_INVALID_TYPE_ID Task Type p_task_type_id is either disabled or invalid.

210004 E JTF_TASK_INVALID_UOM Unit of Measure p_uom_code is either disabled or invalid.

210005 E JTF_TASK_INVALID_DEPENDS_CODE

Currency Code p_dependency_code is either disabled or invalid.

210006 E JTF_TASK_INVALID_TEMP_NUMBER Task Template p_task_template_number is invalid.

210008 E JTF_TASK_INVALID_TEMP_ID Task Template p_task_template_id is invalid.

210012 E JTF_TASK_INVALID_CUST_ACCT_ID Customer Account p_cust_account_id is invalid or disabled.

210013 E JTF_TASK_INVALID_PARTY_ID Customer p_party_id is invalid or disabled.

210014 E JTF_TASK_INVALID_PARTY_NUMBER

Customer party_number is invalid or disabled.

Task Manager Public APIs 4-51

Page 254: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

210015 E JTF_TASK_INVALID_SITE_ID Address p_party_site_id is invalid or disabled.

210016 E JTF_TASK_INVALID_SITE_NUMBER Address p_party_site_number is invalid or disabled.

210018 E JTF_TASK_INVALID_FLAG P_flag_name must be Yes or No.

210020 E JTF_TASK_INVALID_DEPENDS_ID Dependency p_dependency_id does not exist.

210021 E JTF_TASK_INVALID_ASSIGNED_NAME

User p_assigned_by_name is invalid or disabled.

210022 E JTF_TASK_INVALID_CURRENCY_CODE

Currency p_currency_code is invalid or disabled.

210023 E JTF_TASK_MISSING_CURRENCY_CODE

P_cost, currency code should be present.

Cause: both cost currency code should be present.

210024 E JTF_TASK_MISSING_COST For p_currency_code, cost should be present. Cause: both cost currency code should be present.

210026 E JTF_TASK_INVALID_TIMEZONE_NAME

Timezone for p_timezone_name is either disabled or invalid.

210027 E JTF_TASK_INVALID_TIMEZONE_ID Timezone for p_timezone_id is either disabled or invalid.

210029 U JTF_TASK_UNKNOWN_ERROR Error text.

210031 E JTF_TASK_INVALID_OBJECT_NAME P_object_type_code p_object_name is either disabled or invalid.

210032 E JTF_TASK_INVALID_OBJECT_CODE P_object_code is either disabled or invalid.

210034 E JTF_TASK_INVALID_QUANTITY Value for p_tag should be greater than 0.

210035 E JTF_TASK_MISSING_QUANTITY Quantity for p_tag should be specified.

210037 E JTF_TASK_INVALID_STATUS_NAME Task status p_task_status_name is either disabled or invalid.

210039 E JTF_TASK_INVALID_TYPE_NAME Task type p_task_type_name is either disabled or invalid.

210041 E JTF_TASK_INVALID_STATUS_ID Status p_task_status_id is either disabled or invalid.

210046 E JTF_TASK_INVALID_DATES P_date_tag start date cannot be greater than p_date_tag end date.

Table 4–22 Common Task API Messages

Number Type Name Text

4-52 Oracle CRM Application Foundation API Reference Guide

Page 255: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

210047 E JTF_TASK_INVALID_SOURCE_DTLS Invalid source object details provided.

210048 E JTF_TASK_INVALID_TEMP_GRP_NAME

Task template group p_task_temp_group_name is either disabled or invalid.

210049 E JTF_TASK_INVALID_TEMP_GRP_ID Task template group p_task_template_group_id is either disabled or invalid.

210051 E JTF_TASK_INVALID_TASK_ID Task p_task_id is invalid.

210052 E JTF_TASK_INVALID_TASK_NUMBER Task number p_task_number is invalid.

210055 E JTF_TASK_MISSING_TASK Task is missing.

210056 E JTF_TASK_INVALID_DATE_TYPE_ID Date type p_date_type_id is invalid.

210065 E JTF_TASK_INVALID_TERR_ID Territory p_terr_id is disabled or invalid.

210066 E JTF_TASK_INVALID_TERR_NAME Territory is disabled or invalid.

210067 E JTF_TASK_INVALID_ESC_DTLS Invalid escalation details.

210068 E JTF_TASK_INVALID_OWNER_ID Owner p_owner_id is invalid.

210069 E JTF_TASK_PARENT_TYPE_CODE Parent task should have the same source document types as the given task.

210069 E JTF_TASK_PARENT_TYPE_CODE Parent task should have the same source document types as the given task.

210070 E JTF_TASK_PARENT Parent task does not have the same source object details as the given task.

210118 E JTF_TASK_MISSING_RETURN_STATUS

Return status from internal API hook is missing.

210120 E JTF_TASK_MISSING_LOOKUP Lookup code (p_lookup_code) is not defined for lookup type p_lookup_type.

Table 4–22 Common Task API Messages

Number Type Name Text

Task Manager Public APIs 4-53

Page 256: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

4.5.2 JTF_TASK_ASSIGNMENTS_PUBThe following table lists the messages and notifications generated by the APIs contained in the JTF_TASK_ASSIGNMENTS_PUB package.

4.5.3 JTF_TASK_REFERENCES_PUBThe following table lists the messages and notifications generated by the APIs contained in the JTF_TASK_REFERENCES_PUB package.

Table 4–23 JTF_TASK_ASSIGNMENTS_PUB API Messages

Number Type Name Text

210029 U JTF_TASK_UNKNOWN_ERROR Error text.

210055 E JTF_TASK_MISSING_TASK Task is missing.

210082 E JTF_TASK_INV_RES_TYP_COD Resource type code is invalid or disabled.

This feature is currently not enabled in the API. This error should never occur.

210080 E JTF_TASK_NULL_RES_ID Resource identifier is missing.

JTF_TASK_MISSING_TASK_STATUS Task status is missing or invalid.

210085 E JTF_TASK_INV_ALA_TYPE Alarm type code is invalid or disabled.

210086 E JTF_TASK_INV_ALA_CON Alarm contact is invalid or disabled.

This feature is currently not enabled in the API. This error should never occur.

210117 E JTF_TASK_RESOURCE_LOCKED Resource is locked or deleted.

210113 E JTF_TASK_NULL_TK_ASS Task assignment is missing.

210114 E JTF_TASK_INV_TK_ASS Task assignment identifier is invalid or missing.

210115 E JTF_TASK_DELETING_TK_ASS Error deleting task assignment.

Table 4–24 JTF_TASK_REFERENCES_PUB API Messages

Number Type Name Text

210025 E JTF_TASK_MISSING_OBJECT_NAME Object name is missing.

210028 E JTF_TASK_MISSING_OBJECT_CODE Source object type code is missing.

210029 U JTF_TASK_UNKNOWN_ERROR Error text.

4-54 Oracle CRM Application Foundation API Reference Guide

Page 257: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

4.5.4 JTF_TASKS_PUBThe following table lists the messages and notifications generated by the APIs contained in the JTF_TASKS_PUB package.

210031 E JTF_TASK_INVALID_OBJECT_NAME Object code object name is either disabled or invalid.

210032 E JTF_TASK_INVALID_OBJECT_CODE Object code is either disabled or invalid.

210038 E JTF_TASK_INVALID_REFER Task reference identifier is invalid.

210042 E JTF_TASK_MISSING_REFER Task reference is missing.

210044 E JTF_TASK_INVALID_OBJECT_ID Object identifier is invalid.

210050 E JTF_TASK_INVALID_REFER_CODE Reference code is either disabled or invalid.

210053 E JTF_TASK_INVALID_REFER_DETAILS Invalid reference details.

210055 E JTF_TASK_MISSING_TASK Task is missing.

210117 E JTF_TASK_RESOURCE_LOCKED Resource is locked or deleted.

Table 4–25 JTF_TASK_ API Messages

Number Type Name Text

21002 E JTF_TASK_INVALID_PRIORITY_NAME

Task priority is either disabled or invalid.

210007 E JTF_TASK_MISSING_TEMP_GRP Task template group is missing.

210011 E JTF_TASK_INVALID_CUST_ACCT_NUM

Customer account number is disabled or invalid.

210021 E JTF_TASK_INVALID_ASSIGNED_NAME

User assigned by name is invalid or disabled.

210029 U JTF_TASK_UNKNOWN_ERROR Returns the unhandled error text.

210036 E JTF_TASK_MISSING_STATUS Task status is missing.

210040 E JTF_TASK_MISSING_TYPE Task type is missing.

E JTF_TASK_INVALID_CUST_ACCT_NUM

The customer account number is not valid.

Table 4–24 JTF_TASK_REFERENCES_PUB API Messages

Number Type Name Text

Task Manager Public APIs 4-55

Page 258: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

4.6 Sample CodeThis section contains SQL scripts that call the Task Manager public APIs stored in the following packages and insert values as required:

210046 E JTF_TASK_INVALID_DATES Date start date cannot be greater than date end date.

210051 E JTF_TASK_INVALID_TASK_ID Task identifier is invalid.

210052 E JTF_TASK_INVALID_TASK_NUMBER Task number is invalid.

210055 E JTF_TASK_MISSING_TASK Task is missing.

210060 E JTF_TASK_CONVERTING_NUMBER Error converting template number to task number.

210098 E JTF_TK_INV_QRY_NXT Invalid value query or next code can be Q or N.

210099 E JTF_TK_INV_SHOW_ALL Invalid value show all can be Y or N.

210100 E JTF_TK_NULL_STRT_PTR Start record number cannot be NULL.

210101 E JTF_TK_NULL_REC_WANT Number of records wanted cannot be NULL.

210103 E JTF_TASK_INV_TK_NAME Invalid task name.

210104 E JTF_TK_OBJECT_TYPE_ID_RQD Both object identifier and object type code are required if one is present.

210105 E JTF_TK_QRY_NXT_INV_QRY_TYP Invalid query type.

210106 E JTF_TK_QRY_NXT_INV_DT_TYPE Invalid date type.

210107 E JTF_TK_QRY_NXT_NUL_ASGND_BY Assigned by identifier is NULL.

210108 E JTF_TK_QRY_NXT_NUL_ Owner identifier or type is NULL.

210109 E JTF_TK_EXP_FILE_NAME_NULL Output file name cannot be NULL.

210110 E JTF_TK_EXP_TABLE_EMPTY Task table input table is NULL.

210111 E JTF_TK_QRY_NXT_INV_STRT_END_DT

Invalid value for start or end date query parameter.

210112 E JTF_TK_NO_DATE Created date field for current task identifier is NULL.

210117 E JTF_TASK_RESOURCE_LOCKED Resource is locked or deleted.

Table 4–25 JTF_TASK_ API Messages

Number Type Name Text

4-56 Oracle CRM Application Foundation API Reference Guide

Page 259: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ JTF_TASKS_PUB

■ JTF_TASK_ASSIGNMENTS_PUB

■ JTF_TASK_REFERENCES_PUB

4.6.1 Package JTF_TASKS_PUBThe SQL scripts in this section create a task by calling the Create_Task API contained in the JTF_TASKS_PUB package and by providing them with the required values.

Create_TaskThis script calls the Create_Task API and creates tasks with the following information.

set serveroutput on

accept p_user_name prompt 'Enter user name : 'accept p_task_name prompt 'Enter task name : 'accept p_task_type prompt 'Enter task type name (Default=Meeting): 'accept p_priority prompt 'Enter priority name (Default=Medium) : 'accept p_task_status prompt 'Enter task status name (Default=Open) : 'accept p_show_on_cal prompt 'Enter Y if you want to show this task on calendar view (Default=N) : '

Table 4–26 Create_Task API Sample Code Variables

Variable Description

p_user_name Login user name is entered by a user.

p_task_name Task name is entered by a user.

p_task_type The type of task is entered by a user, such as "Meeting", or "Lunch".

p_task_priority Task priority is entered by a user, such as "High", "Medium", or "Low".

p_task_status Task status is entered by a user, such as "Open".

p_show_on_cal A flag used to determine if the task will be shown in the calendar view.

p_start_date The planned start date is entered by a user.

p_end_date The planned end date is entered by a user.

Task Manager Public APIs 4-57

Page 260: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

accept p_start_date prompt 'Enter task start date (Format=MMDDYYYY HH24MI) : 'accept p_end_date prompt 'Enter task end date (Format=MMDDYYYY HH24MI) : '

declare l_user_name fnd_user.user_name%TYPE := upper('&p_user_name'); l_task_name jtf_tasks_tl.task_name%TYPE := '&p_task_name'; l_task_type jtf_task_types_tl.name%TYPE := NVL('&p_task_type_name','Meeting'); l_task_priority jtf_task_priorities_tl.name%TYPE := NVL('&p_priority', 'Medium'); l_task_status jtf_task_statuses_tl.name%TYPE := NVL('&p_task_status','Open'); l_show_on_cal jtf_task_all_assignments.show_on_calendar%TYPE := NVL(upper('&p_show_on_cal'),'N'); l_planned_start_date DATE := NVL(TO_DATE('&p_start_date','MMDDYYYY HH24MI'),SYSDATE); l_planned_end_date DATE := NVL(TO_DATE('&p_end_date','MMDDYYYY HH24MI'),SYSDATE);

cursor c_login_user (b_user_name VARCHAR2) is select user_id from fnd_user where user_name = b_user_name; cursor c_owner (b_user_id NUMBER) is select resource_id from jtf_rs_emp_dtls_vl r where r.user_id = b_user_id; cursor c_task_type (b_name VARCHAR2) is select task_type_id from jtf_task_types_tl where name = b_name; cursor c_task_status (b_status VARCHAR2) is select task_status_id from jtf_task_statuses_vl where name = b_status and task_status_flag = 'Y';

cursor c_task_priority (b_priority VARCHAR2) is select task_priority_id from jtf_task_priorities_tl where name = b_priority;

l_user_id NUMBER; l_resource_id NUMBER; l_task_type_id NUMBER; l_task_status_id NUMBER; l_task_priority_id NUMBER;

4-58 Oracle CRM Application Foundation API Reference Guide

Page 261: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_task_id NUMBER;

l_return_status VARCHAR2(1); l_msg_count NUMBER; l_msg_data VARCHAR2(1000); begin dbms_output.put_line('-------------------------------------------'); open c_login_user(l_user_name); fetch c_login_user into l_user_id; if c_login_user%NOTFOUND then close c_login_user; raise_application_error(-20000,'User name '||l_user_name||' is not found.'); end if; close c_login_user; dbms_output.put_line('User Id : '||l_user_id); open c_owner (l_user_id); fetch c_owner into l_resource_id; if c_owner%NOTFOUND then close c_owner; raise_application_error(-20000,'Resource for the user name '||l_user_name||' is not found.'); end if; close c_owner; dbms_output.put_line('Owner Resource Id : '||l_resource_id); open c_task_type (l_task_type); fetch c_task_type into l_task_type_id; if c_task_type%NOTFOUND then close c_task_type; raise_application_error(-20000,'Task type '||l_task_type||' is not found.'); end if; close c_task_type; open c_task_status(l_task_status); fetch c_task_status into l_task_status_id; if c_task_status%NOTFOUND then close c_task_status; raise_application_error(-20000,'Task status '||l_task_status||' is not found.'); end if; close c_task_status;

open c_task_priority(l_task_priority);

Task Manager Public APIs 4-59

Page 262: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

fetch c_task_priority into l_task_priority_id; if c_task_priority%NOTFOUND then close c_task_priority; raise_application_error(-20000,'Task status '||l_task_priority||' is not found.'); end if; close c_task_priority; fnd_global.apps_initialize(l_user_id, 0, 690); jtf_tasks_pub.create_task( p_api_version => 1.0 , p_init_msg_list => fnd_api.g_true, p_commit => fnd_api.g_false, p_task_name => l_task_name, p_task_type_id => l_task_status_id, p_task_status_id => l_task_type_id, p_task_priority_id => l_task_priority_id, p_owner_type_code => 'RS_EMPLOYEE', p_owner_id => l_resource_id, p_show_on_calendar => l_show_on_cal, p_planned_start_date => l_planned_start_date, p_planned_end_date => l_planned_end_date, p_date_selected => 'P', x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_task_id => l_task_id ); IF l_return_status <> fnd_api.g_ret_sts_success THEN IF l_msg_count > 0 THEN l_msg_data := NULL; FOR i IN 1..l_msg_count LOOP l_msg_data := l_msg_data ||' '||fnd_msg_pub.get(1, 'F'); END LOOP; fnd_message.set_encoded(l_msg_data); dbms_output.put_line(l_msg_data); END IF; ROLLBACK; ELSE dbms_output.put_line('Task Id = '||l_task_id); dbms_output.put_line('Return Status = '||l_return_status); COMMIT; END IF;end;

4-60 Oracle CRM Application Foundation API Reference Guide

Page 263: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

/

4.6.2 Package JTF_TASK_ASSIGNMENTS_PUBThe SQL scripts in this section create a task assignment for a specific task by calling the Create_Task_Assignment API contained in the JTF_TASK_ASSIGNMENTS_PUB package and by providing them with the required values.

Create_Task_AssignmentThis script calls the Create_Task_Assignment API and adds an assignee with the following information.

set serveroutput on

accept p_user_name prompt 'Enter user name : 'accept p_task_id prompt 'Enter task id : 'accept p_emp_resource_id prompt 'Enter resource id for an employee : 'accept p_show_on_cal prompt 'Do you want to show this task on calendar view ? (Y or N) : 'accept p_assignment_status prompt 'Enter Assignment status name : '

declare l_user_name fnd_user.user_name%TYPE := upper('&p_user_name'); l_task_id jtf_tasks_b.task_id%TYPE := '&p_task_id'; l_emp_resource_id jtf_rs_emp_dtls_vl.resource_id%TYPE := '&p_emp_resource_id'; l_show_on_cal jtf_task_all_assignments.show_on_calendar%TYPE := NVL(upper('&p_show_on_cal'),'N'); l_assignment_status jtf_task_statuses_vl.name%TYPE := NVL('&p_assignment_status', 'Accepted');

Table 4–27 Create_Task_Assignment API Sample Code Variables

Variable Description

p_user_name Login user name is entered by a user.

p_task_id Task ID is entered by a user.

p_emp_resource_id Resource ID for an employee is entered by a user.

p_show_on_cal A flag used to determine if the task will be shown in the calendar view.

p_assignment_status Task assignment status is entered by a user.

Task Manager Public APIs 4-61

Page 264: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

cursor c_login_user (b_user_name VARCHAR2) is select user_id from fnd_user where user_name = b_user_name;

cursor c_assignee is select resource_id from jtf_rs_emp_dtls_vl r where r.resource_id = l_emp_resource_id; cursor c_assignment_status (b_status VARCHAR2) is select task_status_id from jtf_task_statuses_vl where name = b_status and assignment_status_flag = 'Y';

l_user_id NUMBER; l_assignee_id NUMBER; l_assignment_status_id NUMBER; l_task_assignment_id NUMBER;

l_return_status VARCHAR2(1); l_msg_count NUMBER; l_msg_data VARCHAR2(1000); begin dbms_output.put_line('-------------------------------------------'); open c_login_user(l_user_name); fetch c_login_user into l_user_id; if c_login_user%NOTFOUND then close c_login_user; raise_application_error(-20000,'User name '||l_user_name||' is not found.'); end if; close c_login_user; dbms_output.put_line('User Id : '||l_user_id);

open c_assignee; fetch c_assignee into l_assignee_id; if c_assignee%NOTFOUND then close c_assignee; raise_application_error(-20000,'Employee resource id '||l_emp_resource_id||' is not found.'); end if; close c_assignee;

4-62 Oracle CRM Application Foundation API Reference Guide

Page 265: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

open c_assignment_status(l_assignment_status); fetch c_assignment_status into l_assignment_status_id; if c_assignment_status%NOTFOUND then close c_assignment_status; raise_application_error(-20000,'Assignment status '||l_assignment_status||' is not found.'); end if; close c_assignment_status;

fnd_global.apps_initialize(l_user_id, 0, 690); jtf_task_assignments_pub.create_task_assignment( p_api_version => 1.0, p_init_msg_list => fnd_api.g_true, p_commit => fnd_api.g_false, p_task_assignment_id => NULL, p_task_id => l_task_id, p_resource_type_code => 'RS_EMPLOYEE', p_resource_id => l_assignee_id, p_assignment_status_id => l_assignment_status_id, p_show_on_calendar => l_show_on_cal, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_task_assignment_id => l_task_assignment_id ); IF l_return_status <> fnd_api.g_ret_sts_success THEN IF l_msg_count > 0 THEN l_msg_data := NULL; FOR i IN 1..l_msg_count LOOP l_msg_data := l_msg_data ||' '||fnd_msg_pub.get(1, 'F'); END LOOP; fnd_message.set_encoded(l_msg_data); dbms_output.put_line(l_msg_data); END IF; ROLLBACK; ELSE dbms_output.put_line('l_task_assignment_id = '||l_task_assignment_id); dbms_output.put_line('Return Status = '||l_return_status); COMMIT; END IF;end;/

Task Manager Public APIs 4-63

Page 266: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

4.6.3 Package JTF_TASK_REFERENCES_PUBThe SQL scripts in this section create references to a specific task by calling the Create_References API contained in the JTF_TASK_REFERENCES_PUB package and by providing them with the required values.

Create_ReferencesThis script calls the Create_References API and creates a reference with the following information.

set serveroutput on

accept p_user_name prompt 'Enter user name : 'accept p_task_id prompt 'Enter task id : 'accept p_source_object_type prompt 'Enter source object type (e.g. PARTY) : 'accept p_source_object_name prompt 'Enter source object name (Enter party name if object type is PARTY): 'accept p_source_object_id prompt 'Enter source object id (Enter party id if object type is PARTY): '

declare l_user_name fnd_user.user_name%TYPE := upper('&p_user_name'); l_task_id jtf_tasks_b.task_id%TYPE := '&p_task_id'; l_source_object_type jtf_tasks_b.source_object_type_code%TYPE := upper('&p_source_object_type'); l_source_object_name jtf_tasks_b.source_object_name%TYPE := '&p_source_object_name'; l_source_object_id jtf_tasks_b.source_object_id%TYPE := '&p_source_object_id'; cursor c_login_user (b_user_name VARCHAR2) is

Table 4–28 Create_References API Sample Code Variables

Variable Description

p_user_name Login user name is entered by a user.

p_task_id The ID of the task which the reference is added to is entered by a user.

p_source_object_type Source object type is entered by a user, such as "Party".

p_source_object_name Source object name is entered by a user, such as "Business World".

p_source_object_id Source object ID is entered by a user, such as "1001".

4-64 Oracle CRM Application Foundation API Reference Guide

Page 267: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

select user_id from fnd_user where user_name = b_user_name;

l_user_id NUMBER; l_task_reference_id NUMBER; l_return_status VARCHAR2(1); l_msg_count NUMBER; l_msg_data VARCHAR2(1000); begin dbms_output.put_line('-------------------------------------------'); open c_login_user(l_user_name); fetch c_login_user into l_user_id; if c_login_user%NOTFOUND then close c_login_user; raise_application_error(-20000,'User name '||l_user_name||' is not found.'); end if; close c_login_user; dbms_output.put_line('User Id : '||l_user_id);

fnd_global.apps_initialize(l_user_id, 0, 690); jtf_task_references_pub.create_references( p_api_version => 1.0, p_init_msg_list => fnd_api.g_true, p_commit => fnd_api.g_false, p_task_id => l_task_id, p_object_type_code => l_source_object_type, p_object_name => l_source_object_name, p_object_id => l_source_object_id, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_task_reference_id => l_task_reference_id ); IF l_return_status <> fnd_api.g_ret_sts_success THEN IF l_msg_count > 0 THEN l_msg_data := NULL; FOR i IN 1..l_msg_count LOOP l_msg_data := l_msg_data ||' '||fnd_msg_pub.get(1, 'F'); END LOOP; fnd_message.set_encoded(l_msg_data);

Task Manager Public APIs 4-65

Page 268: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

dbms_output.put_line(l_msg_data); END IF; ROLLBACK; ELSE dbms_output.put_line('l_task_reference_id = '||l_task_reference_id); dbms_output.put_line('Return Status = '||l_return_status); COMMIT; END IF;end;/

4-66 Oracle CRM Application Foundation API Reference Guide

Page 269: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Notes Public

5

Notes Public APIs

Notes are free-formed text, created by an agent, customer care or service representative, or end user and attached to a CRM object. Applications in the E-business suite use notes to help retain information about business objects, such as directions, special instructions, and reminders. Notes are also used for service requests, service quotes, marketing offerings, and tasks.

The following topics are discussed in this chapter:

■ Package JTF_NOTES_PUB

■ Messages and Notifications

■ Sample Code

5.1 Package JTF_NOTES_PUBAll public procedures (APIs) relating to creating and updating notes are stored in the JTF_NOTES_PUB package. There are two public Note APIs:

■ Create_Notes

■ Update_Notes

APIs 5-1

Page 270: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

5.1.1 Data Structure SpecificationsPackage JTF_NOTES_PUB contain one data structure.

5.1.1.1 Record jtf_note_contexts_rec_typeThe JTF_NOTE_CONTEXTS_REC is used to store information about the context (a related business object) for the note. This record type is used to create both of the following:

■ jtf_note_contexts_tab

■ jtf_note_contexts_tab_dflt

TYPE jtf_note_contexts_rec_type IS RECORD( note_context_id NUMBER, jtf_note_id NUMBER, note_context_type VARCHAR2(240), note_context_type_id NUMBER, last_update_date DATE, last_updated_by NUMBER(15), creation_date DATE, created_by NUMBER, last_update_login NUMBER);These parameters have the same meaning as those defined for the individual Notes APIs.

5.1.2 Notes Public APIsThe following table describes the public APIs which are discussed in this chapter.

5.1.3 Note Source and Note ContextThe following section details the relationship between both the note source and note context and the JTF_NOTES_PUB API package.

Table 5–1 The Notes Public APIs

Procedure Description

Create_Note Creates a note (record) and writes it to the database.

Update_Note Updates an existing note (record) and writes the updated version to the database.

5-2 Oracle CRM Application Foundation API Reference Guide

Page 271: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

5.1.3.1 Note SourceThe note source is always required when using the JTF_NOTES_PUB API package. The note source is a business object that owns the note. It is always one of the following:

■ the creator of the note

■ the initiator of the note

■ the parent of the note

This could be a party, a service request, or an order, for example. In any case, the note does not make sense without the source. You must specify the source of a note when creating it.

5.1.3.2 Note ContextThe note context is a business object that is related to the note, but is not its source. For example, a note is created for a task, but, in addition, it is related to a party, an opportunity and an employee. Note context is not required when you create a note.

The following table describes some of the important parameters related to both the note source and note context.

Table 5–2 Note Source and Context Parameters

Parameter Description

p_source_object_code This parameter contains (references) the source business object. For example, this could be a party, a task, or a service request. This parameter is not the software module that created the note. For example, it is not Customer Care, or the Contact Center.

p_source_object_id This parameter relates to the business object specified in p_source_object_code, but refers to a particular instance of the business object. For example, this could be the party_id for a party, or the service_request_id of a service request.

p_context This is a short description field for the context business object.

p_note_context_type This value is passed as a parameter in the internal call to the Create_Note_Context API. It is the business object that is related to, but is not the source of, the note. It is similar to p_source_object_code.

p_note_context_type_id This value is passed as a parameter in the internal call to the Create_Note_Context API. It is similar to p_source_object_id.

Notes Public APIs 5-3

Page 272: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

The p_note_context_type parameter and the p_note_context_type_id parameter are stored as data items in the p_jtf_note_contexts_tab record. See Section 5.1.1.1, "Record jtf_note_contexts_rec_type" for details of this data structure.

5.1.4 Party RelationshipsFor notes related to a party business object (no matter what party type), use only the PARTY type definition. That is, do not use:

■ PARTY_PERSON

■ PARTY_GROUP

■ PARTY_RELEATIONSHIP

■ PARTY_ORGANIZATION

You must define the note as type PARTY to be able to find, across the entire CRM suite, any note created for a specific party.

Note Contexts that Relate to a CustomerWhen a note is created for a source that contains customer information, then the customer information must be included as part of the context for that note. This ensures that all notes relating to that customer can be viewed in a single place. To do this, set the value for p_note_context_type to PARTY.

Note Contexts that Relate to a RelationshipIf a note is created for a source that contains customer information that includes relationship information such as a member of an organization, then it must create three separate instances of p_jtf_note_contexts_tab records (discussed in Section 5.1.1.1, "Record jtf_note_contexts_rec_type") that contain the following:

1. Information related to the organization in which the person works.

2. The party identifier for party of type "relationship." Do not use PARTY_RELATIONSHIP, instead use PARTY for the p_note_context_type parameter.

3. The party identifier (party_id) for the person.

Note: It is not necessary to populate the source object into the notes context table. This action is performed automatically by the Notes APIs.

5-4 Oracle CRM Application Foundation API Reference Guide

Page 273: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

Example of a Party RelationshipThe following table lists information needed to specify the relationship of John Doe at Oracle (john.doe@oracle). It is stored in the PARTY tables in the database.

The following table lists the values for the context information needed to specify John.Doe@Oracle. The context business object is the p_note_context_type parameter. The context business object identifier is p_context_type_id.

5.1.5 Create_NoteUse the Create_Note API to generate a text note. This API Performs the following tasks:

■ It validates the note status, length, type, and ID.

■ It creates a note record and writes it to the database.

■ It writes any related contexts to the database.

Party ID Party Type Party Name

1000 ORGANIZATION Oracle

1100 PERSON John Doe

1200 PARTY_RELATIONSHIP John.Doe@Oracle

p_note_context_type p_context_type_id

PARTY 1000

PARTY 1100

PARTY 1200

Notes Public APIs 5-5

Page 274: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

Example Note Parameter ValuesThe following table lists the input parameters associated with a note that was created and attached to service request 4039. This note was created as a private note, on September 2, 2000.

Procedure SpecificationPROCEDURE Create_Note ( p_parent_note_id IN NUMBER DEFAULT NULL, p_jtf_note_id IN NUMBER DEFAULT NULL, p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE, p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE, p_validation_level IN NUMBER DEFAULT FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_org_id IN NUMBER DEFAULT NULL, p_source_object_id IN NUMBER, p_source_object_code IN VARCHAR2, p_notes IN VARCHAR2,

Table 5-1 Note Parameter Value Example

Parameter Value

p_parent_note_id NULL

p_jtf_note_id 209

p_source_object_id 4039

p_source_object_code SR

p_note_status E

p_entered_by 1000194

p_entered_date 09/02/2000 12:42:22 PM

p_last_update_date 09/02/2000 12:42:22 PM

p_last_updated_by 1000194

p_creation_date 09/02/2000 12:42:22 PM

p_created_by 1000194

p_last_update_login 519018

p_note_type AS_USER

5-6 Oracle CRM Application Foundation API Reference Guide

Page 275: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

p_notes_detail IN VARCHAR2 DEFAULT NULL, p_note_status IN VARCHAR2 DEFAULT 'I', p_entered_by IN NUMBER, p_entered_date IN DATE, x_jtf_note_id OUT NUMBER, p_last_update_date IN DATE, p_last_updated_by IN NUMBER, p_creation_date IN DATE, p_created_by IN NUMBER DEFAULT FND_GLOBAL.USER_ID, p_last_update_login IN NUMBER DEFAULT FND_GLOBAL.LOGIN_ID, p_attribute1 IN VARCHAR2 DEFAULT NULL, p_attribute2 IN VARCHAR2 DEFAULT NULL, p_attribute3 IN VARCHAR2 DEFAULT NULL, p_attribute4 IN VARCHAR2 DEFAULT NULL, p_attribute5 IN VARCHAR2 DEFAULT NULL, p_attribute6 IN VARCHAR2 DEFAULT NULL, p_attribute7 IN VARCHAR2 DEFAULT NULL, p_attribute8 IN VARCHAR2 DEFAULT NULL, p_attribute9 IN VARCHAR2 DEFAULT NULL, p_attribute10 IN VARCHAR2 DEFAULT NULL, p_attribute11 IN VARCHAR2 DEFAULT NULL, p_attribute12 IN VARCHAR2 DEFAULT NULL, p_attribute13 IN VARCHAR2 DEFAULT NULL, p_attribute14 IN VARCHAR2 DEFAULT NULL, p_attribute15 IN VARCHAR2 DEFAULT NULL, p_context IN VARCHAR2 DEFAULT NULL, p_note_type IN VARCHAR2 DEFAULT NULL, p_jtf_note_contexts_tab IN jtf_note_contexts_tbl_type DEFAULT jtf_note_contexts_tab_dflt);

Current Version1.0

Notes Public APIs 5-7

Page 276: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 5–3 Create_Note IN Parameters

Parameter Data Type Required Descriptions and Validations

p_parent_note_id NUMBER No Identifier of the parent note, if any.

p_jtf_note_id NUMBER No Note identifier; this must be unique, if it is not, an error is raised. You must use the JTF_NOTES_S sequence to generate valid values.

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_validation_level NUMBER No This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation occurs.

p_org_id NUMBER No An identifier for the organization.

p_source_object_id NUMBER No Dependent on parameter p_source_object_code; for example, if the source business object is a service request, this is the service request number.

See Section 5.1.3, "Note Source and Note Context" on page 5-2 for more details.

p_source_object_code VARCHAR2 No The source business object for the note; for example, this could be TASK if the source object is a task, or ESC if the source object is an escalated document.

See Section 5.1.3, "Note Source and Note Context" on page 5-2 for more details.

p_notes VARCHAR2 Yes The actual note text, passed from the source application.

p_notes_detail VARCHAR2 No This parameter is used to store larger notes of up to 32k.

5-8 Oracle CRM Application Foundation API Reference Guide

Page 277: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

p_notes_status VARCHAR2 No Indicates the status of the note. Choices are:

■ Private (E)

■ Internal (I)

■ Publish (P)

This value must be either E, I, or P. If it is not, an error is raised. If none is provided, I is used.

p_entered_by NUMBER Yes Identifies the Oracle Applications user who entered this record. If a valid user identifier is not provided, an error is raised.

p_entered_date DATE Yes The date that the record was entered. If not provided, SYSDATE is used.

p_last_update_date DATE Yes The date that this record was last updated. If not provided, SYSDATE is used.

p_last_updated_by NUMBER No Identifies the Oracle Applications user who last updated this record.

p_creation_date DATE Yes The date on which this note was first created. If not provided, SYSDATE is used.

p_created_by NUMBER No Identifies the Oracle Applications user who first created this record.

p_last_update_login NUMBER No Identifies the login session of the Oracle Applications user that last updated the note.

p_attribute1 VARCHAR2 No Descriptive Flexfield Segment

p_attribute2 VARCHAR2 No Descriptive Flexfield Segment

p_attribute3 VARCHAR2 No Descriptive Flexfield Segment

p_attribute4 VARCHAR2 No Descriptive Flexfield Segment

p_attribute5 VARCHAR2 No Descriptive Flexfield Segment

p_attribute6 VARCHAR2 No Descriptive Flexfield Segment

p_attribute7 VARCHAR2 No Descriptive Flexfield Segment

p_attribute8 VARCHAR2 No Descriptive Flexfield Segment

p_attribute9 VARCHAR2 No Descriptive Flexfield Segment

p_attribute10 VARCHAR2 No Descriptive Flexfield Segment

Table 5–3 Create_Note IN Parameters

Parameter Data Type Required Descriptions and Validations

Notes Public APIs 5-9

Page 278: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

The following table describes the OUT parameters associated with this API.

p_attribute11 VARCHAR2 No Descriptive Flexfield Segment

p_attribute12 VARCHAR2 No Descriptive Flexfield Segment

p_attribute13 VARCHAR2 No Descriptive Flexfield Segment

p_attribute14 VARCHAR2 No Descriptive Flexfield Segment

p_attribute15 VARCHAR2 No Descriptive Flexfield Segment

p_context VARCHAR2 No This is a short description field.

p_note_type VARCHAR2 No The type of note, based on the source business object; for example, this could be SR_PROBLEM, if the note concerns a service request problem. If this value is not valid, an error is raised.

p_jtf_note_contexts_tab jtf_note_contexts_tbl_type No Table of PL/SQL records used to specify the note context.

See Section 5.1.3, "Note Source and Note Context" on page 5-2 and Section 5.2, "Messages and Notifications" on page 5-13 for more details.

Table 5–4 Create_Note OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_jtf_note_id NUMBER The unique note identifier. This value is the same as p_jtf_note_id.

Table 5–3 Create_Note IN Parameters

Parameter Data Type Required Descriptions and Validations

5-10 Oracle CRM Application Foundation API Reference Guide

Page 279: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

5.1.6 Update_NoteUse the Update_Note API to modify an existing text note. This API Performs the following tasks:

■ Validates the note status, length, type, and ID.

■ It update an existing note record and replaces the existing version in the database with the modified version.

■ It updates any related context information in the database, if necessary.

Procedure SpecificationPROCEDURE Update_note( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 DEFAULT fnd_api.g_false, p_commit IN VARCHAR2 DEFAULT fnd_api.g_false, p_validation_level IN NUMBER DEFAULT fnd_api.g_valid_level_full, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_jtf_note_id IN NUMBER, p_entered_by IN NUMBER, p_last_updated_by IN NUMBER, p_last_update_date IN DATE DEFAULT Sysdate, p_last_update_login IN NUMBER DEFAULT NULL, p_notes IN VARCHAR2 DEFAULT fnd_api.g_miss_char, p_notes_detail IN VARCHAR2 DEFAULT fnd_api.g_miss_char, p_append_flag IN VARCHAR2 DEFAULT fnd_api.g_miss_char, p_note_status IN VARCHAR2 DEFAULT 'I', p_note_type IN VARCHAR2 DEFAULT fnd_api.g_miss_char, p_jtf_note_contexts_tab IN jtf_note_contexts_tbl_type DEFAULT jtf_note_contexts_tab_dflt );

Current Version1.0

Notes Public APIs 5-11

Page 280: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_NOTES_PUB

Parameter Descriptions

The following table describes the IN parameters associated with this API.

Table 5–5 Update_Note IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_validation_level NUMBER No This value determines whether validation should occur or not. The variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation is performed.

p_jtf_note_id NUMBER Yes Note identifier; this must be unique, if it is not, an error is raised. You must use the JTF_NOTES_S sequence to generate valid values.

p_entered_by NUMBER Yes This is employee ID of the person who entered the note.

p_last_updated_by NUMBER Yes Corresponds to the column USER_ID in the table FND_USER, and identifies the Oracle Applications user who updated this record.

p_last_update_date DATE No The date on which this record was updated.

p_last_update_login NUMBER No Corresponds to the column LOGIN_ID in the table FND_LOGINS, and identifies the login session of the user.

p_notes VARCHAR2 No The updated note text.

p_notes_detail VARCHAR2 No Used to create larger notes of up to 32K. If p_append_flag is set to Yes, then p_notes_detail is appended to p_notes.

p_append_flag VARCHAR2 No Boolean value: Used to specify if p_notes_detail is to be appended to the existing p_notes_detail:

■ TRUE: Append p_notes_detail to p_notes_detail.

■ FALSE: Do not append p_notes_detail to p_notes_detail.

5-12 Oracle CRM Application Foundation API Reference Guide

Page 281: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

The following table describes the OUT parameters associated with this API.

5.2 Messages and NotificationsThe APIs contained in package JTF_NOTES_PUB generate messages and notifications as needed. These messages are detailed in section 6.3.1.

p_note_status VARCHAR2 No Indicates the status of the note. Choices are:

■ Private

■ Internal (Default)

■ Publish

Note that only the owner of the note can update the Private status of a note. The owner of the note is defined by the p_entered_by parameter.

p_note_type VARCHAR2 No This value must be one of the note types defined as lookup codes for JTF_NOTE_TYPE.

p_jtf_note_contexts_tab jtf_note_contexts_tbl_type No Table of PL/SQL records to specify the note context.

See Section 5.1.3, "Note Source and Note Context" on page 5-2 and Section 5.2, "Messages and Notifications" on page 5-13 for more details.

Table 5–6 Update_Note OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Note: Status notifications are not required to provide a number identifier along with the message, although, in many cases, it is provided.

Table 5–5 Update_Note IN Parameters

Parameter Data Type Required Descriptions and Validations

Notes Public APIs 5-13

Page 282: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

5.2.1 JTF_NOTES_PUBThe following table lists the messages and notifications generated by the Create_Note and Update_Note APIs.

5.3 Sample CodeThis section contains SQL scripts that call the Notes public APIs contained in the JTF_NOTES_PUB package and insert values as required.

5.3.1 Package JTF_NOTES_PUBThe SQL scripts in this section create and update a note by calling the Create_Note and Update_Note APIs in succession and by providing them with the required values.

Table 5–7 Create_Note and Update_Note Messages

Type Name Text

E JTF_API_ERR_PRE_CUST_USR_HK API Programming Error (&API_NAME): Returned Error Status from the Pre Customer User Hook.

E JTF_API_ERR_PRE_VERT_USR_HK API Programming Error (&API_NAME): Returned Error Status from the Pre Vertical User Hook.

E JTF_API_ERR_POST_CUST_USR_HK API Programming Error (&API_NAME): Returned Error Status from the Post Customer User Hook.

E JTF_API_ERR_POST_VERT_USR_HK API Programming Error (&API_NAME): Returned Error Status from the Post Vertical User Hook.

E JTF_API_ALL_INVALID_ARGUMENT API Programming Error (&API_NAME): The value of "&VALUE" for &PARAMETER is invalid.

E JTF_API_ALL_MISSING_PARAM API Programming Error (&API_NAME): Parameter &MISSING_PARAM is required and was not passed in.

E JTF_API_ALL_NULL_PARAMETER API Programming Error (&API_NAME): The value of &NULL_PARAM cannot be NULL.

E JTF_API_ALL_VALUE_TRUNCATED API Programming Warning (&API_NAME): The parameter &TRUNCATED_PARAM was truncated because the character value (&VAL_LEN) is longer than the defined width of the VARCHAR2 column (&DB_LEN).

5-14 Oracle CRM Application Foundation API Reference Guide

Page 283: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

5.3.1.1 Create_NoteThis script calls the Create_Note API and creates a note with the following information:

■ Source object ID: 151263

■ Source object: Task Manager

■ Note status: Publish

■ Note type: General

■ Note text: These are the directions to my office

DECLARE l_api_version NUMBER; l_init_msg_list VARCHAR2(1); l_validation_level NUMBER; l_commit VARCHAR2(1); l_return_status VARCHAR2(1); l_msg_count NUMBER; l_msg_data VARCHAR2(2000); l_jtf_note_id NUMBER; l_source_object_id NUMBER; l_source_object_code VARCHAR2(8); l_note_status VARCHAR2(8); l_note_type VARCHAR2(80); l_notes VARCHAR2(2000); l_notes_detail VARCHAR2(8000); l_last_update_date DATE; l_last_updated_by NUMBER; l_creation_date DATE; l_created_by NUMBER; l_last_update_login NUMBER; l_entered_by NUMBER; l_entered_date DATE; l_note_contexts JTF_NOTES_PUB.jtf_note_contexts_tbl_type; l_msg_index NUMBER; l_msg_index_out NUMBER; BEGIN -- Initialize the Notes parameters you want to create l_api_version := 1.0; l_init_msg_list := FND_API.g_true; l_validation_level := FND_API.g_valid_level_full; l_commit := FND_API.g_true;

Notes Public APIs 5-15

Page 284: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_msg_count := 0; l_source_object_id := 151263; l_source_object_code := 'TASK'; l_note_status := 'P'; l_note_type := 'GENERAL'; l_notes := 'These are the directions to my office'; l_notes_detail := 'These are the directions to my office'; l_entered_by := FND_GLOBAL.user_id; l_entered_date := SYSDATE;

-- Initialize Who columns l_last_update_date := SYSDATE; l_last_updated_by := FND_GLOBAL.USER_ID; l_creation_date := SYSDATE; l_created_by := FND_GLOBAL.USER_ID; l_last_update_login:= FND_GLOBAL.LOGIN_ID;

-- Initialize the Notes Context parameters (optional) l_note_contexts(1).note_context_type := 'SR'; l_note_contexts(1).note_context_type_id := 1; l_note_contexts(1).last_update_date := SYSDATE; l_note_contexts(1).last_updated_by := FND_GLOBAL.USER_ID; l_note_contexts(1).creation_date := SYSDATE; l_note_contexts(1).created_by := FND_GLOBAL.USER_ID; l_note_contexts(1).last_update_login := FND_GLOBAL.LOGIN_ID; l_note_contexts(2).note_context_type := 'TASK'; l_note_contexts(2).note_context_type_id := 151149; l_note_contexts(2).last_update_date := SYSDATE; l_note_contexts(2).last_updated_by := FND_GLOBAL.USER_ID; l_note_contexts(2).creation_date := SYSDATE; l_note_contexts(2).created_by := FND_GLOBAL.USER_ID; l_note_contexts(2).last_update_login := FND_GLOBAL.LOGIN_ID;

-- Call the API jtf_notes_pub.Create_note ( p_api_version => l_api_version, p_init_msg_list => l_init_msg_list, p_commit => l_commit, p_validation_level => l_validation_level, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, p_jtf_note_id => l_jtf_note_id, p_entered_by => l_entered_by,

5-16 Oracle CRM Application Foundation API Reference Guide

Page 285: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

p_entered_date => l_entered_date, p_source_object_id => l_source_object_id, p_source_object_code => l_source_object_code, p_notes => l_notes, p_notes_detail => l_notes_detail, p_note_type => l_note_type, p_note_status => l_note_status, p_jtf_note_contexts_tab => l_note_contexts, x_jtf_note_id => l_jtf_note_id, p_last_update_date => l_last_update_date, p_last_updated_by => l_last_updated_by, p_creation_date => l_creation_date, p_created_by => l_created_by, p_last_update_login => l_last_update_login ); -- Check for errors

IF (fnd_msg_pub.count_msg > 0) THEN FOR i IN 1..fnd_msg_pub.count_msg LOOP fnd_msg_pub.get ( p_msg_index => i, p_encoded => 'F', p_data => l_msg_data, p_msg_index_out => l_msg_index_out ); DBMS_OUTPUT.PUT_LINE('API ERROR: ' || l_msg_data); END LOOP; ELSE DBMS_OUTPUT.PUT_LINE('Created note : ' || to_char(l_jtf_note_id)); END IF; END;

5.3.1.2 Update_NoteThis script calls the Update_Note API and updates the previously created note with the following values:

■ Note status: E (Private)

■ Note type: Call Back

DECLARE

Notes Public APIs 5-17

Page 286: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_api_version NUMBER; l_init_msg_list VARCHAR2(1); l_validation_level NUMBER; l_commit VARCHAR2(1); l_return_status VARCHAR2(1); l_msg_count NUMBER; l_msg_data VARCHAR2(2000); l_jtf_note_id NUMBER; l_note_status VARCHAR2(8); l_note_type VARCHAR2(80); l_notes VARCHAR2(2000); l_notes_detail VARCHAR2(32000); l_append_flag VARCHAR2(1); l_last_update_date DATE; l_last_updated_by NUMBER; l_last_update_login NUMBER; l_entered_by NUMBER; l_note_contexts JTF_NOTES_PUB.jtf_note_contexts_tbl_type; l_msg_index NUMBER; l_msg_index_out NUMBER;

BEGIN -- Initialize the API l_api_version := 1.0; l_init_msg_list := FND_API.g_true; l_validation_level := FND_API.g_valid_level_full; l_commit := FND_API.g_true; l_msg_count := 0; -- Initialize Notes parameters you want to update l_jtf_note_id := 151263; l_note_status := 'E'; l_note_type := 'Call Back'; l_notes := 'These are the directions to my office'; l_notes_detail := 'These are the directions to my office'; l_entered_by := FND_GLOBAL.user_id;

-- Initialize Who columns l_last_update_date := SYSDATE; l_last_updated_by := FND_GLOBAL.USER_ID; l_last_update_login:= FND_GLOBAL.LOGIN_ID;

-- Initialize the Notes Context parameters (optional) l_note_contexts(1).jtf_note_id := 151263; l_note_contexts(1).note_context_id := 151149;

5-18 Oracle CRM Application Foundation API Reference Guide

Page 287: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_note_contexts(1).note_context_type := 'SR'; l_note_contexts(1).note_context_type_id := 1; l_note_contexts(1).last_update_date := SYSDATE; l_note_contexts(1).last_updated_by := FND_GLOBAL.USER_ID; l_note_contexts(1).last_update_login := FND_GLOBAL.LOGIN_ID; l_note_contexts(2).jtf_note_id := 151263; l_note_contexts(2).note_context_id := 151149; l_note_contexts(2).note_context_type := 'TASK'; l_note_contexts(2).note_context_type_id := 151149; l_note_contexts(2).last_update_date := SYSDATE; l_note_contexts(2).last_updated_by := FND_GLOBAL.USER_ID; l_note_contexts(2).last_update_login := FND_GLOBAL.LOGIN_ID; -- Call the API jtf_notes_pub.Update_note ( p_api_version => l_api_version, p_init_msg_list => l_init_msg_list, p_commit => l_commit, p_validation_level => l_validation_level, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, p_jtf_note_id => l_jtf_note_id, p_entered_by => l_entered_by, p_notes => l_notes, p_notes_detail => l_notes_detail, p_append_flag => l_append_flag, p_note_type => l_note_type, p_note_status => l_note_status, p_last_update_date => l_last_update_date, p_last_updated_by => l_last_updated_by, p_last_update_login => l_last_update_login, p_jtf_note_contexts_tab => l_note_contexts ); -- Check for errors IF (fnd_msg_pub.count_msg > 0) THEN FOR i IN 1..fnd_msg_pub.count_msg LOOP fnd_msg_pub.get ( p_msg_index => i, p_encoded => 'F', p_data => l_msg_data, p_msg_index_out => l_msg_index_out

Notes Public APIs 5-19

Page 288: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

); DBMS_OUTPUT.PUT_LINE('API ERROR: ' || l_msg_data); END LOOP; ELSE DBMS_OUTPUT.PUT_LINE('Updated note : ' || to_char(l_jtf_note_id)); END IF; END;

5-20 Oracle CRM Application Foundation API Reference Guide

Page 289: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Fulfillment Engine Public

6

Fulfillment Engine Public APIs

Fulfillment is an automated method for sending information to customers. It provides the ability to immediately satisfy a customer’s requests for information, literature, and other correspondence or collateral. Customer Service Representatives handle a variety of requests ranging from product and service inquiries, pricing questions, billing inquiries, and general customer care issues. Many of these requests result in some dissemination of literature, collateral, forms of application, letters, or correspondence to the customer.

Fulfillment provides the ability for call center administrators, mobile field representatives, marketing managers, customer care representatives, and other service agents to respond to different customer needs quickly and easily using e-mail.

The following topics are discussed in this chapter:

■ Package JTF_FM_REQUEST_GRP

■ Submitting a Fulfillment Request

■ Forming an XML Request

■ The Fulfillment APIs

■ Messages and Notifications

■ Sample Code

6.1 Package JTF_FM_REQUEST_GRPPackage JTF_FM_REQUEST_GRP contains APIs used to form an XML fulfillment request and to submit the request to the Fulfillment engine for processing. It also includes APIs to cancel, and resubmit a fulfillment request. The following table describes the public APIs that are discussed in this chapter.

APIs 6-1

Page 290: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_FM_REQUEST_GRP

6.1.1 Data Structure SpecificationsThe Fulfillment APIs use PL/SQL table structures to store an unlimited amount of information for the duration of each API call. The following table lists the PL/SQL tables and provides the SQL definition of each.

6.1.1.1 History RecordsInformation stored in the PL/SQL tables can be used to create history records. History records are stored in the History table in rows defined as follows:

OUTCOME_CODE VARCHAR2(20) SOURCE_CODE_ID NUMBER SOURCE_CODE VARCHAR2(30) OBJECT_TYPE VARCHAR2(30) OBJECT_ID NUMBER ORDER_ID NUMBER RESUBMIT_COUNT NUMBER OUTCOME_DESC VARCHAR2(2000) REQUEST CLOB

Table 6–1 Fulfillment APIs

Procedure Description

Start_Request Generates the history request identifier.

Get_Content_XML Forms the <item> element of the XML request.

Submit_Request Initiates the fulfillment submission process.

Send_Request Sends a fulfillment request to the Fulfillment Request queue.

Cancel_Request Cancels a fulfillment request that is already in the system.

Resubmit_Request Resubmits an existing fulfillment request to the Fulfillment engine.

Table 6–2 Fulfillment PL/SQL Tables

Name Definition

G_VARCHAR_TBL_TYPE TYPE G_VARCHAR_TBL_TYPE IS TABLE OF VARCHAR2(1000) INDEX BY BINARY_INTEGER;

G_NUMBER_TBL_TYPE TYPE B_NUMBER_TBL_TYPE IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;

6-2 Oracle CRM Application Foundation API Reference Guide

Page 291: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Package JTF_FM_REQUEST_GRP

SUBMIT_DT_TM NOT NULL DATE SERVER_ID NUMBER TEMPLATE_ID NUMBER APP_INFO VARCHAR2(240) GROUP_ID NUMBER HIST_REQ_ID NOT NULL NUMBER USER_ID NUMBER(15) PRIORITY NUMBER PROCESSED_DT_TM VARCHAR2(240) MESSAGE_ID RAW(16) LAST_UPDATE_DATE NOT NULL DATE LAST_UPDATED_BY NOT NULL NUMBER(15) CREATION_DATE NOT NULL DATE CREATED_BY NOT NULL NUMBER(15) LAST_UPDATE_LOGIN NUMBER(15) ORG_ID NUMBER(15) F_DELETEDFLAG VARCHAR2(1) OBJECT_VERSION_NUMBER NUMBER

6.1.1.2 Status RecordsInformation stored in the PL/SQL tables can be used to create status records. Status records are stored in the Status table in rows defined as follows:

ORDER_ID NUMBER SOURCE_CODE_ID NUMBER SOURCE_CODE VARCHAR2(30) OBJECT_TYPE VARCHAR2(30) OBJECT_ID NUMBER REQUEST_ID NOT NULL NUMBER REQUEST_STATUS VARCHAR2(20) REQUEST_MODE VARCHAR2(50) REQUEUE_COUNT NUMBER(30) SUBMIT_DT_TM NOT NULL DATE SERVER_ID NUMBER TEMPLATE_ID NUMBER USER_ID NUMBER(15) GROUP_ID NUMBER PRIORITY NUMBER MESSAGE_ID RAW(16) LAST_UPDATE_DATE NOT NULL DATE LAST_UPDATED_BY NOT NULL NUMBER(15) CREATION_DATE NOT NULL DATE CREATED_BY NOT NULL NUMBER(15)

Fulfillment Engine Public APIs 6-3

Page 292: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Submitting a Fulfillment Request

LAST_UPDATE_LOGIN NUMBER(15) ORG_ID NUMBER(15) ATTRIBUTE1 VARCHAR2(150)ATTRIBUTE2 VARCHAR2(150)ATTRIBUTE3 VARCHAR2(150)ATTRIBUTE4 VARCHAR2(150)ATTRIBUTE5 VARCHAR2(150)ATTRIBUTE6 VARCHAR2(150)ATTRIBUTE7 VARCHAR2(150)ATTRIBUTE8 VARCHAR2(150)ATTRIBUTE9 VARCHAR2(150)ATTRIBUTE10 VARCHAR2(150)ATTRIBUTE11 VARCHAR2(150)ATTRIBUTE12 VARCHAR2(150)ATTRIBUTE13 VARCHAR2(150)ATTRIBUTE14 VARCHAR2(150)ATTRIBUTE15 VARCHAR2(150)F_DELETEDFLAG VARCHAR2(1) OBJECT_VERSION_NUMBER NUMBER

6.2 Submitting a Fulfillment RequestFigure 6–1, "Process Flow for Submitting a Fulfillment Request" illustrates the process flow for submitting a fulfillment request.

1. The Start_Request API generates the history request identifier, used as the tracking identifier for the fulfillment request and returns it to the calling applications as x_request_id.

2. The Get_Content_XML API forms the XML <item> element. When the calling application calls this API, it passes the history request identifier as p_request_id and returns a unique XML content identifier to the calling application as x_content_id. The calling application calls this API as many times as necessary.

3. The Submit_Request API formally starts the fulfillment request process. The calling application passes the history request identifier to this API as p_request_id, and passes the XML content identifier to it as p_content_id.

4. The Send_Request API is called internally by the Submit_Request API, which passes the history request identifier to this API as p_request_id and passes the XML content identifier to it as p_content_id. The calling application can explicitly call this API to submit a document for previewing by setting the value of the p_preview parameter to true.

6-4 Oracle CRM Application Foundation API Reference Guide

Page 293: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Submitting a Fulfillment Request

5. The Send_Request API places the fulfillment request into the Request queue and writes to the status and history tables in the database. The Request and Response queues are columns in the Services table.

6. The Cancel_Request API is an optional procedure that removes the fulfillment request from the Request queue, and updates the status and history tables in the database. The Request and Response queues are columns in the Services table. When the calling application calls the Cancel_Request API, it passes the history request identifier as p_request_id.

7. The Resubmit_Request API is an optional procedure that retrieves an existing fulfillment request from the database, resubmits it to the Request queue, and updates the status and history tables in the database. The Request and Response queues are columns in the Services table. When the calling application calls the Resubmit_Request API, it passes the history request identifier as p_request_id.

Fulfillment Engine Public APIs 6-5

Page 294: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Submitting a Fulfillment Request

Figure 6–1 Process Flow for Submitting a Fulfillment Request

6-6 Oracle CRM Application Foundation API Reference Guide

Page 295: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

6.3 Forming an XML Request

The XML fulfillment request is built up through calls to several different APIs. It contains the root element <ffm_request>, and two first generation child elements:

■ <app_info>

■ <item>

The following table lists the DTD (Document Type Definition) main elements and the Fulfillment API in which that element is created or formed.

6.3.1 The <ffm_request> Root ElementThe <ffm_request> root element for the fulfillment document contains two top level child elements:

■ <app_info>

■ <item>

The <app_info> element and at least one <item> element are mandatory.

The XML request is validated against the fulfillment request DTD (Document Type Definition) after it is sent to the Fulfilment server for processing.

Warning: Oracle does not recommend, nor does it support, the creation of XML fulfillment requests by any other means than through these published APIs.

Information on how the XML request is formed is provided solely to facilitate understanding of the fulfillment request process.

Table 6–3 The Fulfillment Request XML Elements

Element Occurs Required Formed In

<ffm_request> Once Yes Send_Request

<app_info> Once Yes Send_Request

<item> At least once Yes Get_Content_XML

Fulfillment Engine Public APIs 6-7

Page 296: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

6.3.1.1 The <app_info> ElementThe <app_info> element is formed by the Send_Request API. It has one optional child element, <extended_header>, that can occur multiple times. This element has a number of mandatory and optional attributes, or options, that further define the behavior of the <app_info> element.

The <app_info> Element Attributes The following table lists the <app_info> attributes and indicates whether or not each attribute is optional or mandatory. For an explanation of these parameters, see the discussion on parameters for the individual APIs.

The Optional <extended_header> Element If used, the calling application must provide the extended_header string. This optional element contains two additional child elements:

■ <header_name>

■ <header_value>

Table 6–4 The <app_info> Element Attributes

Attribute Required

user_id Yes

party_id No

party_name No

subject No

source_code_id No

source_code No

object_type No

object_id No

order_id No

doc_id Yes

doc_ref Yes

app_id Yes

login_id Yes

resp_id Yes

6-8 Oracle CRM Application Foundation API Reference Guide

Page 297: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

The following table lists the <extended_header> attribute and indicates whether or not the attribute is optional or mandatory. The default value for this attribute is EMAIL.

Example <app_info> Element The following code example shows the <app_info> element and sample attribute and values.

<app_info user_id="1000196" subject="OMO Fulfillment" doc_id="10022" doc_ref="JFUF" app_id="690" login_id="555248" resp_id="21706"> <extended_header media_type="EMAIL"> <header_name>Request ID</header_name> <header_value>10281</header_value> </extended_header></app_info>

6.3.1.2 The <item> ElementThe <item> element is formed by the Send_Request API. It must occur at least once. This element has two mandatory child elements:

■ <item_destination>

■ <item_content>

The <item_destination> Element The <item_destination> element has one child element, <media_type>. The following table lists the allowable values for this element. For an explanation of these values, see the discussion on parameters for the individual APIs.

The <item_content> Element Valid content types are:

Table 6–5 The <extended_header> Element Attribute

Attribute Required Values

media_type Yes, if the <extended_header> element is used.

■ EMAIL

■ FAX

Table 6–6 Values for <media_type>

Element Values

<media_type> ■ EMAIL

■ FAX

Fulfillment Engine Public APIs 6-9

Page 298: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

■ query

■ data

■ collateral

■ attachment

The following table lists the <item_content> attributes and indicates whether or not each attribute is optional or mandatory. For an explanation of these parameters, see the discussion on parameters for the individual APIs.

The default value for the quantity attribute is one (1). This value refers to the number of times the content is to be repeated (similar to the number of copies, when printing). This value can be overridden by passing a different value during the call to the Get_Content_XML API. Oracle recommends, however, that you do not change this value.

Both the query and data (record) content types must have an additional <bind_var> element defined.

The <bind_var> Element Within Fulfillment, SQL queries are used for generating and populating data within the fulfillment request. Dynamic information comes from the query and the associated bind variables.

■ Both the data and query content types can have zero or more bind variables associated with them.

■ While legitimate, it is not meaningful to have a data request without associated bind variables.

■ With a query request, the query is extracted from the database based on the content ID.

■ The extracted query may or may not have bind variables associated with it.

Table 6–7 The <item_content> Attributes

Attribute Required

content_id Yes

content_nm No

quantity Yes, the default is 1

mime_type No

user_note No

6-10 Oracle CRM Application Foundation API Reference Guide

Page 299: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

Example <item> Element The following code example shows the <item> element and sample attribute and values.

<item> <item_destination> <media_type> <email>[email protected]</email> </media_type> </item_destination> <item_content content_id="10057" quantity="1" user_note="VIP Customer"> <data> <record> <bind_var bind_type="VARCHAR2" bind_object="firstname">John</bind_var> <bind_var bind_type="VARCHAR2" bind_object="number">7</bind_var> <bind_var bind_type="VARCHAR2" bind_object="sr_number">1234</bind_var> </record> </data> </item_content> </item>

6.3.2 The Fulfillment Request Document Type Definition (DTD)The following DTD (Document Type Definition) is used by the Fulfillment APIs to create well formed XML. The main XML element are shown in bold in the following DTD for enhanced readability.

Fulfillment Request DTD<?xml version="1.0" standalone="no"?><!DOCTYPE ffm_request [<!-- This File contains the Document Type Definition for FFM Requests. --><!ELEMENT ffm_request (app_info, item*)><!ATTLIST ffm_request id CDATA #REQUIRED submit_time CDATA #REQUIRED status (NEW_REQUEST | RESUBMITTED_REQUEST | PREVIEW | PREVIEWED) "NEW_REQUEST" template CDATA #IMPLIED priority CDATA #REQUIRED user_history (YES | NO) "YES" queue_response (YES | NO) "NO" api_version CDATA #REQUIRED

Fulfillment Engine Public APIs 6-11

Page 300: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

batch_number CDATA #REQUIRED>

<!ELEMENT app_info (extended_header*)><!ATTLIST app_info user_id CDATA #REQUIRED party_id CDATA #IMPLIED party_name CDATA #IMPLIED subject CDATA #IMPLIED source_code_id CDATA #IMPLIED source_code CDATA #IMPLIED object_type CDATA #IMPLIED object_id CDATA #IMPLIED order_id CDATA #IMPLIED doc_id CDATA #REQUIRED doc_ref CDATA #REQUIRED app_id CDATA #REQUIRED login_id CDATA #REQUIRED resp_id CDATA #REQUIRED> <!ELEMENT extended_header (header_name, header_value)* > <!ATTLIST extended_header media_type (EMAIL | FAX) "EMAIL" > <!ELEMENT header_name (#PCDATA)> <!ELEMENT header_value (#PCDATA)>

<!ELEMENT item (item_destination, item_content)><!ELEMENT item_destination (media_type)>

<!ELEMENT item_content (query | data | collateral | attachment)><!ATTLIST item_content content_id CDATA #REQUIRED content_nm CDATA #IMPLIED quantity CDATA #REQUIRED mime_type CDATA #IMPLIED user_note CDATA #IMPLIED> <!ELEMENT query (bind_var*)> <!ELEMENT data (record*)> <!ELEMENT collateral (#PCDATA)> <!ELEMENT attachment (#PCDATA)> <!ELEMENT bind_var (#PCDATA)> <!ATTLIST bind_var bind_type (VARCHAR2 | NUMBER | DATE) #REQUIRED bind_object CDATA #REQUIRED> <!ELEMENT record (bind_var*)>]>

6-12 Oracle CRM Application Foundation API Reference Guide

Page 301: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

6.3.3 Example XML Fulfillment RequestThe following table lists the parameters used to create an example XML Fulfillment request. These parameters are passed to the Submit_Request API and are used to generate the well formed XML request.

Table 6–8 Example Submit_Request Parameters

Parameter Value

p_api_version 1

p_init_msg_list Optional, if not provided, set to FND_API.G_FALSE

p_commit Optional, if not provided, set to FND_API.G_FALSE

p_validation_level Optional, if not provided, set to FND_API.G_VALID_LEVEL_FULL

p_template_id Optional, if not provided, set to FND_API.G_MISS_NUM

p_subject Optional, if not provided, set to FND_API.G_MISS_CHAR

p_party_id -229929

p_party_name Optional, if not provided, set to FND_API.G_MISS_CHAR

p_user_id 1000858

p_priority 7

p_source_code_id Optional, if not provided, set to FND_API.G_MISS_NUM

p_source_code Optional, if not provided, set to FND_API.G_MISS_CHAR

p_object_type Optional, if not provided, set to FND_API.G_MISS_CHAR

p_object_id Optional, if not provided, set to FND_API.G_MISS_NUM

p_order_id Optional, if not provided, set to FND_API.G_MISS_NUM

p_doc_id Optional, if not provided, set to p_request_id

p_doc_ref Optional, if not provided, set to JFUF (1-to-1 Fulfillment)

p_server_id 10000

p_queue_response Optional, if not provided, set to FND_API.G_FALSE

p_extended_header Optional, if not provided, set to FND_API.G_MISS_CHAR

p_content_xml Generated by the Get_Content_XML API

p_request_id 10281

Fulfillment Engine Public APIs 6-13

Page 302: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Forming an XML Request

The Submit_Request API CallThe parameter values listed in Table 6–8, "Example Submit_Request Parameters" were used to generate the following Submit_Request API call.

Submit_Request(1,,,,,,-229929,,1000858,7,,,,,,,,10000,,,<p_content_xml>,10281)

The Resulting XML Request<?xml version="1.0" standalone="no" ?> <!DOCTYPE ffm_request (View Source for full doctype...)> <ffm_request id="10041" submit_time="2000-10-04 14:37:21" status="NEW_REQUEST" priority="7" user_history="YES" api_version="1" queue_response="NO" batch_number="1"> <app_info user_id="1000858" subject="Created Service Request" doc_id="10041" doc_ref="JFUF" app_id="690" login_id="-1" resp_id="-1" /> <item> <item_destination> <media_type><email>[email protected]</email></media_type> </item_destination> <item_content content_id="10057" quantity="1" user_note="VIP Account"> <data> <record> <bind_var bind_type="VARCHAR2" bind_object="firstname">ranjan</bind_var> <bind_var bind_type="VARCHAR2" bind_object="number">7</bind_var> <bind_var bind_type="VARCHAR2" bind_object="sr_number">1234</bind_var> </record> </data> </item_content> </item> </ffm_request>

6-14 Oracle CRM Application Foundation API Reference Guide

Page 303: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

6.4 The Fulfillment APIsThe following public Fulfillment APIs are discussed in this section. They are described in the approximate order of use.

■ Start_Request

■ Get_Content_XML

■ Submit_Request

■ Send_Request

■ Cancel_Request

■ Resubmit_Request

Priority LevelsThe following table lists the priority levels defined as global constants in package JTF_FM_REQUEST_GRP. The default is G_PRIORITY_REGULAR. Unused priority numbers are reserved for future use.

6.4.1 Start_RequestCall the Start_Request first to generate the history request identifier (x_request_id) that is used as the tracking identifier for the fulfillment request.

Procedure SpecificationPROCEDURE Start_Request( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, p_commit IN VARCHAR2 := FND_API.G_FALSE, p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, x_request_id OUT NUMBER

Table 6–9 Priority Levels

Level Number

G_PRIORITY_HIGHEST 1

G_PRIORITY_SPECIALITY_FLAG 6

G_PRIORITY_REGULAR 7

Fulfillment Engine Public APIs 6-15

Page 304: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

);

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Parameter DescriptionsThe following table describes the OUT parameters associated with this API.

6.4.2 Get_Content_XML

Table 6–10 Start Request IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_validation_level NUMBER No This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation occurs.

Table 6–11 Start Request OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_request_id VARCHAR2 The fulfillment request identifier.

Warning: Oracle does not recommend, nor does it support, the creation of XML fulfillment requests by any other means than through these published APIs.

Information on how the XML request is formed is provided solely to facilitate understanding of the fulfillment request process.

6-16 Oracle CRM Application Foundation API Reference Guide

Page 305: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

Use the Get_Content_XML API to generate one, or more, XML <item> elements for a fulfillment request. The content is formed based on the parameters passed to the API, and the API returns the XML <item> as parameter x_content_xml.

This API performs that following tasks:

■ It verifies that the p_content_id, p_media_type, p_content_type and p_request_id parameters were passed to it. If not supplied, the API exits with an unexpected error condition.

■ It forms the XML <item> element using the parameters passed to it.

■ It passes the <item> element back to the calling application using the x_content_xml output parameter.

Fulfillment RequestsYou must use one of the following content types (p_content_type) in creating a valid fulfillment request:

■ QUERY

■ COLLATERAL

■ ATTACHMENT

■ DATA

If any other value than these are passed to it, the Get_Content_XML API exits with an unexpected error.

Note: The Get_Content_XML API generates only one <item> parameter for each API call. If you want to submit multiple content items for a single fulfillment request, then you must do the following:

■ append the x_content_xml content from the previous calls to the current one

■ submit the resulting concatenated x_content_xml string

The Send_Request API takes this parameter and merges it with the XML request that it forms, submitting the complete request to the Request queue.

Fulfillment Engine Public APIs 6-17

Page 306: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

The following table lists example values for the p_content_id and the p_content_nm parameters used with query and collateral fulfillment requests.

The following table lists example values for the p_content_id and the p_content_nm parameters used with attachment fulfillment requests.

An Example <item> XML ElementThe Get_Content_XML API forms the <item> element in the XML fulfillment request. Following is an example of an <item> element generated as part of an attachment fulfillment request, with an email media type. The content_id parameter is required for this API. The <item> element is passed back to the calling application as output parameter x_content_xml.

<item> <item_destination> <media_type>

Table 6–12 Example Parameter Values for Query and Collateral Requests

p_content_id p_content_nm

7008 ADDRESS SELECT

7009 ORDER SHIP HEADER

7010 ORDER INVOICE HEADER

7011 ORDER CONFIRM

7012 ORDER SHIP LINE

7013 ORDER EDIT

7014 ORDER EDIT PROCESS

7015 ORDER SHIP LINE PROCESS

7016 ORDER SHIP HEADER PROCESS

Table 6–13 Example Parameter Values for Attachment Requests

p_content_id p_content_nm

20281 /appltop02/115/ar/11.5.0/help/US/AR00062648.htm

25567 /appltop02/115/gmd/11.5.0/help/US/FMsrchrplz.htm

25570 /appltop02/115/gmd/11.5.0/help/US/FMsuce.htm

25573 /appltop02/115/gmd/11.5.0/help/US/FMsuerau.htm

6-18 Oracle CRM Application Foundation API Reference Guide

Page 307: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

<email>[email protected]</email> </media_type> </item_destination> <item_content content_id="25570" content_nm="/appltop02/115/gmd/11.5.0/help/US/FMsuce.htm" quantity="1" usernote="As requested."> <attachment></attachment> </item_content></item>

Procedure SpecificationPROCEDURE Get_Content_XML( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, p_commit IN VARCHAR2 := FND_API.G_FALSE, p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_content_id IN NUMBER, p_content_nm IN VARCHAR2 := FND_API.G_MISS_CHAR, p_document_type IN VARCHAR2 := FND_API.G_MISS_CHAR, -- depreciated p_quantity IN NUMBER := 1, p_media_type IN VARCHAR2, p_email IN VARCHAR2 := FND_API.G_MISS_CHAR, p_fax IN VARCHAR2 := FND_API.G_MISS_CHAR, p_user_note IN VARCHAR2 := FND_API.G_MISS_CHAR, p_content_type IN VARCHAR2, p_bind_var IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, p_bind_val IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, p_bind_var_type IN G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL, p_request_id IN NUMBER, x_content_xml OUT VARCHAR2);

Current Version1.0

Fulfillment Engine Public APIs 6-19

Page 308: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 6–14 Get Content XML IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_validation_level NUMBER No This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation is performed.

p_content_id NUMBER Yes This is a unique numeric identifier associated with p_content_nm. If not provided in the current API call, an error message is generated and the API exits.

The content_id attribute is used by the <item><item_content> element.

See Fulfillment Requests on page 6-17 for details.

p_content_nm VARCHAR2 No One of the following:

■ Order information for query and collateral requests

■ Path and file name for attachment requests

The content_nm attribute is used by the <item><item_content> element.

See Fulfillment Requests on page 6-17 for details.

p_document_type VARCHAR2 No Deprecated, currently unused.

p_quantity NUMBER Yes Quantity of the content to be sent (set always to 1). The quantity attribute is used by the <item><item_content> element.

6-20 Oracle CRM Application Foundation API Reference Guide

Page 309: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

p_media_type VARCHAR2 Yes Media type of the content generated by the Get_Content_XML API:

■ FAX

■ EMAIL

If not provided in the current API call, an error message is generated and the API exits.

p_email VARCHAR2 No Supplied email address, if p_media_type is EMAIL.

p_fax VARCHAR2 No Supplied fax address, if p_media_type is FAX.

p_user_note VARCHAR2 No Any note that the agent wants to attach: the user_note attribute is used by the <item><item_content> element.

p_content_type VARCHAR2 Yes Valid content types are:

■ QUERY

■ COLLATERAL

■ ATTACHMENT

■ DATA

If not provided in the current API call, an error message is generated and the API exits.

This parameter is used to select the content type for the <item><item_content> element.

p_bind_var G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL

No Used with QUERY and DATA fulfillment requests.

The <bind_var> element is a sub element of the <item> element.

Table 6–14 Get Content XML IN Parameters

Parameter Data Type Required Descriptions and Validations

Fulfillment Engine Public APIs 6-21

Page 310: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

The following table describes the OUT parameters associated with this API.

6.4.3 Submit_RequestUse the Submit_Request procedure to submit a single new fulfillment request to the Fulfillment engine. This API calls the Send_Request API.

■ See Section 6.4.4, "Send_Request" on page 6-26 for details of that API.

■ See Section 6.3, "Forming an XML Request" on page 6-7 for details on creating the XML fulfillment request.

p_bind_val G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL

No Used with QUERY and DATA fulfillment requests.

The bind_object attribute is used by the <item><bind_var> element.

p_bind_var_type G_VARCHAR_TBL_TYPE := L_VARCHAR_TBL

No Used with QUERY and DATA fulfillment requests.

The bind_var attribute is used by the <item><bind_var> element.

p_request_id NUMBER Yes This unique identifier for the fulfillment request is generated by the Start_Request API. If not provided in the current API call, an error message is generated and the API exits.

The request_id attribute is used by the <ffm_request> element.

Table 6–15 Get Content XML OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_content_xml VARCHAR2 Output content XML (one, or more <item> elements).

Table 6–14 Get Content XML IN Parameters

Parameter Data Type Required Descriptions and Validations

6-22 Oracle CRM Application Foundation API Reference Guide

Page 311: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

Procedure Specification PROCEDURE Submit_Request( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, p_commit IN VARCHAR2 := FND_API.G_FALSE, p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_template_id IN NUMBER := FND_API.G_MISS_NUM, p_subject IN VARCHAR2 := FND_API.G_MISS_CHAR, p_party_id IN NUMBER := FND_API.G_MISS_NUM, p_party_name IN VARCHAR2 := FND_API.G_MISS_CHAR, p_user_id IN NUMBER, p_priority IN NUMBER := G_PRIORITY_REGULAR, p_source_code_id IN NUMBER := FND_API.G_MISS_NUM, p_source_code IN VARCHAR2 := FND_API.G_MISS_CHAR, p_object_type IN VARCHAR2 := FND_API.G_MISS_CHAR, p_object_id IN NUMBER := FND_API.G_MISS_NUM, p_order_id IN NUMBER := FND_API.G_MISS_NUM, p_doc_id IN NUMBER := FND_API.G_MISS_NUM, p_doc_ref IN VARCHAR2 := FND_API.G_MISS_CHAR, p_server_id IN NUMBER := FND_API.G_MISS_NUM, p_queue_response IN VARCHAR2 := FND_API.G_FALSE, p_extended_header IN VARCHAR2 := FND_API.G_MISS_CHAR, p_content_xml IN VARCHAR2, p_request_id IN NUMBER);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 6–16 Submit Request IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes The api_version attribute is used by the <ffm_request> element.

See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

Fulfillment Engine Public APIs 6-23

Page 312: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_validation_level NUMBER This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation occurs.

p_template_id VARCHAR2 No The Fulfillment request template identifier, (request templates are predefined and stored in the database). This value is NULL if the request does not correspond to a predefined template.

The template attribute is used by the <ffm_request> element.

p_subject VARCHAR2 Yes The subject attribute is used by the <app_info> element.

p_party_id NUMBER Yes The customer numeric identifier: the party_ id attribute is used by the <app_info> element.

p_party_name VARCHAR2 Yes Customer name: the party_name attribute is used by the <app_info> element.

p_user_id NUMBER Yes Agent or user identifier: the user_id attribute is used by the <app_info> element.

p_priority NUMBER Yes The priority for this fulfillment request: the priority attribute is used by the <ffm_request> element.

See The Fulfillment APIs, on page 6-15.

p_source_code_id VARCHAR2 No Campaign or promotion field: the source_code_id attribute is used by the <app_info> element.

p_source_code VARCHAR2 No Campaign or promotion field: the source_code attribute is used by the <app_info> element.

p_object_type VARCHAR2 No Campaign or promotion field: the object_type attribute is used by the <app_info> element.

p_object_id VARCHAR2 No Campaign or promotion field:the object_id attribute is used by the <app_info> element.

p_order_id VARCHAR2 No Unique identifier of the field: the order_id attribute is used by the <app_info> element.

p_doc_id NUMBER No Document identifier, if not provided, set to p_request_id: the doc_id attribute is used by the <app_info> element.

Table 6–16 Submit Request IN Parameters

Parameter Data Type Required Descriptions and Validations

6-24 Oracle CRM Application Foundation API Reference Guide

Page 313: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

p_doc_ref VARCHAR2 No Document reference, if not provided, set to JFUF (1-to-1 Fulfillment): the doc_ref attribute is used by the <app_info> element.

p_server_id VARCHAR2 Yes Unique identifier of the Fulfillment server. It is the primary key of table JTF_FM_SERVICE. This value determines the queue into which the request is to be placed.

p_queue_response VARCHAR2 No Boolean value: Used to specify if the response needs to be queued in the Response queue:

■ TRUE: Put the response for this request on the response queue. Applications listening for a response on the AQ response queue can use this feature.

■ FALSE: (Default) Do not put information on the response queue.

The queue_response attribute is used by the <ffm_request> element.

p_extended_header VARCHAR2 No Use to insert a character string in the form of one or more <extended_header> elements into the XML request.

The <extended_header> element is used by the <app_info> element.

p_content_xml VARCHAR2 Yes The XML content formed by calling the Get_Content_XML API. This content is merged with that generated by the Send_Request API to create the final XML request.

The p_content_xml parameters forms the <item> element.

p_request_id NUMBER Yes This unique identifier for the fulfillment request is generated by the Start_Request API. If not provided in the current API call, an error message is generated and the API exits.

The request_id attribute is used by the <ffm_request> element.

Table 6–16 Submit Request IN Parameters

Parameter Data Type Required Descriptions and Validations

Fulfillment Engine Public APIs 6-25

Page 314: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

The following table describes the OUT parameters associated with this API.

6.4.4 Send_RequestThe Send_Request procedure is called internally by the Submit_Request API. It creates the final XML document.

Parameter p_previewThe p_preview parameter provides the ability to preview a fulfillment request before sending it to its destination. You can preview a fulfillment request through the Fulfillment Administrator Console. You can also submit or delete the request through the Administrator Console.

Previewing allows for a visual inspection of a fulfillment request prior to deciding to send or cancel it. Viewing the preview through a browser also gives the option of printing through the browser. Printing a previewed request through a browser does not remove the request from the status table.

The value of p_preview determines whether the request is to be immediately dispatched, or stored in the database to be visually inspected.

■ If p_preview is set to TRUE, then the request is marked as PREVIEW, and written to the Request queue, but not dispatched.

■ If p_preview is set to FALSE, then the request is written to the Request queue, and dispatched in the usual fashion.

Table 6–17 Submit Request OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Note: The fulfillment request is written to the Request queue regardless of the value set for parameter p_preview.

6-26 Oracle CRM Application Foundation API Reference Guide

Page 315: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

Submitting a Fulfillment RequestWhen a fulfillment request is submitted by the Submit_Request API, the Send_Request API performs the following tasks:

■ It forms the <ffm_request> and <app_info> XML request elements.

■ It merges the <item> element (the p_content_xml parameter) into the fulfillment request.

■ It sends the fully formed XML request to the Request queue.

■ It updates the history and status tables in the database.

See Section 6.3, "Forming an XML Request" on page 6-7 for details on how XML requests are formed.

Procedure SpecificationPROCEDURE Send_Request( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, p_commit IN VARCHAR2 := FND_API.G_FALSE, p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_template_id IN NUMBER := FND_API.G_MISS_NUM, p_subject IN VARCHAR2 := FND_API.G_MISS_CHAR, p_party_id IN NUMBER := FND_API.G_MISS_NUM, p_party_name IN VARCHAR2 := FND_API.G_MISS_CHAR, p_user_id IN NUMBER, p_priority IN NUMBER := G_PRIORITY_REGULAR, p_source_code_id IN NUMBER := FND_API.G_MISS_NUM, p_source_code IN VARCHAR2 := FND_API.G_MISS_CHAR, p_object_type IN VARCHAR2 := FND_API.G_MISS_CHAR, p_object_id IN NUMBER := FND_API.G_MISS_NUM, p_order_id IN NUMBER := FND_API.G_MISS_NUM, p_doc_id IN NUMBER := FND_API.G_MISS_NUM, p_doc_ref IN VARCHAR2 := FND_API.G_MISS_CHAR, p_server_id IN NUMBER := FND_API.G_MISS_NUM,

Note: The content generated by the Get_Content_XML is inserted into the final XML document formed by the Send_Request API, and then placed on the Advanced Queue.

Fulfillment Engine Public APIs 6-27

Page 316: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

p_queue_response IN VARCHAR2 := FND_API.G_FALSE, p_extended_header IN VARCHAR2 := FND_API.G_MISS_CHAR, p_content_xml IN VARCHAR2, p_request_id IN NUMBER, p_preview IN VARCHAR2 := FND_API.G_FALSE);

Current Version1.0

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

Table 6–18 Send Request IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_validation_level

NUMBER This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation is performed.

p_template_id VARCHAR2 The Fulfillment request template identifier, (request templates are predefined and stored in the database). This value is null if the request does not correspond to a predefined template.

The template attribute is used by the <ffm_request> element.

p_subject VARCHAR2 Yes The subject attribute is used by the <app_info> element.

p_party_id NUMBER Yes The customer numeric identifier: the party_ id attribute is used by the <app_info> element.

6-28 Oracle CRM Application Foundation API Reference Guide

Page 317: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

p_party_name VARCHAR2 Yes Customer name: the party_name attribute is used by the <app_info> element.

p_user_id NUMBER Yes Agent or user identifier: the user_id attribute is used by the <app_info> element.

p_priority NUMBER No The priority for this fulfillment request: the priority attribute is used by the <ffm_request> element.

See The Fulfillment APIs, on page 6-15.

p_source_code_id

VARCHAR2 No Campaign or promotion field: the source_code_id attribute is used by the <app_info> element.

p_source_code VARCHAR2 No Campaign or promotion field: the source_code attribute is used by the <app_info> element.

p_object_type VARCHAR2 No Campaign or promotion field: the object_type attribute is used by the <app_info> element.

p_object_id VARCHAR2 No Campaign or promotion field: the object_id attribute is used by the <app_info> element.

p_order_id VARCHAR2 No Unique identifier of the order: the order_id attribute is used by the <app_info> element.

p_doc_id NUMBER No Document identifier, if not provided, set to p_request_id: the doc_id attribute is used by the <app_info> element.

p_doc_ref VARCHAR2 No Document reference, if not provided, set to JFUF (1-to-1 Fulfillment): the doc_ref attribute is used by the <app_info> element.

p_server_id VARCHAR2 Yes Unique identifier of the Fulfillment server. It is the primary key of table JTF_FM_SERVICE. This value determines the fulfillment request queue.

Table 6–18 Send Request IN Parameters

Parameter Data Type Required Descriptions and Validations

Fulfillment Engine Public APIs 6-29

Page 318: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

p_queue_response

VARCHAR2 No Boolean value: Used to specify if the response needs to be queued in the Response queue:

■ TRUE: Put the response for this request on the response queue. Applications listening for a response on the AQ response queue can use this feature.

■ FALSE: (Default) Do not put information on the response queue.

The queue_response attribute is used by the <ffm_request> element.

p_extended_header

VARCHAR2 No Use to insert a character string in the form of one or more <extended_header> elements into the XML request.

The <extended_header> element is used by the <app_info> element.

p_content_xml VARCHAR2 Yes The XML content formed by calling the Get_Content_XML API. This content is merged with that generated by the Send_Request API to create the final XML request.

The p_content_xml parameters forms the <item> element.

p_request_id NUMBER Yes This unique identifier for the fulfillment request is generated by the Start_Request API. If not provided in the current API call, an error message is generated and the API exits.

The request_id attribute is used by the <ffm_request> element.

p_preview VARCHAR2 Yes Boolean value: Used to specify whether or not this is a preview request:

■ TRUE: Preview this document.

■ FALSE: Do not preview this document, instead send it to the Fulfillment Request queue.

Table 6–18 Send Request IN Parameters

Parameter Data Type Required Descriptions and Validations

6-30 Oracle CRM Application Foundation API Reference Guide

Page 319: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

The following table describes the OUT parameters associated with this API.

6.4.5 Cancel_RequestUse the Cancel_Request API to cancel a fulfillment request that is already in the system. Only messages that are still in the Request queue can be cancelled. Once the fulfillment engine dequeues the message from the queue, it is no longer possible to cancel the fulfillment request.

This API performs the following tasks:

■ It determines the name of the request queue for the request to be canceled, based on the server identifier.

■ It removes the fulfillment request from the request queue.

■ It deletes the entry for that particular fulfillment request from the status table.

■ It sets the outcome code in the fulfillment request history table to CANCELLED.

Procedure Specification PROCEDURE Cancel_Request( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, p_commit IN VARCHAR2 := FND_API.G_FALSE, p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_request_id IN NUMBER, p_submit_dt_tm IN DATE := FND_API.G_MISS_DATE);

Current Version1.0

Table 6–19 Send Request OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

Fulfillment Engine Public APIs 6-31

Page 320: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

The following table describes the OUT parameters associated with this API.

Table 6–20 Cancel Request IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 No See "Standard IN Parameters" on page 1-2.

p_validation_level

NUMBER No This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation is performed.

p_request_id VARCHAR2 Yes This unique identifier for the fulfillment request is generated by the Start_Request API. If not provided in the current API call, an error message is generated and the API exits.

The request_id attribute is used by the <ffm_request> element.

p_submit_dt_tm DATE No Date and timestamp of the request submission.

Table 6–21 Cancel Request OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

6-32 Oracle CRM Application Foundation API Reference Guide

Page 321: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

The Fulfillment APIs

6.4.6 Resubmit_RequestUse the Resubmit_Request procedure to resubmit a fulfillment request that failed due to a configuration or database error.

This API performs the following tasks:

■ It verifies that the fulfillment request to be resubmitted exists in the system, and retrieves the fulfillment request from the request history table, based on the request identifier, p_request_id.

■ It determines the name of the request queue for the request, based on the server identifier, p_server_id.

■ It updates the time stamp (to SYSDATE), and sets the status to RESUBMITTED_REQUEST in the request XML.

■ It sends the modified request to the Request queue.

■ It sets the outcome code to RESUBMITTED, and increments by one the resubmit count in the request history record.

■ It inserts new status and history records into the database.

Procedure Specification PROCEDURE Resubmit_Request( p_api_version IN NUMBER, p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE, p_commit IN VARCHAR2 := FND_API.G_FALSE, p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL, x_return_status OUT VARCHAR2, x_msg_count OUT NUMBER, x_msg_data OUT VARCHAR2, p_request_id IN NUMBER);

Current Version1.0

Note: As the API retrieves the XML request from the database, you cannot modify a fulfillment request and resubmit it. Use this API only to submit the same request again.

Fulfillment Engine Public APIs 6-33

Page 322: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

Parameter DescriptionsThe following table describes the IN parameters associated with this API.

The following table describes the OUT parameters associated with this API.

6.5 Messages and NotificationsThe APIs contained in package JTF_FM_REQUEST_GRP generate messages and notifications as needed. Some of these messages are common to all of the

Table 6–22 Resubmit Request IN Parameters

Parameter Data Type Required Descriptions and Validations

p_api_version NUMBER Yes See "Standard IN Parameters" on page 1-2.

p_init_msg_list VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_commit VARCHAR2 Yes See "Standard IN Parameters" on page 1-2.

p_validation_level

NUMBER Yes This values determines whether validation should occur or not. This variable is checked against FND_API.G_VALID_LEVEL_NONE and if it is greater than the latter, validation is performed.

p_request_id NUMBER Yes This unique identifier for the fulfillment request is generated by the Start_Request API. If not provided in the current API call, an error message is generated and the API exits.

The request_id attribute is used by the <ffm_request> element.

Table 6–23 Resubmit Request OUT Parameters

Parameter Data Type Description

x_return_status VARCHAR2 See "Standard OUT Parameters" on page 1-3.

x_msg_count NUMBER See "Standard OUT Parameters" on page 1-3.

x_msg_data VARCHAR2 See "Standard OUT Parameters" on page 1-3.

6-34 Oracle CRM Application Foundation API Reference Guide

Page 323: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

Fulfillment APIs and others are generated by specific Fulfillment APIs. Both types of messages are detailed in the following sections.

■ Common Status Messages

■ Status Messages for Get_Content_XML

■ Status Messages for Send_Request

■ Status Messages for Cancel_Request

6.5.1 Common MessagesThe following table lists the messages and notifications generated by many of the APIs contained in package JTF_FM_REQUEST_GRP.

Note: It is not required that all status notifications provide a number identifier along with the message, although, in many cases, it is provided.

Table 6–24 Common Status Messages

Number Type Name Text

210925 E JTF_FM_API_QUEUE_NOT_FOUND Could not find queue names for Server ID &ARG1.

210927 E JTF_FM_API_REQUEST_NOTFOUND Could not find fulfillment request for Request ID &ARG1 in the database.

210932 E JTF_FM_API_MISSING_REQUEST_ID Value for Request ID cannot be NULL.

210939 E JTF_FM_API_DEBUG_MESSSAGE 1-to-1 Fulfillment API: &ARG1.

210940 S JTF_FM_API_SUCCESS_MESSAGE The &ARG1 API has completed successfully.

Fulfillment Engine Public APIs 6-35

Page 324: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Messages and Notifications

6.5.2 Get_Content_XMLThe following table lists the messages and notifications generated by the Get_Content_XML API.

6.5.3 Send_RequestThe following table lists the messages and notifications generated by the Send_Request API.

Table 6–25 Status Messages for Get_Content_XML

Number Type Name Text

210922 E JTF_FM_API_INVALID_MEDIATYPE Invalid media type &ARG1 passed for Content ID &ARG2. Allowed media types are EMAIL and FAX.

210923 E JTF_FM_API_MULTIPLE_MEDIATYPE Multiple media types were passed for Content ID = &ARG1. Only one media type is allowed for each content.

210924 E JTF_FM_API_INVALID_CONTENT Invalid content type &ARG1 passed for Content ID &ARG2. Allowed content types are QUERY, COLLATERAL, ATTACHMENT or DATA.

210929 JTF_FM_API_MISSING_CONTENT_ID Value for Content ID cannot be NULL.

210930 E JTF_FM_API_MISSING_MEDIA_TYPE Value for Media Type cannot be NULL.

210931 E JTF_FM_API_MISSING_CONTENTTYPE Value for Content Type cannot be NULL.

210974 E JTF_FM_DISP_CONTENT_NOT_FOUND Cannot find document for Content ID &ARG1.

Table 6–26 Status Messages for Send_Request

Number Type Name Text

210933 E JTF_FM_API_MISSING_USER_ID Value for User ID cannot be NULL.

210934 E JTF_FM_API_MISSING_SERVER_ID Value for Server ID cannot be NULL.

210936 E JTF_FM_API_MISSING_CONTENT_XML Value for Content XML cannot be NULL.

210942 E JTF_FM_API_REQUESTID_REUSED Cannot use a previously submitted request ID to submit a new request.

210985 E JTF_FM_API_NOT_PREVIEWED The request submitted for preview has not been previewed.

6-36 Oracle CRM Application Foundation API Reference Guide

Page 325: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

6.5.4 Cancel_RequestThe following table lists the messages and notifications generated by the

Cancel_Request API.

6.6 Sample CodeThis section contains SQL scripts that call the Fulfillment public APIs contained in the JTF_FM_REQUEST_GRP package and insert the required values.

6.6.1 Package JTF_FM_REQUEST_GRPThe SQL scripts in this section perform the required sequential steps for building and submitting a fulfillment request. Some scripts perform optional procedures such as cancelling or resubmitting a fulfillment request.

6.6.1.1 Send DocumentThis script sends the document l_content_id &1 to the user, l_email &5 using the following arguments:

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

210986 E JTF_FM_API_ALREADY_PREVIEWED The request submitted for preview has already been previewed.

210987 S JTF_FM_API_PREVIEWED_SUBMITTED The request for preview has been submitted.

Table 6–27 Status Messages for Cancel_Request

Number Type Name Text

210928 E JTF_FM_API_CANCEL_FAILED The request could not be cancelled.

210943 S JTF_FM_API_CANCEL_SUCCESS The request(s) in the queue has been successfully cancelled.

Table 6–26 Status Messages for Send_Request

Number Type Name Text

Fulfillment Engine Public APIs 6-37

Page 326: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for ih history

DECLARE

l_api_version NUMBER := 1.0;l_commit VARCHAR2(5) := FND_API.G_TRUE;-- l_content_id VARCHAR2(30) ;l_media_type VARCHAR2(30) ;l_request_type VARCHAR2(20) ;l_user_note VARCHAR2(1000);l_document_type VARCHAR2(150); -- l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;--l_template_id NUMBER;l_party_id NUMBER;l_user_id NUMBER;l_server_id NUMBER;l_request_id NUMBER;l_subject VARCHAR2(100);--l_msg_count NUMBER;l_msg_data VARCHAR2(1000);l_return_status VARCHAR2(1000);l_content_xml1 VARCHAR2(1000);l_content_xml VARCHAR2(10000);l_content_nm VARCHAR2(100);l_email VARCHAR2(100);l_fax VARCHAR2(100); --l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.

6-38 Oracle CRM Application Foundation API Reference Guide

Page 327: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. -- this does not need anything.it just sends the email . l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1);

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count);

Fulfillment Engine Public APIs 6-39

Page 328: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

-- Initialize Parameters for submitting the fulfillment request

-- Added request id to extended header to help in debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.2 2 Send Document with Bind VariablesThis script sends the document l_content_id &1 to the user, l_email &5 with bind variables, using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Sender's email address

■ p_userId &6 arg 6 User ID from fnd_users

6-40 Oracle CRM Application Foundation API Reference Guide

Page 329: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties from Interaction History

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,

Fulfillment Engine Public APIs 6-41

Page 330: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the bind variables for Master Document. l_bind_var(1) := 'cust_no';l_bind_var_type(1) := 'NUMBER';l_bind_val(1) := '12345'; l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML ( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

6-42 Oracle CRM Application Foundation API Reference Guide

Page 331: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-- Initialize Parameters for submitting the fulfillment request

-- added extended header to aid in debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.3 Send Compressed DocumentThis script sends a compressed (.zip) version of the file: l_content_id &1 with images to the user, l_email &5 without bind variables or a query, using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType: &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

Fulfillment Engine Public APIs 6-43

Page 332: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for Interaction History

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_extended_header VARCHAR2(1000); l_fax VARCHAR2(100);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,

6-44 Oracle CRM Application Foundation API Reference Guide

Page 333: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data); ---- Initialize Parameters for submitting the fulfillment request

Fulfillment Engine Public APIs 6-45

Page 334: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_extended_header := '<extended_header><header_name>request id</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_request_id => l_request_id, p_extended_header => l_extended_header );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.4 Send Compressed File with Image and Bind VariablesThis script sends a compressed (.zip) version of the l_content_id &1 file with an image and bind variables to the user, l_email &5 using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for ih history

6-46 Oracle CRM Application Foundation API Reference Guide

Page 335: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

Fulfillment Engine Public APIs 6-47

Page 336: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. l_bind_var(1) := 'person_first_name';l_bind_var_type(1) := 'NUMBER';l_bind_val(1) := '12345'; l_user_note := 'Please dont hesitate to call at 1-800-INFODSK.';

l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5', p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

6-48 Oracle CRM Application Foundation API Reference Guide

Page 337: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

---- Initialize Parameters for submitting the fulfillment request

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8, p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.5 Send Document with QueryThis script sends the l_content_id &1 document with a query to the user, l_email &5 using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for Interaction History

Fulfillment Engine Public APIs 6-49

Page 338: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

6-50 Oracle CRM Application Foundation API Reference Guide

Page 339: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-- Initialize the parameters for Master Document. l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data); -- Initialize Parameters for submitting the fulfillment request

-- added request id to extended header to aid debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,

Fulfillment Engine Public APIs 6-51

Page 340: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.6 Send Document with Bind Variables and QueryThis script sends the l_content_id &1 document with a bind variable and a query to the user l_email &5 using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 party_id from hz_parties for Interaction History

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30);

6-52 Oracle CRM Application Foundation API Reference Guide

Page 341: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';

l_bind_var(1) := 'p_party_id';l_bind_var_type(1) := 'NUMBER';l_bind_val(1) := 10000 ;

Fulfillment Engine Public APIs 6-53

Page 342: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data); -- Initialize Parameters for submitting the fulfillment request

-- added resuest id to extended header to aid in debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,

6-54 Oracle CRM Application Foundation API Reference Guide

Page 343: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.7 Send compressed file with master document, query, bind variable, and imageThis script sends a compressed (.zip) version of the l_content_id &1 file with a master document, a query, a bind variable and an image to the user, l_email &5 using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for Interaction History

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; --

Fulfillment Engine Public APIs 6-55

Page 344: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';

l_bind_var(1) := 'p_party_id';

6-56 Oracle CRM Application Foundation API Reference Guide

Page 345: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_bind_var_type(1) := 'NUMBER';l_bind_val(1) := 10000 ;

l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

-- Initialize Parameters for submitting the fulfillment request -- added request id to extended header to aid in debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,

Fulfillment Engine Public APIs 6-57

Page 346: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.8 Send Document with a Query that Returns Multiple RowsThis script sends the l_content_id &1 document with a query that returns multiple rows to the user, l_email &5 using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for Interaction History

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30);

6-58 Oracle CRM Application Foundation API Reference Guide

Page 347: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000); BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with

Fulfillment Engine Public APIs 6-59

Page 348: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

-- Initialize Parameters for submitting the fulfillment request -- added request id to extended header to aid debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&7',p_party_id => &8,p_user_id => &6,

6-60 Oracle CRM Application Foundation API Reference Guide

Page 349: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.9 Send Multiple DocumentsThis script sends the master document, l_content_id &1 and two additional documents to the user, l_email &5 using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for Interaction History

DECLARE

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ;

Fulfillment Engine Public APIs 6-61

Page 350: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_party_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); -- l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(1000); l_content_xml2 VARCHAR2(1000); l_content_xml3 VARCHAR2(1000); l_content_xml VARCHAR2(10000); l_content_nm VARCHAR2(100); l_email VARCHAR2(100); l_fax VARCHAR2(100); l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. -- this does not need anything.it just sends the email . l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';

l_bind_var(1) := 'cust_no'; l_bind_val(1) := 12345; l_bind_var_type(1) := 'NUMBER';

6-62 Oracle CRM Application Foundation API Reference Guide

Page 351: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_fax := '9999999999'; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1 );

-- The output XML string is stored in a local variable -- which is concatenated with the others before submission

-- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &6, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,

Fulfillment Engine Public APIs 6-63

Page 352: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml2 );

-- The output XML string is stored in a local variable -- which is concatenated with the others before submission

-- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &7, p_content_nm => l_content_nm, p_document_type => '&3', p_media_type => '&2',p_email => '&5',p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml3);

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1 || l_content_xml2 || l_content_xml3;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

-- Initialize Parameters for submitting the fulfillment request

-- added extended header to aid in debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

6-64 Oracle CRM Application Foundation API Reference Guide

Page 353: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

-- Submit the fulfillment request JTF_FM_REQUEST_GRP.Submit_Request ( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&9',p_party_id => &10,p_user_id => '&8',p_queue_response => FND_API.G_TRUE, p_content_xml => l_content_xml, p_extended_header => l_extended_header, p_request_id => l_request_id );

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data);

END;/

6.6.1.10 Send Document as AttachmentThis script sends the l_content_id &1 document the user, l_email &5 as an attachment using the following arguments:

■ p_contentId &1 arg 1 Master Document Item id

■ p_mediaType &2 arg 2 EMAIL, FAX

■ p_docType &3 arg 3 HTM, ZIP

■ p_requestType &4 arg 4 QUERY, DATA, ATTACHMENT

■ p_email &5 arg 5 Email address to send to

■ p_userId &6 arg 6 user id from fnd_users

■ p_subject &7 arg 7 Free form text subject line.

■ p_party_id &8 arg 8 Party_id from hz_parties for Interaction History

DECLARE

Fulfillment Engine Public APIs 6-65

Page 354: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_api_version NUMBER := 1.0; l_commit VARCHAR2(5) := FND_API.G_TRUE; -- l_content_id VARCHAR2(30); l_media_type VARCHAR2(30); l_request_type VARCHAR2(20); l_user_note VARCHAR2(1000); l_document_type VARCHAR2(150); l_bind_var JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_var_type JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; l_bind_val JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE ; -- l_template_id NUMBER; l_user_id NUMBER; l_server_id NUMBER; l_request_id NUMBER; l_subject VARCHAR2(100); l_list_type VARCHAR2(100); -- l_msg_count NUMBER; j NUMBER;

l_msg_index_out NUMBER; l_msg_data VARCHAR2(5000); l_return_status VARCHAR2(1000); l_content_xml1 VARCHAR2(4000); l_content_xml VARCHAR2(4000); l_content_nm VARCHAR2(100); l_mass_party_id JTF_FM_REQUEST_GRP.G_NUMBER_TBL_TYPE; l_mass_email JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE; l_mass_fax JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE; l_mass_party_name JTF_FM_REQUEST_GRP.G_VARCHAR_TBL_TYPE;

l_extended_header VARCHAR2(1000);

BEGIN

-- Start the fulfillment request. The output request_id must be passed-- to all subsequent calls made for this request.JTF_FM_REQUEST_GRP.Start_Request(p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,

6-66 Oracle CRM Application Foundation API Reference Guide

Page 355: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

x_msg_data => l_msg_data,x_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Request_ID: '||to_char(l_request_id));

-- Initialize the parameters for Master Document. l_user_note := 'Please do not hesitate to call at 1-800-INFODSK.';l_bind_var(1) := 'p_party_id';l_bind_var_type(1) := 'NUMBER';l_bind_val(1) := 10000; -- This call gets the XML string for the content(Master Document) with-- the parameters as defined aboveJTF_FM_REQUEST_GRP.Get_Content_XML( p_api_version => l_api_version,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_content_id => &1,p_content_nm => l_content_nm,--p_document_type => l_document_type,p_media_type => '&2',-- p_email => l_email,-- p_fax => l_fax,p_user_note => l_user_note, p_content_type => '&4',p_bind_var => l_bind_var,p_bind_val => l_bind_val,p_bind_var_type => l_bind_var_type,p_request_id => l_request_id,x_content_xml => l_content_xml1);

-- The output XML string is stored in a local variable l_content_xml := l_content_xml1;

-- Check the return status DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count); DBMS_OUTPUT.PUT_LINE('Message Data: '||l_msg_data); -- -- Initialize Parameters for submitting the fulfillment requestl_mass_party_id(1) := 1000;

Fulfillment Engine Public APIs 6-67

Page 356: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

l_mass_party_name(1) := 'Test Name';l_mass_email(1) := '[email protected]'; --l_mass_fax(1) := '7087966';l_mass_party_id(2) := 1000;l_mass_party_name(2) := 'Test Name';l_mass_email(2) := '[email protected]';--l_mass_fax(2) := '7087966';l_list_type := 'ADDRESS';

-- added extended header to aid in debugging l_extended_header := '<extended_header><header_name>Request ID</header_name><header_value>' || to_char(l_request_id) || '</header_value></extended_header>';

l_extended_header := l_extended_header || '<extended_header><header_name>Party ID 1 </header_name><header_value>' || to_char(l_mass_party_id(1)) || '</header_value></extended_header>';

l_extended_header := l_extended_header || '<extended_header><header_name>Party ID 2 </header_name><header_value>' || to_char(l_mass_party_id(2)) || '</header_value></extended_header>';

-- Submit the fulfillment requestJTF_FM_REQUEST_GRP.Submit_Batch_Request( p_api_version => l_api_version,p_commit => l_commit,x_return_status => l_return_status,x_msg_count => l_msg_count,x_msg_data => l_msg_data,p_subject => '&6',p_user_id => &5,p_party_id => l_mass_party_id,p_party_name => l_mass_party_name,p_email => l_mass_email,p_fax => l_mass_fax,p_server_id => l_server_id, p_content_xml => l_content_xml,p_list_type => l_list_type, p_extended_header => l_extended_header, p_per_user_history => FND_API.G_TRUE, p_request_id => l_request_id);

DBMS_OUTPUT.PUT_LINE('Return Status: '||l_return_status); DBMS_OUTPUT.PUT_LINE('Message_Count: '||l_msg_count);

IF l_return_status != 'S' AND (l_msg_count >= 1) THEN

6-68 Oracle CRM Application Foundation API Reference Guide

Page 357: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

FOR j in 1..l_msg_count LOOP FND_MSG_PUB.Get(p_msg_index => j, p_encoded => fnd_api.g_false, p_data => l_msg_data, p_msg_index_out => l_msg_index_out); DBMS_OUTPUT.PUT_LINE('OutMessage: ' || l_msg_data); END LOOP; END IF;END;/

Fulfillment Engine Public APIs 6-69

Page 358: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Sample Code

6-70 Oracle CRM Application Foundation API Reference Guide

Page 359: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Index

AActivity Record Type, 2-5Add Activity, 2-19

Parameter Descriptions, 2-41Procedure Specification, 2-41

Add Media Lifecycle, 2-19Parameter Descriptions, 2-31Procedure Specification, 2-30

CCancel Request

Parameter Descriptions, 6-32Procedure Specification, 6-31

Close Interaction, 2-19Parameter Descriptions, 2-47Procedure Specification, 2-47

Close Media Item, 2-19Parameter Descriptions, 2-35Procedure Specification, 2-34

Create Interaction, 2-9Parameter Descriptions, 2-15Procedure Specification, 2-14

Create Media Item, 2-8Parameter Descriptions, 2-11Procedure Specification, 2-11

Create Media Lifecycle, 2-9Parameter Descriptions, 2-13Procedure Specification, 2-12

Create Note, 5-2, 5-5Parameter Descriptions, 5-8Procedure Specification, 5-6

Create Resource, 3-3, 3-32

Parameter Descriptions, 3-5Procedure Specification, 3-3

Create Resource Group, 3-19Parameter Descriptions, 3-20Procedure Specification, 3-19

Create SalesRep, 3-24Parameter Descriptions, 3-25Procedure Specification, 3-24

Create Task, 4-2, 4-5, 4-9Parameter Descriptions, 4-11Procedure Specification, 4-9

Create Task Assignment, 4-2, 4-29, 4-30Parameter Descriptions, 4-32

Create Task Reference, 4-42, 4-43Parameter Descriptions, 4-44Procedure Specification, 4-43

Create_References, 4-2Customer Interaction, 2-1

Relating Customer Interaction Information, 2-3

DDelete Task, 4-2, 4-5, 4-27

Parameter Descriptions, 4-28Procedure Specification, 4-28

Delete Task Assignment, 4-2, 4-29, 4-40Parameter Descriptions, 4-41Procedure Specification, 4-40

Delete Task Reference, 4-42, 4-49Parameter Descriptions, 4-49Procedure Specification, 4-49

Delete_References, 4-2

Index-1

Page 360: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

FFulfillment

JTF_FM_REQUEST_GRPCancel Request, 6-31Data Structure Specifications, 6-2Get Content XML, 6-16Messages and Notifications, 6-34Resubmit Request, 6-33Send Request, 6-26Start Request, 6-15Submit Request, 6-22

GGet Content XML

Parameter Descriptions, 6-20Procedure Specification, 6-19

Get Interaction Activity Count, 2-49Parameter Descriptions, 2-50Procedure Specification, 2-49

Get Interaction Count, 2-49Parameter Descriptions, 2-52Procedure Specification, 2-51

IInteraction History, 2-1, 6-1

Cached APIs, 2-18Cached Creation APIs, 2-17Counting APIs, 2-49JTF_IH_PUB, 2-4

Activity Record Type, 2-6Add Activity, 2-41, 2-61Add Media Lifecycle, 2-30Close Interaction, 2-47, 2-63Close Media Item, 2-34, 2-58Create Interaction, 2-14Create Media Item, 2-10Create Media Lifecycle, 2-12Data Structure Specifications, 2-5Get Interaction Activity Count, 2-49Get Interaction Count, 2-51Interaction Record Type, 2-5Media Item Lifecycle Record Type, 2-7Media Item Record Type, 2-7

Messages and Notifications, 2-54Open Interaction, 2-36Open Media Item, 2-27, 2-56Update Activity, 2-43, 2-62Update Activity Duration, 2-45Update Interaction, 2-39, 2-60Update Media Item, 2-28, 2-57Update Media Lifecycle, 2-32

Interaction Record Type, 2-5, 5-2Introduction, 1-1

JJTF_FM_REQUEST_GRP, 6-1

Cancel RequestParameter Descriptions, 6-32Procedure Specification, 6-31

Get Content XMLParameter Descriptions, 6-20Procedure Specification, 6-19

Resubmit RequestParameter Descriptions, 6-34Procedure Specification, 6-33

Send RequestParameter Descriptions, 6-28Procedure Specification, 6-27

Start RequestParameter Descriptions, 6-16Procedure Specification, 6-15

Submit RequestParameter Descriptions, 6-23Procedure Specification, 6-23

JTF_IH_PUB, 2-4Add Activity, 2-41

Parameter Descriptions, 2-41Procedure Specification, 2-41

Add Media Lifecycle, 2-30Parameter Descriptions, 2-31Procedure Specification, 2-30

Close Interaction, 2-47Parameter Descriptions, 2-47Procedure Specification, 2-47

Close Media Item, 2-34Parameter Descriptions, 2-35Procedure Specification, 2-34

Index-2

Page 361: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Create Interaction, 2-14, 5-2Parameter Descriptions, 2-15Procedure Specification, 2-14

Create Media Item, 2-10, 5-11Parameter Descriptions, 2-11, 5-12Procedure Specification, 2-11, 5-11

Create Media Lifecycle, 2-12Parameter Descriptions, 2-13Procedure Specification, 2-12

Get Interaction Activity Count, 2-49Parameter Descriptions, 2-50Procedure Specification, 2-49

Get Interaction Count, 2-51Parameter Descriptions, 2-52Procedure Specification, 2-51

Open Interaction, 2-36Parameter Descriptions, 2-37Procedure Specifications, 2-36

Open Media Item, 2-27Parameter Descriptions, 2-27Procedure Specification, 2-27

Update ActivityParameter Descriptions, 2-43Procedure Specification, 2-43

Update Activity Duration, 2-45Parameter Descriptions, 2-45Procedure Specification, 2-45

Update Interaction, 2-39Parameter Descriptions, 2-39Procedure Specification, 2-39

Update Media Item, 2-28Parameter Description, 2-29Procedure Specification, 2-29

Update Media LifecycleParameter Descriptions, 2-33Procedure Specification, 2-32

JTF_NOTES_PUB, 5-1Create Note, 5-5

Parameter Descriptions, 5-8Procedure Specification, 5-6

Update NoteParameter Descriptions, 5-12Procedure Specification, 5-11

JTF_RESOURCES_PUB, 3-1, 3-3Create Resource, 3-1, 3-3, 3-32

Parameter Descriptions, 3-5Procedure Specification, 3-3

Update Resource, 3-1, 3-11Parameter Descriptions, 3-13Procedure Specification, 3-12

JTF_RS_GROUPS_PUB, 3-2, 3-19Create Resource Group, 3-19

Parameter Descriptions, 3-20Procedure Specification, 3-19

Update Resource Group, 3-21Parameter Descriptions, 3-22Procedure Specification, 3-21

JTF_RS_SALESREPS_PUB, 3-2, 3-24Create SalesRep, 3-2, 3-24

Parameter Descriptions, 3-25Procedure Specification, 3-24

Update SalesRep, 3-2, 3-28Parameter Descriptions, 3-29Procedure Specification, 3-28

JTF_TASKS_ASSIGNMENTS_PUB, 4-29Create Task Assignment, 4-30

Parameter Descriptions, 4-32Delete Task Assignment, 4-40

Parameter Descriptions, 4-41Procedure Specification, 4-40

Update Task Assignment, 4-36Parameter Descriptions, 4-37Procedure Specification, 4-36

JTF_TASKS_PUB, 4-5Create Task, 4-9

Parameter Descriptions, 4-11Procedure Specification, 4-9

Delete Task, 4-27Parameter Descriptions, 4-28Procedure Specification, 4-28

Update Task, 4-19Parameter Descriptions, 4-21Procedure Specification, 4-19

JTF_TASKS_REFERENCES_PUB, 4-42Create Task Reference, 4-43

Parameter Descriptions, 4-44Procedure Specification, 4-43

Delete Task Reference, 4-49Parameter Descriptions, 4-49Procedure Specification, 4-49

Index-3

Page 362: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Update Task Reference, 4-46Parameter Descriptions, 4-47Procedure Specification, 4-46

MMedia Item Lifecycle Record Type, 2-5Media Item Record Type, 2-5

NNotes

JTF_NOTES_PUBCreate Note, 5-2Data Structure Specifications, 5-2Messages and Notifications, 5-13Update Note, 5-11

Note Source, 5-2Party Relationships, 5-4

OOpen Interaction, 2-19

Parameter Descriptions, 2-37Procedure Specification, 2-36

Open Media Item, 2-18Parameter Descriptions, 2-27Procedure Specification, 2-27

PParameter Specifications, 1-2

Invalid Parameters, 1-5Missing Parameter Attributes, 1-4Parameter Validations, 1-5Standard IN Parameters, 1-2Standard OUT Parameters, 1-3

RResource Manager, 3-1

JTF_RESOURCES_PUB, 3-3Create Resource, 3-3Update Resource, 3-11

JTF_RS_GROUPS_PUBCreate Resource Group, 3-19

Update Resource Group, 3-21JTF_RS_SALESREPS_PUB

Create Sales Rep, 3-24Update SalesRep, 3-28

Messages and Notifications, 3-31Resource Manager Public APIs, 3-2Resubmit Request

Parameter Descriptions, 6-34Procedure Specification, 6-33

SSend Request

Parameter Descriptions, 6-28Procedure Specification, 6-27

Sort Record Type, 4-5Start Request

Parameter Descriptions, 6-16Procedure Specification, 6-16

Status Messages, 1-6Error, 1-6Success, 1-6Unexpected error, 1-6Warning and Information Messages, 1-7

Submit RequestParameter Descriptions, 6-23Procedure Specification, 6-23

TTask Assign Record Type, 4-5Task Contact Record Type, 4-5, 4-7Task Dates Record Type, 4-5, 4-7Task Dependency Record Type, 4-5, 4-6Task Manager, 4-1

Data Structure Specifications, 4-5Task Assignment Record Type, 4-5Task Contact Record Type, 4-7Task Dates Record Type, 4-7Task Dependency Record Type, 4-6Task Recurrence Record Type, 4-6Task Reference Record Type, 4-6

JTF_TASKS_ASSIGNMENTS_PUB, 4-29Create Task Assignment, 4-30Delete Task Assignment, 4-40

Index-4

Page 363: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Update Task Assignment, 4-36JTF_TASKS_PUB, 4-5

Create Task, 4-9Delete Task, 4-27Update Task, 4-19

JTF_TASKS_REFERENCES_PUB, 4-42Create Task Reference, 4-43Delete Task Reference, 4-49Update Task Reference, 4-46

Messages and Notifications, 4-50Task Notes Record Type, 4-5Task Recurrence Record Type, 4-5, 4-6Task Reference Record Type, 4-5, 4-6

UUpdate Activity, 2-19

Parameter Descriptions, 2-43Procedure Specification, 2-43

Update Activity Duration, 2-19Parameter Descriptions, 2-45Procedure Specification, 2-45

Update Interaction, 2-19Parameter Descriptions, 2-39Procedure Specification, 2-39

Update Media Item, 2-19Parameter Descriptions, 2-29Procedure Specification, 2-29

Update Media Lifecycle, 2-19Parameter Descriptions, 2-33Procedure Specification, 2-32

Update Note, 5-2, 5-11Parameter Descriptions, 5-12Procedure Specification, 5-11

Update Resource, 3-11Parameter Descriptions, 3-13Procedure Specification, 3-12

Update Resource Group, 3-19, 3-21Parameter Descriptions, 3-22Procedure Specification, 3-21

Update SalesRep, 3-24, 3-28Parameter Descriptions, 3-29Procedure Specification, 3-28

Update Task, 4-2, 4-5, 4-19Parameter Descriptions, 4-21

Procedure Specification, 4-19Update Task Assignment, 4-2, 4-29, 4-36

Parameter Descriptions, 4-37Procedure Specification, 4-36

Update Task Reference, 4-42, 4-46Parameter Descriptions, 4-47Procedure Specification, 4-46

Update_References, 4-2

Index-5

Page 364: API Reference Guide Release 11i - Oracle Help Center · 5.1.1.1 Record jtf_note_contexts_rec_type ... Oracle CRM Application Foundation API Reference Guide, Release 11i ...

Index-6