Resource Manager Public APIs

This chapter describes Resource Manager public APIs including public packages, message notifications and sample code.

This chapter covers the following topics:

Resource Manager Public Packages

There are three public Resource Manager packages:

Package JTF_RS_RESOURCE_PUB

All public procedures (APIs) relating to creating or updating a resource are stored in package JTF_RS_RESOURCE_PUB. This package contains the following APIs:

Package JTF_RS_GROUPS_PUB

All 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:

Package JTF_RS_SALESREPS_PUB

All public procedures (APIs) relating to creating or updating a salesperson are stored in package JTF_RS_SALESREPS_PUB. This package contains the following APIs:

Resource Manager Public APIs

The following table describes the public APIs which are discussed in this chapter.

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.

Package JTF_RS_RESOURCE_PUB

This package contains the following APIs:

Create_Resource

The Create_Resource API creates 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 Information versus Source Information

Within the Resource Manager, resource information and source information are two different types of information.

Example sources include:

Creating a Resource that is an Employee

When using the Create_Resource API to create a resource that is an employee, the following input parameters must be set to null, otherwise the API will return an error message:

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,
  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,
  p_attribute1              in  jtf_rs_resource_extns.attribute1%type               default null,
  p_attribute2              in  jtf_rs_resource_extns.attribute2%type               default null,
  p_attribute3              in  jtf_rs_resource_extns.attribute3%type               default null,
  p_attribute4              in  jtf_rs_resource_extns.attribute4%type               default null,
  p_attribute5              in  jtf_rs_resource_extns.attribute5%type               default null,
  p_attribute6              in  jtf_rs_resource_extns.attribute6%type               default null,
  p_attribute7              in  jtf_rs_resource_extns.attribute7%type               default null,
  p_attribute8               in  jtf_rs_resource_extns.attribute8%type              default null,
  p_attribute9               in  jtf_rs_resource_extns.attribute9%type              default null,
  p_attribute10              in  jtf_rs_resource_extns.attribute10%type             default null,
  p_attribute11              in  jtf_rs_resource_extns.attribute11%type             default null,
  p_attribute12              in  jtf_rs_resource_extns.attribute12%type             default null,
  p_attribute13              in  jtf_rs_resource_extns.attribute13%type             default null,
  p_attribute14              in  jtf_rs_resource_extns.attribute14%type             default null,
  p_attribute15              in  jtf_rs_resource_extns.attribute15%type             default null,
  p_attribute_category       in jtf_rs_resource_extns.attribute_category%type      default null,


);

Current Version

1.0

Parameter Descriptions

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

Create_Resource IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes See "Standard IN Parameters".
p_init_msg_list VARCHAR2 No See "Standard IN Parameters".
p_commit VARCHAR2 No See "Standard IN Parameters".
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. When creating a resource that is an employee, this parameter must be set to NULL, otherwise, the API returns an error.
p_contact_id jtf_rs_resource_extns.contact_id%type No Resource contact identifier. When creating a resource that is an employee, this parameter must be set to NULL, otherwise, the API returns an error.
p_managing_emp_id jtf_rs_resource_extns.managing_employee_id%type No Identifier for the manager of the resource. When creating a resource that is an employee, this parameter must be set to NULL, otherwise, the API returns an error.
p_managing_emp_num per_employees_current_x.employee_num%type No Employee number of the resource's manager. When creating a resource that is an employee, this parameter must be set to NULL, otherwise, the API returns an error.
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. 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.
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.
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.
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.
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.
p_attribute1 in jtf_rs_resource_extns.attribute1%type No Descriptive flexfield segment, default = null.
p_attribute2 in jtf_rs_resource_extns.attribute2%type No Descriptive flexfield segment, default = null.
p_attribute3 in jtf_rs_resource_extns.attribute3%type No Descriptive flexfield segment, default = null.
p_attribute4 in jtf_rs_resource_extns.attribute4%type No Descriptive flexfield segment, default = null.
p_attribute5 in jtf_rs_resource_extns.attribute5%type No Descriptive flexfield segment, default = null.
p_attribute6 in jtf_rs_resource_extns.attribute6%type No Descriptive flexfield segment, default = null.
p_attribute7 in jtf_rs_resource_extns.attribute7%type No Descriptive flexfield segment, default = null.
p_attribute8 in jtf_rs_resource_extns.attribute8%type No Descriptive flexfield segment, default = null.
p_attribute9 in jtf_rs_resource_extns.attribute9%type No Descriptive flexfield segment, default = null.
p_attribute10 in jtf_rs_resource_extns.attribute10%type No Descriptive flexfield segment, default = null.
p_attribute11 in jtf_rs_resource_extns.attribute11%type No Descriptive flexfield segment, default = null.
p_attribute12 in jtf_rs_resource_extns.attribute12%type No Descriptive flexfield segment, default = null.
p_attribute13 in jtf_rs_resource_extns.attribute13%type No Descriptive flexfield segment, default = null.
p_attribute14 in jtf_rs_resource_extns.attribute14%type No Descriptive flexfield segment, default = null.
p_attribute15 in jtf_rs_resource_extns.attribute15%type No Descriptive flexfield segment, default = null.
p_attribute_category in jtf_rs_resource_extns.attribute_category No Descriptive flexfield structure definition column, default = null.

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

