Я тестирую это на Samsung Galaxy S4. На экране «Сведения о рабочем заказе» доступно действие «Take Photo». Я добавил то же действие, которое вызывает функцию launchCameraForPhoto из AttachmentHandler.js на другом экране, но камера не запускается на этом экране. Он отбрасывает исключение TypeError в AttachmentHandler.js при отладке. Как заставить камеру работать на другом экране, кроме сведений о порядке работы? Это как-то связано с контекстом? Вот функция launchCameraForPhoto для вашей справки. Ошибка при отправке this._setRecordOwner (self.ui.getCurrentViewControl(). List [0] .getResource(). GetParent());Камера не работает - MaximoAnyhwere
launchCameraForPhoto: function(eventContext){
if(SystemProperties.getProperty('si.attach.doclink.doctypes.defpath') == null){
throw new PlatformRuntimeException('doctypesDefpathNotDefined');
return;
}
var self = this;
var createDate = eventContext.application.getCurrentDateTime();
//mover para o set owner
if(eventContext.getCurrentRecord()){
this._setRecordOwner(eventContext.getCurrentRecord());
} else {
this._setRecordOwner(self.ui.getCurrentViewControl().lists[0].getResource().getParent());
}
MediaService.capturePictureAsPromise().then(function(result){
if(result.fullPath == null){
//throw new PlatformRuntimeWarning("cameraCancelled");
}else{
result.createDate =createDate;
self._updateAttachmentResourceWithMediaInfo(result);
}
}).otherwise(function(error){
//self.ui.showMessage(error.message);
});
},