My Oracle Support Banner

GMD_OPERATION_RESOURCES_PUB.UPDATE_OPERATION_RESOURCES API is Giving Error "You Can Only Name One Primary Resource." (Doc ID 2477435.1)

Last updated on NOVEMBER 08, 2019

Applies to:

Oracle Process Manufacturing Product Development - Version 12.1.3 and later
Information in this document applies to any platform.

Symptoms

On : 12.1.3 version, API Issues

While updating resource fields using GMD_OPERATION_RESOURCES_PUB.UPDATE_OPERATION_RESOURCES API, getting below error,

"You can only name one primary resource." even though the resource being updated is already the only primary resource, and it is being left as the primary resource.

ERROR
-----------------------
GMD_ONE_PRIMARY_RESOURCE - "You can only name one primary resource."

Customer has identified the following code that may be the problem:

ELSIF p_update_table(i).p_value = 1 THEN
  /* This implies that we are setting this current resource as primary */
  /* so let us check if their are any other primaries already existing */
  OPEN check_one_prim_rsrc (p_oprn_line_id);
  FETCH check_one_prim_rsrc INTO l_exist;
  CLOSE check_one_prim_rsrc;
  IF l_exist > 0 THEN
  gmd_api_grp.log_message ('GMD_ONE_PRIMARY_RESOURCE');
  RAISE upd_oprn_rsrc_err;
  END IF;

This makes sense if the user were trying to make another resource Primary and there was already a primary resource, but if you are setting the primary resource indicator on the resource that is already the primary it should not error.

STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Run api wrapper to call GMD_OPERATION_RESOURCES_PUB.UPDATE_OPERATION_RESOURCES
2. Pass in 1 for PRIM_RSRC_IND. Error is returned.


BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot run the api successfully..

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.