Jump to content

Update custom attribute via JavaScript Api


Paul Sorge

Recommended Posts

Hi,

I would like to update the value of a project's custom attribute via the javascript api. Is that even possible in v.0.4.5?

Since the ContextCustomAttributeValue does not have an own id (at least none is provided when fetching the custom_attributes as a relation of a project),  I cannot find a way to specify the (entity-) key argument in the session.update('ContextCustomAttributeValue', [key], data) function.  Or can the key argument array hold multiple values to specify the exact ContextCustomAttributeValue (like entity_id of the project and the key of the custom_attribute)? I tried some things there to no avail.

Or is that just the wrong approach?

Thanks in advance,
Paul

Link to comment
Share on other sites

Hi Paul and welcome to the forums.

This is an example of how to se the ContextCustomAttributeValue, the first id in the entity_key is the custom attribute configuration id, the second one is the project id.

{"action": "update", "entity_data": {"__entity_type__": "ContextCustomAttributeValue", "value": "31"}, "entity_key": ["d25219d6-acb5-11e1-8668-f23c91df1211", "32580850-64a2-11e7-a4bd-0a580ae40187"], "entity_type": "ContextCustomAttributeValue"}

 

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...