Publishing and Unpublishing Properties to OData
The sproc_SetPropertiesPublishStatusForObject stored procedure enables you to publish properties to or unpublish properties from OData. To do so, use the following query:
EXEC sproc_SetPropertiesPublishStatusForObject @nObjectType = <Object Type>, @tPropIDsToPublish = '<property ID>,<property ID>', @tPropIDsToUnpublish = '<property ID>,<property ID>'
Where:
• @nObjectType is the ID of the object. For example, the ID of the contact object is 3.
• @tPropIDsToPublish includes IDs of properties that will be published to OData.
• @tPropIDsToUnpublish includes IDs of properties that will be unpublished from OData.
Using this script, you can publish, unpublish, or simultaneously publish and unpublish properties to OData.
Example
• To publish properties to OData, use the following query;
EXEC sproc_SetPropertiesPublishStatusForObject @nObjectType = 3, @tPropIDsToPublish = '<property ID>,<property ID>', @tPropIDsToUnpublish = ''
Note that @tPropIDsToUnpublish is blank.
• To only unpublish properties from OData, use the following query:
EXEC sproc_SetPropertiesPublishStatusForObject @nObjectType = 3, @tPropIDsToPublish = '', @tPropIDsToUnpublish = '<property ID>,<property ID>'
Note that @tPropIDsToPublish is blank.
• To simultaneously publish and unpublish properties from OData, use the following query:
EXEC sproc_SetPropertiesPublishStatusForObject @nObjectType = 3, @tPropIDsToPublish = '<property ID>,<property ID>', @tPropIDsToUnpublish = '<property ID>,<property ID>'
Note
• In all scenarios, ensure that you pass valid values for the <property ID> placeholders.
• The changed status of published or unpublished OData properties takes effect only after IIS is reset on the Application Server computer. Alternatively, the Web Client user needs to click the Refresh OData Configuration button. For information about this button, see Web Client Help.