Required Field Not Throwing Error in REST API

Priya84
Mega Contributor

Hi,

I have required/mandatory fields in Customer_contact table. When i try to create (POST) a contact via REST API it is creating record with status 201. But  i have a required field account in customer_contacts table.

 

Please refer below imagefind_real_file.png

 

Below is the contact which i have created via REST API.

find_real_file.png

Below image is the response for contact creation.

find_real_file.png

 

 

My question is, Why error not Shown when i try to post a contact via REST API, though a required field is not sent in request payload. 

1 ACCEPTED SOLUTION

glad it worked . 

kindly mark my answer as correct and close this thread

if you have further question , kindly open new thread .

 

 

View solution in original post

18 REPLIES 18

Priya84
Mega Contributor

Hi ,

I referred data policy in document. There is a option called Converting UI policy to data policy by retaining UI policy as well. I am struggling in converting UI policy in data policy.

 I cannot see #3 My version is LONDON.

  1. Navigate to System UI > UI Policies.
  2. Open an existing UI policy.
  3. Under Related Links, click Convert this to Data Policy.
    A new data policy record is created.

Please guide me in applying all UI policy to data policy (i.e) I want whatever validations functioning at UI level ,all things i want in REST API too because we are simulating the CRM UI in our integration.

Thanks in Advance.

make sure you are in default view ? 

 

Instead of converting your UI Policy to Data policy , create data policy here, because once you will convert that UI Policy will get deactivated and Data policy will get created. 

Priya84
Mega Contributor

Yes , i am in default view only.

I saw in document like 

Converting a UI policy to a data policy deactivates the UI policy. To retain the policy in the UI, ensure that the Use as UI Policy on client check box is selected on the data policy record.

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/form-administrati... 

 

are you still not able to convert it ? can you add the screenshot ? 

Priya84
Mega Contributor

Sure,

find_real_file.png

 

On editing column-specific-fields, not able to see that option.

 

find_real_file.png