I understand that CompanyImage was changed at some time or another. I think it worked as one image per company, which is obviously not the case anymore.
I think that the table works on the following concept:
- A record is identified by RefRecId and RefTableId.
- If the Table is CompanyInfo, 3 images can be saved, provided by the enum CompanyImageType.
Is that correct?
What I do not understand:
- Why is there a RefCompanyId field? The table is saved per company, so how is it relevant?
- Why is there a HasImage field? I mean if there is no record, then there is no image. Why is it there? And from OMLegalEntity form, if one deletes an image, the record is also deleted. (I would reason that because there is a field that specifies whether there is an image, the record wouldn't be deleted, the HasImage field would just be changed to NoYes::No.)
- Is FormLetter::companyLogo() still relevant? It more-or-less comes down to a CompanyImage being selected where CompanyImage.RefCompanyId == curExt(). And when a Company Logo is uploaded on the OMLegalEntity form, the CompanyImage.RefCompanyId defaults (in my case to DAT). Thus the method doesn't work. Or what am I missing or doing wrong?
Example of RefCompanyId defaulting to DAT (I added the image on the OMLegalEntity form).
The method called by FormLetter::companyLogo(). Parameter _refDataareaId will be curext() and from the previous screenshot, it is clear that CompanyImage.RefCompanyId was not saved as curext(), but as some default (in my case DAT).
Please let me know if I am unclear
Thanks for reading