The GetObjectStoreItem method enables the client application to obtain the entry template that was selected through the use of the SelectEntryTemplate command. This method provides access to the information specified through the IObjectStoreItem interface, including the item type, version ID and version series ID specified in the template.
IObjectStoreItemPtr spIObjectStoreItemAdded = spISelectEntryTemplateRsp->GetObjectStoreItem();
... // Determine if the command failed, before accessing response component data hResult = spIAppIntRsp->GetHResult(); if (FAILED(hResult)) { std::cout << "The SelectEntryTemplate command failed to execute." << std::endl; // Examine the error information provided in the standard response component _bstr_t bstrErrorName = spIAppIntRsp->GetErrorName(); std::cout << "ErrorName=" << ( bstrErrorName.length() ? (LPCSTR) bstrErrorName : _T( "" ) ) << std::endl; _bstr_t bstrErrorMsg = spIAppIntRsp->GetErrorMsg(); std::cout << "ErrorMsg=" << ( bstrErrorMsg.length() ? (LPCSTR) bstrErrorMsg : _T( "" ) ) << std::endl; _bstr_t bstrErrorDetails = spIAppIntRsp->GetErrorDetails(); std::cout << "ErrorDetails=" << ( bstrErrorDetails.length() ? (LPCSTR) bstrErrorDetails : _T( "" ) ) << std::endl; _ASSERTE(0); } else { std::cout << "The SelectEntryTemplate command succeeded." << std::endl; // Obtain the response name and description from the standard response component _bstr_t bstrResponseDescription = spIAppIntRsp->GetDescription(); std::cout << "ResponseDescription=" << ( bstrResponseDescription.length() ? (LPCSTR) bstrResponseDescription : _T( "" ) ) << std::endl; _bstr_t bstrResponseName = spIAppIntRsp->GetName(); std::cout << "ResponseName=" << ( bstrResponseName.length() ? (LPCSTR) bstrResponseName : _T( "" ) ) << std::endl; // Obtain the entry template contained in the custom SelectEntryTemplateRsp component ISelectEntryTemplateRspPtr spISelectEntryTemplateRsp(spIAppIntRsp);
_ASSERTE(spISelectEntryTemplateRsp != 0);
IObjectStoreItemPtr spIObjectStoreItemEntryTemplate = spISelectEntryTemplateRsp->GetObjectStoreItem();
_ASSERTE(spIObjectStoreItemEntryTemplate != 0); std::cout << "Details for the entry template selected by the user:<< std::endl;
std::cout << "ObjectStoreName=" << (LPCSTR) spIObjectStoreItemEntryTemplate->GetObjectStoreName() << std::endl;
std::cout << "ItemType=" << (LPCSTR) CItemTypeConverter::EnumToBSTR(spIObjectStoreItemEntryTemplate->GetItemType()) << std::endl;
std::cout << "VersionSeriesID=" << (LPCSTR) spIObjectStoreItemEntryTemplate->GetVersionSeriesID() << std::endl;
std::cout << "VersionID=" << (LPCSTR) spIObjectStoreItemEntryTemplate->GetVersionID() << std::endl;}
...