Getting an error when creating an account with REST API; it is working with SOAP. (Doc ID 2293759.1)

Last updated on AUGUST 10, 2017

Applies to:

Oracle Fusion Sales Cloud Service - Version 11.1.11.1.0 and later
Information in this document applies to any platform.

Symptoms

On : 11.1.11.1.0 version, Accounts, Contacts, Households

Getting an error when creating an account with REST API; it is working with SOAP.

ERROR
-----------------------
Unable to start a nested resource because there is no current resource. Nested resource name: PrimaryAddressJBO-29000: Unexpected exception caught: java.lang.IllegalStateException, msg=Unable to start a nested resource because there is no current resource. Nested resource name: PrimaryAddress: Unable to start a nested resource because there is no current resource. Nested resource name: PrimaryAddress

STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Create custom field on Account
2. For Default Value, use this expression
def secCtx = adf.context.getSecurityContext()
if (!secCtx.isUserInRole('SPC_INTEGRACAO'))
{
  def userID = adf.context.getSecurityContext()?.getUserProfile()?.getUserID()
  def EmployeeObj = newView('Resource')
  adf.util.applyFilter(EmployeeObj,[Username:userID])
  def rowEmployee = EmployeeObj.first()
  setAttribute('Entidade_c', rowEmployee.EntidadeSPC_c)
}
3. Create an account using REST API
4. The error occurs
5. Change the field to Fixed Value and the error does not occur

BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot use the expression on field with REST API.

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms