Empty "display_name" and inappropriate "vendor" association for create record using REST API

Baskar Govindan
Tera Contributor

Hi,

When I create an asset using REST API, the "display_name" provided in postbody is not getting reflected in the created record.

Also, you can see the vendor associated 'sys_id' is different from the one that got associated in created asset record.


Can someone please help me rectify this issue?

 

sn.png

6 REPLIES 6

Tony Chatfield1
Kilo Patron

Hi, if you undertake some investigation you should find that OOB the alm_asset display_name field is read only at dictionary level
/nav_to.do?uri=sys_dictionary.do?sys_id=c3ac1bc7b4a32110320f8dc279c804ad
and is calculated via the BR 'Calculate display name'

/nav_to.do?uri=sys_script.do?sys_id=5814a034eb3321005ecfa9bcf106feb9

 

If you wish to customize your solution, I think you will need to start by
Replacing the dictionary read only flag with a UI Policy
Updating the BR so that it only runs for UI - gs.isInteractive() will hopefully take care of that.
You may also find that need to add a write ACL for the field.

Regarding the vendor field, with no visibility of your instance it is not possible to evaluate possible causes.
Is the company record that was not populated flagged as a vendor?
Do you have any BR or workflow\flow setting vendor (or a default) on insert?

Hi @Tony Chatfield1,

 

Thank you for your prompt response.

 

We understand your point about the readonly nature of the alm_asset's display_name field.

 

Regarding the vendor association problem, I have used the company with sys_id: 7be8cdb297543110b44f38200153afbd to associate it with the product. However, despite this company being marked as a 'vendor' (as seen in the attached screenshot), I am still encountering issues with the wrong vendor being associated.

Also, there are no Business Rules for vendor insert.

Could you kindly assist me in resolving this issue? Your help would be greatly appreciated.Screenshot from 2023-07-31 18-27-27.pngScreenshot from 2023-07-31 18-28-12.png

 

 

Hi @Tony Chatfield1 , Could you please update your insights on this case?

 

Hi, testing in a PDI if I create a record in alm_assets via REST, then the vendor field is set to the value defined in my payload.
Unfortunately, with only partial screenshots as reference and no details of your instance configuration I am unable to provide any additional insights. Can you reproduce this behavior by creating an asset manually in your instance? Are there any local customizations in place for asset creation?