This discussion is archived
5 Replies Latest reply: Apr 11, 2011 6:52 AM by 827118 RSS

Auto task creation failing in Service Request Creation API

Meenakshi Newbie
Currently Being Moderated
Hi All,

I am using Oracle Applications 11.5.10 . While trying to create a Service Request from the application , when a problem code value is passed , the SR gets created automatically with all the tasks attached to a task template mapped to the problem code . But when I try to do the same from the cs_servicerequest_PUB.Create_ServiceRequest public API , the task assignment fails with the following error :

No Resource Found. Please Try Again.
API Error(CS_SR_TASK_AUTOASSIGN_PKG.ASSIGN_TASK_RESOURCE). Unable to automatically assign Task Owner. Please Check your Territory Set Up or manually assign Task Owner.
API Error: System could not automatically Assign an Owner for task template: Auto Task Grouping Problem. Task Owner field is Mandatory

The territory setup seems to be fine in the environment. I am calling the API with P_auto_assign => 'Y',p_auto_generate_tasks => 'Y' . Could anyone help me out with what could be the probable
problem and what other check should I do .

Thanks,
Meenakshi
  • 1. Re: Auto task creation failing in Service Request Creation API
    Srini Chavali-Oracle Oracle ACE Director
    Currently Being Moderated
    Pl see if MOS Doc 394390.1 (How to Create a Service Request and a CONTACT for the Service Request Programatically using cs_createservicerequest_pub.Create_ServiceRequest API) can help

    There are a lot of documents in MOS that refer to errors with this API. Pl search with "Create_ServiceRequest" to find these docs, and see if any of them can help

    HTH
    Srini
  • 2. Re: Auto task creation failing in Service Request Creation API
    Hussein Sawwan-Oracle Employee ACE
    Currently Being Moderated
    Hi,

    Please see if these docs help.

    Unable To Create Task On Sr Form Getting Error FRM- 40742 [ID 1108319.1]
    How To Use Automatic Assignment Of Auto-Generated Tasks With Groups [ID 311385.1]
    Assignment Manager Errors With ''Area Code'' As Territory Transaction Qualifier [ID 400798.1]

    Thanks,
    Hussein
  • 3. Re: Auto task creation failing in Service Request Creation API
    Meenakshi Newbie
    Currently Being Moderated
    Hi Srini / Hussein,

    I have gone through the metalink notes and have verified the setup changes , profile option values in the environment and they look good . The following is the code snippet I am using to verify the task creation. The below code is creating the tasks properly when I set the profile "Service: Service Request Task Owner Auto Assignment Level": to "Individual", but if this profile option is set to "Group", then the task assignment fails with the error already mentioned . In our project this profile value should be set only to "Group" and not "Individual" . Please let me know If there are any more checks I can perform to resolve this.

    CURSOR c1
    IS
    SELECT *
    FROM apps.cs_incidents_all_b
    WHERE INCIDENT_id=3810;
    BEGIN
    ln_org_id:=1355;
    ln_user_id := 30967;
    ln_resp_id := 55251;
    ln_resp_appl_id := 514;
    APPS.FND_GLOBAL.APPS_INITIALIZE( USER_ID=>ln_user_id
    ,RESP_ID=>ln_resp_id
    ,resp_appl_id=>ln_resp_appl_id
    );
    APPS.FND_CLIENT_INFO.SET_ORG_CONTEXT(ln_org_id);
    FOR c1_rec IN c1
    LOOP
    l_service_request_rec.request_date := trunc(c1_rec.incident_date);
    l_service_request_rec.type_id := c1_rec.incident_type_id;
    l_service_request_rec.status_id := c1_rec.incident_status_id;
    l_service_request_rec.severity_id := c1_rec.incident_severity_id;
    l_service_request_rec.summary := 'TEST SR THROUGH API';
    l_service_request_rec.caller_type := c1_rec.caller_type;
    l_service_request_rec.customer_id := c1_rec.customer_id;
    l_service_request_rec.sr_creation_channel := 'PHONE';
    l_service_request_rec.group_type := 'RS_GROUP';
    l_service_request_rec.bill_to_site_use_id := c1_rec.bill_to_site_use_id;--DERIVE -- FROM HZ_PARTIES
    l_service_request_rec.ship_to_site_use_id := c1_rec.ship_to_site_use_id;--DERIVE
    l_service_request_rec.bill_to_party_id := c1_rec.bill_to_party_id;--DERIVE --PARTY_ID
    l_service_request_rec.ship_to_party_id := c1_rec.ship_to_party_id;--DERIVE --PARTY_ID
    l_service_request_rec.problem_code := c1_rec.problem_code;
    l_service_request_rec.incident_location_id := 5500;
    l_service_request_rec.incident_location_type := 'HZ_PARTY_SITE';
    l_service_request_rec.created_by:=13419;
    l_service_request_rec.creation_date:=SYSDATE-10;

    cs_servicerequest_PUB.Create_ServiceRequest (
                                  p_api_version => 4.0,
                                  p_init_msg_list => FND_API.G_TRUE,
                                  p_commit => FND_API.G_TRUE,
                                  x_return_status => lx_return_status,
                                  x_msg_count => lx_msg_count,
                                  x_msg_data => lx_msg_data,
                                  p_resp_appl_id => ln_resp_appl_id,
                                  p_resp_id => ln_resp_id,
                                  p_user_id => ln_user_id,
                                  p_login_id => NULL,
                                  p_org_id => ln_org_id,
                                  p_request_id => null,
                                  p_request_number => ln_sr_num,
                                  p_service_request_rec => l_service_request_rec,
                                  p_notes => l_notes_table,
                                  p_contacts => l_contacts_tab,
                                  P_auto_assign => 'Y',
                                  p_auto_generate_tasks => 'Y',
                                  x_sr_create_out_rec => l_service_request_rec_out,
                                  p_default_contract_sla_ind =>'N',
                                  p_default_coverage_template_id => 0);
  • 4. Re: Auto task creation failing in Service Request Creation API
    Hussein Sawwan-Oracle Employee ACE
    Currently Being Moderated
    Hi,

    If none of the above docs helps, I would suggest you log a SR.

    Thanks,
    Hussein
  • 5. Re: Auto task creation failing in Service Request Creation API
    827118 Newbie
    Currently Being Moderated
    Hello Hussen/Meenakhi,

    Could you please letme know where the setup for problem code, based on which the tasks are automaically created.

    That would really help me.


    Thank you,
    Amarnadh

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points