The id in the rest api v8 needs to be a UUID to work

Hi,
I have a number of accounts and contacts that I imported from an external system and we decided to keep the same unique id as from the application that we came from, however this id is not in the UUID format. This works perfectly in SuiteCRM, except in the rest API where there is a hardcoded test for a UUID pattern in the file: Api/V8/Param/Options/Id.php. I’ve patched this by specifying my own regular expression but I want to know if there is a special reason why this test is included in the file? Is there a way that I can work around this test and still have my code upgrade proof?

Best regards,
Davy

Hi, welcome to the Community! :tada:

Try setting this to false in config_override.php:

$sugar_config[‘strict_id_validation’]

If it doesn’t work, it should.

Traditionally, you can use any unique id in the SugarCRM / SuiteCRM database.

Here’s some background:
https://developer.sugarcrm.com/2008/05/13/what-are-the-impacts-of-swapping-out-guids-in-sugar/

Adding the stricter UUID validation was a mistake, IMHO. I would support having that check removed altogether.

Hi,
thank you for the swift reply, I’ve tried setting the $sugar_config[‘strict_id_validation’] to false but this doesn’t work for the V8 rest API.It seems that the problem is that the V8 rest API uses the ID validation from the file: Api/V8/Param/Options/Id.php

As far as I can see in this code it doesn’t validate the strict_id_validation as is done in the other code which uses lib/Utility/SuiteValidator.php to check for a valid ID.

Best regards,
Davy

You’re right… maybe we should add the strict_id_validation check there, or simply make the regex more permissive.

This idea for using only UUIDs is really bad, I have asked about this more than once but I never saw a proper argument for its introduction. Makes migrations and integrations harder, breaks backwards compatibility for no good reason…