
formula multiplefile = multiplefile problem
Collapse
X
-
Hi rabii Thank you for the information. But I am not that advanced a user. And even trying what you said scares me.I tried a few formulas. But I couldn't succeed. For now, I am doing the same file manually by adding it to two fields separately.
-
you can create a custom formula script to copy the attachment and preserve the sourceId to avoid duplicating the file. check the service of the attachment also repository of the attachment. It has already a copy method
EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.
here is an implementation in the Lead ConvertService
Last edited by rabii; 12-21-2024, 11:16 AM. -
interesting perspective. if i were to apply it to just one area i would definitely try it. but i have three areas to apply this example to.
so i took the risk of taking up disk space. copying what i added to one area to another area will do the trick. -
I believe, it is not possible without a nother upload this way. But I think - and that is what I meant in my last post - that you could create another entity for the files and link it two times to your entity Easy Flow, there you could choose from the file-Entity the files you need. In that case, the files would be linked and it would not be necessary to upload them again.
This is a possibility for a solution, but I did not test something like that. I think it is worth it though.Leave a comment:
-
lazovic yes I want to copy multiple attachments from offermultiplefile field to offerkopya field. the names of the fields are correct.Leave a comment:
-
brotherlouie,
Please clarify: do you want to transfer several attachments from field offermultiplefile to field offerkopya? Please also check the names of these fields very carefully. This information is needed so that we can customize the formula script specifically for your case.Leave a comment:
-
Hi shalmaxb. I have an entity named "EasyFlow". I have two fields in this entity where I will add multiple files. My first field is called "offermultiplefield". My second field is called "offerkopya".
I want the files I add to the "offermultiplefield" field to be automatically created in the "offerkopya" field. And I need a formula that triggers this.
The problem I mentioned at the beginning of the form was that the formulas below did not work.
offerkopyaIds = offermultiplefieldIds;
offerkopyaName = offermultiplefieldNames;
offerkopyaType = offermultiplefieldTypes;
lazovic said that this formula would not work and that I could create an example according to the formula script at https://forum.espocrm.com/forum/deve...-email-formula link and solve my problem. I tried to create a formula based on this.
And I couldn't. So I asked for yours help.Leave a comment:
-
It is always difficult to understand the intention of other users, because you have to know a bit about the app and what you wnt to achieve.
Perhaps ist would help, if you would describe, what this is all about. I have some kind of guessing, that it could be solved completely different.
Sometimes you get an idea of a possible solution, because you do not know yet espoCRM in every detail of possibilities. I only can state, that I already had so many surpising success, because espoCRM is excellently thought and programmed.
Saying this, let`s not give up.Leave a comment:
-
lazovic and shalmaxb thank you very much for your help.
https://forum.espocrm.com/forum/deve...-email-formula I tried to do something based on this link but I couldn't. I don't want to waste your time. I tried to adapt the formula according to the code in the link. I tried all variations. (I don't know how to code) I couldn't. Can you take a look at the code logic one last time?
My main entity's name is EasyFlow. The fields I'm trying to copy are in the same entity. One is called offermultiplefile and the other is called offerkopya. I want to copy the files added to the offermultiplefile section to the offerkopya field.
I have changed the fields in the formula many times. The last one I tried is as follows.Of course, most of the fields mean nothing to me. (Since I don't know how to code)
$i = 0;
$offerMultipleFileIds = list();
while(
$i < array\length(offerkopyaIds),
$offerkopyaIds = array\at(offerkopyaIds, $i);
$offerMultipleFileIds = record\create('EasyFlow',
'role', 'EasyFlow',
'type', record\attribute('EasyFlow', $offerkopyaIds, 'type'),
'size', record\attribute('EasyFlow', $offerkopyaIds, 'size'),
'global', record\attribute('EasyFlow', $offerkopyaIds, 'global'),
'name', record\attribute('EasyFlow', $offerkopyaIds, 'name'),
'sourceId', $offerkopyaIds,
'storage', record\attribute('EasyFlow', $offerkopyaIds, 'storage')
);
$offerMultipleFileIds = array\push($offerMultipleFileIds, $offerMultipleFileIds);
$i = $i + 1;
);
Thank you again for your help.Leave a comment:
-
if you add an attachment to a field (attachment multiple or image) it will always be physically present in your upload folder and any of these attachment will get an id of its own. It will be the same, if you copy the attachment by formula. With the mentioned field types, you will get a physical copy and this is treated like a new upload.
the only way I see is to copy the URL of that attachment to the copy field, which you could achieve with a text field, where you concatenate the path and id. In this case, you will only see a link in the copied field.
I think copying by formula and displaying a present file in the attachments two times will not be possible.Leave a comment:
-
brotherlouie,
There is no other solution, this is the logic that is currently established. Each attachment in EspoCRM has its own place; even if it is an absolute duplicate, it must fully "exist".Leave a comment:
-
Hi lazovic,
I understand what you said. I like this perspective. However, this solution seems to affect my disk space. Am I right? Because it will create another copy for the attachments I add (jpg, png, pdf). And it will affect my disk space as much as the file sizes. The same attachment will be saved more than once.
I want the same files to appear as read-only. Do you have a different suggestion for this?Leave a comment:
-
Hi brotherlouie,
In this case, you need to create attachments again with a formula script and bind them to a new field. Here you can see an example of working with attachments in a formula script: https://forum.espocrm.com/forum/deve...-email-formula.👍 1Leave a comment:
-
Ashif Malayil hello, I tried it with one formula, but I can't get any results.
I have three options when writing a formula. fieldId, fieldName and fieldType. I tried all of them individually and it didn't work. I tried them both as binary and it still didn't work.👍 1Leave a comment:
Leave a comment: