Skip to content

MobileCRM.Services.DocumentService.selectPhoto

rescocrm edited this page May 15, 2023 · 9 revisions

Asks the user to choose a media (image, video, depending on the value of allowChooseVideo property) and calls the async callback with file info.

Arguments

Argument Type Description
callback function(MobileCRM.Services.FileInfo) The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallback function(errorMsg) The errorCallback which is called in case of error.
scope Object The scope for callbacks.

This example demonstrates how to select a photo.

var service = new MobileCRM.Services.DocumentService();
service.selectPhoto(function (fileInfo) {
	/// <param name='fileInfo' type='MobileCRM.Services.FileInfo '/>
	MobileCRM.bridge.alert("File pasted: " + fileInfo.filePath + '\n' + fileInfo.url);
	document.getElementById("imgElement").src = fileInfo.url;
}, MobileCRM.bridge.alert);
Clone this wiki locally