I was trying change an EquitySecurity field value using the following piece of code.
SecuritySearchRequest request = new SecuritySearchRequest();
request.addExternalId(ExternalId.of(ExternalScheme.of("ticker"), "AAPL"));
SecuritySearchResult result = _securityMaster.search(request);
for (SecurityDocument doc:result.getDocuments()) {
EquitySecurity equitySec = (EquitySecurity) doc.getObject();
equitySec.setShortName("APPLE INC1");
doc.setObject(equitySec);
_securityMaster.update(doc);
}
I got the error https://gist.github.com/4248905
surprisingly I found that the field value has changed on the run. May I know what the errror indicates?
is there a better way to change the field of a equitySecurity object?