• prafullgupta
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hi,

 

I am trying to delete records from my custom object using the flex API, and I am getting the following error message while deleting the record

 

 "Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element "

 

I am using the following Flex Code:

 

 var recordToDel:SObject = new SObject("MyCustomObj__c");
 var custArrayToDelete:Array = new Array();
 recordToDel.Id = 'a03800000064W9wAAE';
 custArrayToDelete.push(recordToDel);
 apex.deleteObject(custArrayToDelete,new AsyncResponder(function test():void{},apexFailure));

 

 

If anyone have some idea where I am doing wrong, please suggest me...!

 

Thanks,

Prafull Gupta

 

The code:


private function login():void {

    var policyUrl:String = "http://www.salesforce.com/services/crossdomain.xml";
       
    Util.debug(this, "loading the policy file: " + policyUrl);
    Security.loadPolicyFile(policyUrl);


    var lr:LoginRequest = new LoginRequest;
    lr.server_url = Application.application.parameters.server_url;   
    lr.session_id = Application.application.parameters.session_id;
    lr.username = 'username@domain.com';
    lr.password = 'password';           
    lr.callback = new AsyncResponder(loginResult, loginFault);


    Util.debug(this, 'apex.login ( ' +ObjectUtil.toString(lr) +'\n);' );   
    apex.login(lr);

}

private function loginResult(result:Object):void {
    Alert.show("Success");
}

private function loginFault(fault:Object):void {
    Alert.show("Login error!");
}


It always goes straight to loginFault, and here is my error message:


Warning: Ignoring invalid <allow-access-from> tag for domain 'http://www3.stream.co.jp' in policy file at http://www.salesforce.com/crossdomain.xml
Warning: Ignoring invalid <allow-access-from> tag for domain 'http://salesforce.sitestream.com' in policy file at http://www.salesforce.com/crossdomain.xml

[FaultEvent fault=[RPC
    Fault faultString="HTTP request error"
    faultCode="Server.Error.Request"
    faultDetail="Error: [IOErrorEvent
                                        type="ioError"
                                        bubbles=false
                                        cancelable=false
                                        eventPhase=2
                                        text="Error #2032: Stream Error. URL: http://www.salesforce.com/services/Soap/u/9.0"].
    URL: http://www.salesforce.com/services/Soap/u/9.0"]
    messageId="FA86E4BC-40CE-E542-80D0-0F0DF9206919"
    type="fault"
    bubbles=false
    cancelable=true
    eventPhase=2]


I know this is from not having a crossdomain file, but even when I explicitly set one, it defaults to http://www.salesforce.com/crossdomain.xml and NOT http://www.salesforce.com/services/crossdomain.xml. 

Help? :(