cancel
Showing results for 
Search instead for 
Did you mean: 
My Areas

Sign in or create account

to get a personalized navigation.

mpaulus_lequest
CONTRIBUTOR **

Error: Branch '1 ' cannot be found in the system

by mpaulus_lequest (Updated ‎02-02-2021 13:48 by Yildirim VISMA )

What I tried to do
Create an invoice through the API in my organization's sandbox company.
request headers:

{
    "accept": "application/json",
    "authorization": "Bearer 12345678-abcd-abcd-abcd-123456789012",
    "ipp-application-type": "Visma.net Financials",
    "ipp-company-id": "2628707"
}

request body:

{
    "customerNumber": {
        "value": "200508"
    },
    "documentDate": {
        "value": "2020-10-27T00:00:00.000Z"
    },
    "financialPeriod": {
        "value": "202010"
    },
    "invoiceLines": [
        {
            "accountNumber": {
                "value": "80200"
            },
            "operation": "Insert",
            "quantity": {
                "value": 100
            },
            "unitPriceInCurrency": {
                "value": 5
            }
        }
    ]
}

What did I expect
Just as in my developer ISV company I expect a HTTP 201 response and to see the invoice created.

What did I see
HTTP 400 response with the following ...
headers:

Date: Wed, 04 Nov 2020 19:09:22 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains
Content-Type: application/json; charset=utf-8
ipp-request-id: eb49fa86-f7b4-49ff-86a1-2ac6001f2ec5
X-Content-Type-Options: application/json
Pragma: no-cache
X-Handled-By: Acumatica-PX.Export/AuthenticationManagerModule
Referrer-Policy: origin-when-cross-origin
VnfInstanceId: ERP_NL_DEMO_0009
Cache-Control: no-cache,no-cache
Feature-Policy: geolocation 'none'; vr 'none'; payment 'none'; midi 'none'; microphone 'none'; fullscreen 'none'; encrypted-media 'none'; camera 'none'; autoplay 'none';
Expires: -1
X-XSS-Protection: 1;mode=block
Set-Cookie: LegacyUI=0; path=/; secure; HttpOnly,UserBranch=15; path=/; secure; HttpOnly,Locale=TimeZone=GMTE0000U&Culture=en-GB; path=/; secure; HttpOnly,LicenseRoles=; expires=Tue, 03-Nov-2020 19:09:19 GMT; path=/; secure; HttpOnly,UserDisplayName=; expires=Tue, 03-Nov-2020 19:09:19 GMT; path=/; secure; HttpOnly
Connection: close
Transfer-Encoding: chunked

message:

{
    "message": "Error: Inserting  'Sales invoice/note' record raised at least one error. Please review the errors.\r\nError: Branch '1     ' cannot be found in the system.\r\n"
}

Discussion
There are several odd things about this situation:

  • the same code works flawlessly on the ISV company (with different accountNumber, customerNumber)
  • the sandbox company in question does not have branch functionality enabled
  • another developer ran into the same response, but noticed that upon multiple tries the response was successful (in my case it consistently fails)

 

5 REPLIES 5

by Magnus Johnsen

Hi,

Is this company newly created?

In the past when this has been encountered, it has usually been due to an caching issue. 

mpaulus_lequest
CONTRIBUTOR **

The company has been around for several months at least, perhaps over a year. But I was only granted access to it yesterday.

Hi,

Alright, could you please make sure that you have both the "Financials Administrator" & "Financials User" roles applied for this company?

 

Please let us know and we'll have a look at it. 

 

Thank you. 

mpaulus_lequest
CONTRIBUTOR **

Yes, both roles were already assigned yesterday.

 

Just now I tried the same request again, and now it's successful!
So perhaps it's a temporary problem the first 6-12 hours after:

  • creating a new company
  • granting a user access to a company
Accepted solution
Magnus Johnsen
VISMA

Ok, we have some cases in the backlog regarding cache issue in these scenarios.

Good to hear it's resolved, please let us know if it happens again.