I have two tables (let’s call it A and B). Both have the same picture field.
I create a new record in table B and link it with existing record in table A.
I have a script that when I link those records it copies the picture field from table A to table B.
It’s super easy and it looks something like this:
doo.model.pictureFieldB.setValue(doo.model.tableA.value.pictureFieldA)
For 2 years everything workied perfectly. Now I have a problem. When I try to download this copied picture from table B i get this:
Attachment download failed. Contact your application administrator. Exception of type ‘CorkSolutions.Tabidoo.CoreLib.Exceptions.AttachmentDownloadException’ was thrown. (FileId:‘95162902-2506-4186-a367-1ac2f8f085fa’, ApplicationId:‘f813d698-4dee-4f6e-a62b-2ce582884752’, IsDefinitionImage:False) | GridFS file not found: revision -1 of filename “95162902-2506-4186-a367-1ac2f8f085fa”.
This is the first time I got this message.
Is there another way to copy picture from table A to table B instead of showing the linked field from table A?
Attachment download failed. Contact your application administrator. Exception of type ‘CorkSolutions.Tabidoo.CoreLib.Exceptions.AttachmentDownloadException’ was thrown. (FileId:‘95162902-2506-4186-a367-1ac2f8f085fa’, ApplicationId:‘f813d698-4dee-4f6e-a62b-2ce582884752’, IsDefinitionImage:False) | GridFS file not found: revision -1 of filename “95162902-2506-4186-a367-1ac2f8f085fa”.
information says that the file was not found. Has the file been deleted or changed?
I’ve noticed that when creating record in Table B the image is available for download. After saving a record and opening it again the thumbnail dissapears and I get this error when trying to download.
Please help me fix this because it worked ok before and it’s really important to me
I have this cofigured the same way, but one thing is different.
if (doo.model.ver < 0) {
doo.model.picture.setValue(doo.model.user.value?.picture);
}
I want this picture to be added to record only when creating it and it should stay untouched. I don’t want to link this picture, I want to copy it, so when I change it in first table it won’t change in
second. It worked before, but now it’s not.
So I modified the script according to you and the application works correctly. Please could you write to support@tabidoo.cloud? We can’t solve it here.
Thank you, I managed to get this to work correctly. I don’t know where was the mistake, but now it’s working OK. I hope it will remain this way.
I found another problem about this connection. When I unlink the two records, the thumbnail stay the same, even if I link another record with another picture.
nowhere was it mentioned that this is a link to table type of binding many-to-many. Try to modify the script with the condition user.currentlyChanged. The many-to-many is mostly handled by await doo.table.getData() see the documentation.doo.table - Tabidoo Help Center.
It’s many to one. So in the table B you can select only one record. All the fields from that record are copied properly. About this thumbnail, I mean that the thumbnail stays even if I click the “x” button in the linked field. Then when I link another record with another picture there’s still the old one. I checked logs of this picture field and it’s updating properly - but I don’t see this update in the form. After saving a record and opening again the thumbnail is correct.
I’ll write to support, because now the problem with loading pictures came back…