You need to sign in to do that
Don't have an account?

Crearing Custom fields using Apex code....
Hi Everyone
Can we create custom fields using apex code ?? if anybody have any code sample or link then do let me know....
Thanx in advance
Vishal
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi Everyone
Can we create custom fields using apex code ?? if anybody have any code sample or link then do let me know....
Thanx in advance
Vishal
Hi Vishal ,
I believe you can create custom fields by using metadata api in external application. However, according to me, through apex it is not possible.
Hello,
You cannot access the Metadata API through (via) Apex. MetaData API is actually treated or intended to be used as Web Serivce API to be used for external clients
On the other hand, you can't even callout web service API within the salesforce, just keep this in mind, you are always open to call external web service API.
Henceforth, as of know, programmatically you cannot use the the Apex or some dynamic code to create custom fields.
Anybody with suggestion/solution is highly welcome, if have any code bubbling in the think tank
Hi Vishal,
I have tried this an year ago. As far as I know, we can't create custom field in Apex. But we can create custom objects and fields PROGRAMMATICALLY in Java and Dot Net. I tried upto this. As told by Hpandey_ForceLabs, we can't make callouts in Apex. It may sound some strange but if you can generate WSDL from Java and then from WSDL you can generate APEX. I dont know the end result though. :)
See this blog:
http://www.tgerm.com/2010/12/invoking-apex-wsdl-web-services-from.html
You can use APEX to call the API and Metadata API by writing your own SOAP envelopes, but to add a field requires both some xml maniplation and also requires the ability to unzip/zip your metadata package. APEX can manipulate the xml but cannot handle binary manipulate so writing/converting custom unzip/zip classes are not possible.