You need to sign in to do that
Don't have an account?
Baldeep Hira
Error using metadata API with flex toolkit
Hi Everyone,
I'm trying to use Salesforce metadata API with flex toolkit, not sure if the metadata API is fully supported and tested with flex toolkit (drop dated Feb 22, 2008)? First off, the compiled as3Salesforce.swc library does not contain required metadata classes like CustomObject, CustomField, etc. I figured this might be a linking problem in sample Salesforce.mxml file, as it contains no examples for metadata API. To work around this problem, I've included the source files under toolkit/sdk/src into my flex project. When I try to create a custom object using Connection.createObject(customObjectArray, asyncResponder) I get the following runtime error:
Thanks in advance,
Baldeep Hira
http://www.bhira.net
I'm trying to use Salesforce metadata API with flex toolkit, not sure if the metadata API is fully supported and tested with flex toolkit (drop dated Feb 22, 2008)? First off, the compiled as3Salesforce.swc library does not contain required metadata classes like CustomObject, CustomField, etc. I figured this might be a linking problem in sample Salesforce.mxml file, as it contains no examples for metadata API. To work around this problem, I've included the source files under toolkit/sdk/src into my flex project. When I try to create a custom object using Connection.createObject(customObjectArray, asyncResponder) I get the following runtime error:
(com.salesforce.results::Fault)#0My flex code looks like this:
context = (null)
detail = (null)
faultcode = "soapenv:Client"
faultstring = "Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element"
var cf:CustomField = null;Has anyone tried using metadata API with flex toolkit? Any suggestions?
var co:CustomObject = new CustomObject();
co.fullName = DashboardMdl.OBJECT_NAME;
co.label = DashboardMdl.OBJECT_LABEL;
co.pluralLabel = DashboardMdl.OBJECT_LABEL + "s";
co.description = "Custom object for storing SfDash dashboards.";
co.deploymentStatus = DeploymentStatus.Deployed;
co.enableActivities = true;
co.sharingModel = SharingModel.ReadWrite;
cf = new CustomField();
cf.label = "Name";
cf.type = FieldType.Text;
co.nameField = cf;
var coArray:Array = new Array();
coArray.push(co);
sfConn.createObject(coArray,
new AsyncResponder(function (result:Object):void {
trace("something created, perhaps Custom object!!!.");
}, sfFault)
);
Thanks in advance,
Baldeep Hira
http://www.bhira.net
Hi Baldeep,
FYI
I had same linking problem and do your workaround.
Then a custom object can be created via metadata api using your code.
Thanks,
Aki
I'm trying to create custom fields from flex but I'm having hard time finding the correct syntax, can you please help or share sample piece of code that might help me in creating field.
My piece of code:
Hello Chirag Mehta,
Could you please tell me where I can find (download) the metadata library so I can use such as "var externalIdField:CustomField = new CustomField();"?
Thanks in advance,