Create_Resource OUT Parameters
Parameter Data type Description
x_return_status VARCHAR2 See "Standard OUT Parameters".
x_msg_count NUMBER See "Standard OUT Parameters".
x_msg_data VARCHAR2 See "Standard OUT Parameters".
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.

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 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        default fnd_api.g_miss_char
  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,
  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,
  p_attribute1            in  jtf_rs_resource_extns.attribute1%type           default fnd_api.g_miss_char,
  p_attribute2            in  jtf_rs_resource_extns.attribute2%type           default fnd_api.g_miss_char,
  p_attribute3            in  jtf_rs_resource_extns.attribute3%type           default  fnd_api.g_miss_char,
  p_attribute4            in  jtf_rs_resource_extns.attribute4%type           default  fnd_api.g_miss_char,
  p_attribute5            in  jtf_rs_resource_extns.attribute5%type           default  fnd_api.g_miss_char,
  p_attribute6            in  jtf_rs_resource_extns.attribute6%type           default  fnd_api.g_miss_char,
  p_attribute7            in  jtf_rs_resource_extns.attribute7%type           default  fnd_api.g_miss_char,
  p_attribute8            in  jtf_rs_resource_extns.attribute8%type           default  fnd_api.g_miss_char,
  p_attribute9            in  jtf_rs_resource_extns.attribute9%type           default  fnd_api.g_miss_char,
  p_attribute10           in  jtf_rs_resource_extns.attribute10%type          default  fnd_api.g_miss_char,
  p_attribute11           in  jtf_rs_resource_extns.attribute11%type          default  fnd_api.g_miss_char,
  p_attribute12           in  jtf_rs_resource_extns.attribute12%type          default  fnd_api.g_miss_char,
  p_attribute13           in  jtf_rs_resource_extns.attribute13%type          default  fnd_api.g_miss_char,
  p_attribute14           in  jtf_rs_resource_extns.attribute14%type          default  fnd_api.g_miss_char,
  p_attribute15           in  jtf_rs_resource_extns.attribute15%type          default  fnd_api.g_miss_char,
  p_attribute_category    in  jtf_rs_resource_extns.attribute_category%type   default  fnd_api.g_miss_char


);

Current Version

1.0

Parameter Descriptions

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

