+ Start a Discussion
m_roarkm_roark 

Code Libraries and code reuse

Will Apex allow for custom Apex code libraries to be imported for use in an Apex application, and will there be an avenue for us to share these with the community?

For example, my organization produces software, and I have an application in mind which would generate a product key for our software when a new Product record of the appropriate record type is created.  To create these keys, we would want to use an encryption algorithm, such as MD5.

I should, potentially, be able to generate a method using the currently published Apex specification which will generate an MD5 hash from a string.  After generating this code, I would want to reuse it, share it across my organization, and possibly share it with or sell it to other organizations (if for example I went one step further and generated a broad spectrun Apex cryptographic library, similar to the System.Security.Cryptography class library in .NET).  Instead of copying and pasting this method into every project I wish to use it in, I would love to be able to include the project this code is in, and reuse this method, using a few lines of code.  Instead of sharing my source code with the community, I could produce a package which could  then be sold using the AppExchange.
SuperfellSuperfell
Yes, you'll be able to include Apex triggers & packages into AppExchange packages.
HarryKHarryK

Can we package triggers now so we can transfer them across developer Orgs?

I was not able to include triggers with a package I uploaded.

Thanks,

Harry

SuperfellSuperfell
I believe this won't be enabled until Apex Code goes GA.