• Kman1976
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I have a code in java that upserts Orders & OrderLine Items for custom objects .In the code i set "AllOrNoneHeader" to true to make sure all the line items are successfully inserted other wise roll back everything. I am having hard time to identify which records were exactly failed during upsert.Any idea how to identify those records for further data related investigation.I am trying to exactly identify which records are failing in "objNewOrderLineItems" object in the below code?.

 

Here "objNewOrderLineItems" is of type SObject[]

 

Here is the sample code:

 

                connection.setAllOrNoneHeader(true);
                //MsgOut("SFDCQueryDump>>"+objNewOrderLineItems[0].toString());
                UpsertResult[] upsertResults =connection.upsert("recId_ord_dtl__c", objNewOrderLineItems);
              
                for (UpsertResult result : upsertResults)
                {
                  if (result.isSuccess()) {
                   UpsertLineItemsStatus=true;
                   //MsgOut("\nLineItem Upsert Succeeded.");
                   //MsgOut((result.isCreated() ? "Insert" : "Update") +" was performed."+" With OrderLineItem__C ID: " + result.getId());
                   //MsgOut("OrderLineItem__C ID: " + result.getId());
                  } else
                  {
                   MsgOut("LineItem Upsert Failed Because::" +result.getErrors()[0].getStatusCode());
                   result.get
                   Glbl_ErrorMsg=Glbl_ErrorMsg+"-/-"+result.getErrors()[0].getMessage();
                   UpsertLineItemsStatus=false;
                  }
                }//UpsertResult forloop

 

I get the error message as follows..

LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::INVALID_FIELD_FOR_INSERT_UPDATE
LineItem Upsert Failed Because::INVALID_FIELD_FOR_INSERT_UPDATE
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK
LineItem Upsert Failed Because::ALL_OR_NONE_OPERATION_ROLLED_BACK

 

 

 

Hi I am trying to add new picklist values to an existing custom object's picklist field using MetadataAPI. Articles which i followed are below..


http://www.salesforce.com/us/developer/docs/api_meta/index.htm

http://www.salesforce.com/us/developer/docs/api_meta/Content/meta_update.htm


If any body has implemented this pl's help me it's very importent.  I am getting errors and unable to find any good examples to do this..Thank's in advance............................

 

 

You can find my complete code in the following post

 

https://sites.secure.force.com/success/questionDetail?qId=a1X30000000ITO5EAO

Is there a way that we can automate the Test Data load for every Sandbox Refresh other than the Data Loader.

I heard that we can implement via Informatica Cloud. We do have Informatica Cloud.

 

can any one suggest me how to do that, 

 

Thank you

  • April 26, 2011
  • Like
  • 0

Hello,

 

I have a multi picklist in the Account object and the values should be taken from an object which is external to SF.

 

I want that once I add a new value to this table which is external it will update the multi picklist value through API.

 

I wrote the following code as a simple example:

 

MetadataService ms = new MetadataService();

ms.SessionHeaderValue = new com.salesforce.metadata.SessionHeader();

ms.SessionHeaderValue.sessionId = lr.sessionId;

ms.Url = lr.metadataServerUrl;

 

 

Picklist expenseStatus = new Picklist();

PicklistValue Test1 = new PicklistValue();

Test1.fullName = "Test1";

PicklistValue Test2 = new PicklistValue();

Test2.fullName = "Test2";

PicklistValue Test3 = new PicklistValue();

Test3.fullName = "Test3";

PicklistValue Test4 = new PicklistValue();

Test4.fullName = "Test4";

expenseStatus.picklistValues = new PicklistValue[] { Test1, Test2, Test3, Test4 };

 

 

 

CustomField expenseStatusField = new CustomField();

expenseStatusField.fullName = "Members__c.Application_Progress__c";

expenseStatusField.label = "Application Progress";                   

expenseStatusField.type = FieldType.Picklist;                   

expenseStatusField.picklist = expenseStatus;

Metadata[] mdata = new Metadata[1];

mdata[0] = expenseStatusField;

 

AsyncResult[] ars =

ms.create(mdata);

 

 

I get the following error:

Status: ApiSalesF.com.salesforce.metadata.StatusCode.ALL_OR_NONE_OPERATION_ROLLED_BACK

Status Code: ApiSalesF.com.salesforce.metadata.AsyncRequestState.InProgress

 

Any suggestion?

  • October 31, 2010
  • Like
  • 0