Domain values need to be added where MAXDOMAIN is the parent object such as the MXAPIDOMAIN object structure.
Also, never set the valueid. You put a SITEID in your message and provided an incorrect valueid when you have a site specified. VALUEID will get generated automatically by the framework and if you provide it, we may not be able to overwrite it (depending on whether this field is restricted on the object structure) which can lead to issues.
The MXAPIALNDOMAIN object structure should have been set as Query Only since it really does not support modifications. When you are in the Domains application, the main object is MAXDOMAIN and when you edit it, we go through a relationship from MAXDOMAIN to ALNDOMAIN. Then we have logic at the Mbo level that goes up to the parent object (using getOwner()). This fails when we just have ALNDOMAIN which leads to your null pointer exception message.
------------------------------
Steven Shull
IBM
------------------------------
Original Message:
Sent: 12-19-2024 11:11
From: Ali Abusulb
Subject: Error encountered when trying to do a POST to MXAPIALNDOMAIN
Hi everyone,
Doing some testing via POSTMAN of loading domain values via MXAPIALNDOMAIN. When I do a call to get the schema for it - I get these as the required values
"required": [
"domainid",
"value",
"valueid"
]
Then when I do a POST call to MXAPIALNDOMAIN to bulk load domain values with this body
[
{
"domainid":"DOM_TEST1001",
"value": "TEST100",
"description": "TEST100 DESC",
"siteid": "SITE",
"valueid": "DOM_TEST1001|TEST100",
"_action": "AddChange"
},
{
"domainid":"DOM_TEST1001",
"value": "TEST101",
"description": "TEST1001 DESC",
"valueid": "DOM_TEST1001|TEST101",
"siteid": "SITE",
"_action": "AddChange"
}
]
The result errors saying
{
"_responsedata": {
"Error": {
"extendedError": {
"moreInfo": {
"href": "http://localhost/maximo/api/error/messages/BMXAA4214E"
}
},
"reasonCode": "BMXAA4214E",
"message": "BMXAA4214E - An unknown error has occurred. Please contact your system administrator for assistance. Gather the logs from the <HOME> directory and determine where and why the error occurred.\n\tnull",
"statusCode": "400"
}
},
"_responsemeta": {
"status": "400"
}
}
The schema says that the
valueid field is a
"System generated unique identifier of the value in a domain, internal and cannot be modified" - I have tried both with and without it and I get the same error
Thank you for the help
#EverythingMaximo
------------------------------
Ali Abusulb
EDI
------------------------------