Update_Resource IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes See "Standard IN Parameters".
p_init_msg_list VARCHAR2 No See "Standard IN Parameters".
p_commit VARCHAR2 No See "Standard IN Parameters".
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 No 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.
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.
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.
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.
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 No 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.
p_attribute1 in jtf_rs_resource_extns.attribute1%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute2 in jtf_rs_resource_extns.attribute2%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute3 in jtf_rs_resource_extns.attribute3%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute4 in jtf_rs_resource_extns.attribute4%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute5 in jtf_rs_resource_extns.attribute5%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute6 in jtf_rs_resource_extns.attribute6%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute7 in jtf_rs_resource_extns.attribute7%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute8 in jtf_rs_resource_extns.attribute8%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute9 in jtf_rs_resource_extns.attribute9%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute10 in jtf_rs_resource_extns.attribute10%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute11 in jtf_rs_resource_extns.attribute11%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute12 in jtf_rs_resource_extns.attribute12%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute13 in jtf_rs_resource_extns.attribute13%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute14 in jtf_rs_resource_extns.attribute14%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute15 in jtf_rs_resource_extns.attribute15%type No Descriptive flexfield segment. Default = FND_API.G_MISS_CHAR
p_attribute_category in jtf_rs_resource_extns.attribute_category No Descriptive flexfield structure definition column. Default = FND_API.G_MISS_CHAR

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

Update_Resource OUT Parameters
Parameter Data Type Descriptions
x_return_status VARCHAR2 See "Standard OUT Parameters".
x_msg_count NUMBER See "Standard OUT Parameters".
x_msg_data VARCHAR2 See "Standard OUT Parameters".

Package JTF_RS_GROUPS_PUB

This package contains the following APIs:

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 Version

1.0

Parameter Descriptions

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

Create_Resource_Group IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes See "Standard IN Parameters".
p_init_msg_list VARCHAR2 No See "Standard IN Parameters".
p_commit VARCHAR2 No See "Standard IN Parameters".
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.

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.
P_TIME_ZONE NUMBER No Indicates the time zone identifier.
Validations:
  • The time zone value is a foreign key reference to the ‘upgrade_tz_id’ column in ‘fnd_timezones_vl’.

  • The value that is inserted or updated into ‘jtf_rs_groups_b.time_zone’ table must be a valid time zone defined in the ‘fnd_timezones_vl’

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

Create_Resource OUT Parameters
Parameter Data Type Descriptions
x_return_status VARCHAR2 See "Standard OUT Parameters".
x_msg_count NUMBER See "Standard OUT Parameters".
x_msg_data VARCHAR2 See "Standard OUT Parameters".
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.

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_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 Version

1.0

Parameter Descriptions

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

Update_Resource_Group IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes See "Standard IN Parameters".
p_init_msg_list VARCHAR2 No See "Standard IN Parameters".
p_commit VARCHAR2 No See "Standard IN Parameters".
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.
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.
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.
P_TIME_ZONE NUMBER No Indicates the time zone identifier.
Validations:
  • § The time zone value is a foreign key reference to the ‘upgrade_tz_id’ column in ‘fnd_timezones_vl’.

  • § The value that is inserted or updated into ‘jtf_rs_groups_b.time_zone’ table must be a valid time zone defined in the ‘fnd_timezones_vl’

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

Update_Resource_Group OUT Parameters
Parameter Data Type Descriptions
x_return_status VARCHAR2 See "Standard OUT Parameters".
x_msg_count NUMBER See "Standard OUT Parameters".
x_msg_data VARCHAR2 See "Standard OUT Parameters".

Package JTF_RS_SALESREPS_PUB

This package contains the following APIs:

Create_SalesRep

The Create_SalesRep API creates a resource of type Salesrep. The API verifies the resource ID parameter from the JTF_RS_RESOURC_.EXTNS table which is created using the Create_Resource API.

Setting the org_context

When using a script to call the the Create_Salesrep API, the following commands must be used to properly set the org_context:

mo_global.set_org_context(999, NULL);

where 999 is the org_id parameter value to which the context is set. This should be done every time you call the Create_Salesrep API.

Procedure Specification

PROCEDURE  create_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_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 Version

1.0

Parameter Descriptions

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

Create_SalesRep IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes See "Standard IN Parameters".
p_init_msg_list VARCHAR2 No See "Standard IN Parameters".
p_commit VARCHAR2 No See "Standard IN Parameters".
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.
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.

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

Create_SalesRep OUT Parameters
Parameter Data Type Description
x_return_status VARCHAR2 See "Standard OUT Parameters".
x_msg_count NUMBER See "Standard OUT Parameters".
x_msg_data VARCHAR2 See "Standard OUT Parameters".
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.

