Attachments With Reference Id
Question
Application Type
Reactive
Service Studio Version
11.12.0 (Build 48966)

Hi,

I have Add Employee Screen which Add/Edit Employee data in the Screen. Also, have attachments (More than one) associated with EmployeeId on the same Screen. (when clicked on attachment it will open popup to attach file and Submit button to save attachment with EmployeeId in Attachment Entity).

While Adding  user will will fill the employee details and then attach multiple file as I mentioned above.

Since in this Scenario EmployeeId is 0 then how can I get EmployeeId while saving attachments in Attachment Entity?

Thanks.. 

mvp_badge
MVP

Hi R J,

You obviously cannot. That is, as long as you haven't saved an Employee yet, you cannot create an attachment that's linked to that employee.

The question is though, why do you want to store the documents in the database before you have stored an employee? You can just keep the documents in memory, and keep them there until the employee is saved.

Thanks @Kilian Hekhuis 

Let suppose user attached 5 file of 10MB each then it will hit any kind of performance issue. Or is there any other way we can achieve this?

If not then can you send me the one demo oml that will be really helpful for me.

Thanks in Advance.

mvp_badge
MVP

I'm not sure why 50 MB would be a "performance issue", as computers nowadays have at least 8-16 GB available, assuming you use Reactive. When using Traditional, you're talking server-side, so then there's definitely no memory problem. Of course, uses shouldn't try to upload Blueray rips, but then you'd have problems with your database too...

mvp_badge
MVP

Unfortunately I don't have time for that. But you should be able to figure it out, just have a List of a Structure that holds the binary (and filename, if needed).

Ok I got it. Will create Local variable as data type List of Structure and store the binary data with other information in that variable.

Thanks once again... 

mvp_badge
MVP

Yw. Another option, if you really must store the documents in the database, would be to create an Employee record in the database even before the user fills anything, with a status of "Draft" and use the Id to store the documents. But that would require clean-up timers for drafts that are too old, so can best be avoided.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.