Hello,
In this module there are limitatios :
So you need to use another widget.
Thanks,
Srilatha
Hi Sudhir,
Kindly verify the source code below the link.
GitHub - joe-robertson-mx/imageMarker
const saveImage = (): void => {
const ctx = canvasCtxRef.current!;
if (data.items) {
mx.data.get({
guids: [data.items[0].id],
callback(objs) {
const obj = objs[0];
const entityName = obj.getEntity();
mx.data.create({
entity: entityName,
callback: mxObject => {
ctx.canvas.toBlob(blob => {
mx.data.saveDocument(
mxObject.getGuid(),
`${entityName}_${Date.now()}`,
{},
blob!,
() => {
if (context?.items) {
mx.data.get({
guids: [context.items[0].id],
callback(objs) {
const obj = objs[0];
const entityName = obj.getEntity();
const n = entityName.lastIndexOf(".");
const entityNameTrimmed = entityName.substring(n + 1);
const refArr = mxObject.getReferenceAttributes();
const ref = refArr.find(str => {
return str.includes(entityNameTrimmed);
});
if (ref) {
mxObject.addReference(ref, obj.getGuid());
mx.data.commit({
mxobj: mxObject,
callback: () => {},
error: e => {
console.log(
"Error occurred attempting to commit: " + e
);
}
});
}
},
error: e => {
console.log(e);
}
});
}
},
e => {
console.log(e);
}
);
});
},
error: e => {
console.log(e);
}
});
}
});
}
};
you should alter this part of code according to use case. Try to update widget cheers.