simone,
Sure, I am glad to help.
I found a solution using different methods, the best one was via a Server Based Solution using ASP.NET and XFA (XML Form Architecture).
For the ideal solution, which is not very easy to do, but you have control of everything, is posted here:
http://www.adobeforums.com/webx?128@@.3bc38246Also, there another way which is using Data Connection (OLE DB ..etc) and JavaScript from LiveCycle PDF Form, which is client based, and you may have to do some configuration on the Client PC and may need to deploy some Application Level JavaScript File on a special folder on the Client PC.
You may hit some Security Violations Errors from JavaScript and the solution is to follow these steps:
1. Create a Digital Signature Field,
2. Complete your programming and use try-catch to avoid errors. During the testing phase, you may have to using some dummy values for the script which fails due to Security Errors.
3. Before the Go-Live, you must create a Certificate, and sign the form and choose to Sign and Certify the document.
4. The user who need to use the form which has JavaScript that will fail due to security errors, this user must get the public part of your Certificate and add it to the Trusted Certificates. The for the Trust Setting, you must trust the owner of this certificate to execute JavaScript which require high-security. You can do that by right-click Signature, and try to find the Certificate Properties or something like that. Then goto Security Settings, and Choos Contact, Details, and Edit Trust, then change the trust setting of the concerned contact.
5. With every change to the form fields, the certificate will require re-validation. So, you can use the Acrobat Command javaScript Command "signatureValidate(...)" to re-validate the certificate to make it work as expected.
I did not find a way to create an attachment and change its name for the client based solution. It seems this is pre-defined.
Client based solution might be easy to program, but difficult to implement and deploy for a large number of users, and you cannot control everything.
I hope this has answered you question.
Tarek.