Update_SalesRep

The Update_SalesRep API updates SalesRep attributes such as Salesperson Number, Sales Credit Type, Start and End Date.

Setting the org_context

When using a script to call the the Update_Salesrep API, the following commands must be used to properly set the org_context:

mo_global.set_org_context(999, NULL);

where 999 is the org_id parameter value to which the context is set. This should be done every time you call the Update_Salesrep API.

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,
 x_msg_count              out  number,
 x_msg_data               out  varchar2
);

Current Version

1.0

Parameter Descriptions

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

Update_SalesRep IN Parameters
Parameter Data Type Required Descriptions and Validations
p_api_version NUMBER Yes See "Standard IN Parameters".
p_init_msg_list VARCHAR2 No See "Standard IN Parameters".
p_commit VARCHAR2 No See "Standard IN Parameters".
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.
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.
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 Yes Organization Identifier
p_object_version_number jtf_rs_salesreps.object_version_number%type Yes The object version number of the salesrep ID derives from the JTF_RS_SALESREPS table.

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

Update_SalesRep OUT Parameters
Parameter Data Type Descriptions and Validations
x_return_status VARCHAR2 See "Standard OUT Parameters".
x_msg_count NUMBER See "Standard OUT Parameters".
x_msg_data VARCHAR2 See "Standard OUT Parameters".

Messages and Notifications

The 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

This section describes the messages and notifications generated by the APIs contained in the JTF_RS_RESOURCE_PUB package.

Create_Resource

The following table lists the messages and notifications generated by the Create_Resource API.

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.
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.
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.

Update_Resource

The following table lists the messages and notifications generated by the Update_Resource API.

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.
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.
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.

JTF_RS_GROUPS_PUB

This section describes the messages and notifications generated by the APIs contained in the JTF_RS_GROUPS_PUB package.

Create_Resource_Group

The following table lists the messages and notifications generated by the Create_Resource_Group API.

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.
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.

Update_Resource_Group

The following table lists the messages and notifications generated by the Update_Resource_Group API.

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.
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.

JTF_RS_SALESREPS_PUB

This section describes the messages and notifications generated by the APIs contained in the JTF_RS_SALESREPS_PUB package.

Create_SalesRep

The following table lists the messages and notifications generated by the Create_SalesRep API.

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.
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.

Update_SalesRep

The following table lists the messages and notifications generated by the Update_SalesRep API.

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.

Sample Code

This 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

The 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.

Create_Resource

This 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.

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".
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 rabbott@visionhr.com.
l_source_phone Her phone number is 650-555-1212.
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_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               := 'rabbott@visionhr.com';
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,
 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;
/

Update_Resource

This 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.

Update_Resource API Sample Code Variables
Variable Description
l_api_version Version is 1.0.
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 rabbott@visionhr.com.
l_source_phone Her phone number is 650-555-1212.
SET SERVEROUTPUT ON

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               := 'rabbott@visionhr.com';
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,
 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;
/

JTF_RS_GROUPS_PUB

The 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.

Create_Resource_Group Sample Code

This 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.

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".
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 rabbott@visionhr.com.
l_source_phone Her phone number is 650-555-1212.
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      := 'sales_us@oracle.com';
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_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);
    dbms_output.put_line ('Group ID - '       || l_group_id);
    dbms_output.put_line ('Group Number - '   || l_group_number);
  end if;

end;
/

Update_Resource_Group Sample Code

This 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.

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 sales_us@oracle.com.
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".
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      := 'sales_us@oracle.com';
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
    dbms_output.put_line ('Return Status - '  || l_return_status);
  end if;

end;
/

JTF_RS_SALESREPS_PUB

The 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.

Create_SalesRep Sample Code

This 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.

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 john.doe@oracle.com
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.
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;
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                 := 'john.doe@oracle.com';
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,
 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;
/

Update_SalesRep Sample Code

This 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.

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 john.doe@oracle.com
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.
ET 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;
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                 := 'john.doe@oracle.com';
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,
 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;
/