You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to update the vendorClientCorportation id from a customText field using the API bridge but not sure where I am going wrong or whether this is the best way of doing it?
var placementId = API.currentEntity;
var venderClientCorporationid = API.getValue('customText42');
var item = {"venderClientCorporation" : {"id": venderClientCorporationid}};
API.appBridge.httpPUT("entity/Placement/" + placementId, item);
Many thanks for the help
Best
Adam
The text was updated successfully, but these errors were encountered:
Hunter-adam-haydon
changed the title
Question: How to update the vendorClientCorportion from a field integration?
Question: How to update the vendorClientCorportion from a field interaction?
Feb 10, 2023
Several issues; First, API.currentEntity gives the name of the current entity type; in this case, that'd be "Placement". You probably want API.currentEntityId.
Second, while it's common for REST requests to go the other way, for appbridge it uses httpPOST requests to update existing entities, and httpPUT to update them.
Last, there's a typo; it's "vendorClientCorporation", not "venderClientCorporation"
Full fix would be:
var placementId = API.currentEntityId;
var vendorClientCorporationid = API.getValue('customText42');
var item = {"vendorClientCorporation" : {"id": vendorClientCorporationid}};
API.appBridge.httpPOST("entity/Placement/" + placementId, item);
I am trying to update the vendorClientCorportation id from a customText field using the API bridge but not sure where I am going wrong or whether this is the best way of doing it?
var placementId = API.currentEntity;
var venderClientCorporationid = API.getValue('customText42');
var item = {"venderClientCorporation" : {"id": venderClientCorporationid}};
API.appBridge.httpPUT("entity/Placement/" + placementId, item);
Many thanks for the help
Best
Adam
The text was updated successfully, but these errors were encountered: