views:

24

answers:

2

When I try to create a new OpportunityLineItemSchedule I'm running into following error..

Error code: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY

Error message: insufficient access rights on cross-reference id

Attached is the code snippet. Any help will be extremely useful.

SObject[] rs = new SObject[1];
MessageElement[] specificRS = new MessageElement[6];
specificRS[0] = new MessageElement(new QName("OpportunityLineItemId"),"00k7000000DFLqfAAH");
specificRS[1] = new MessageElement(new QName("Description"),"Rev Schedule Descr");
specificRS[2] = new MessageElement(new QName("Type"),"Quantity"); 
specificRS[3] = new MessageElement(new QName("Quantity"),(double)2);
specificRS[4] = new MessageElement(new QName("Revenue"),(double)400000.00);
specificRS[5] = new MessageElement(new QName("ScheduleDate"),"2010-10-30");

rs[0] = new SObject();
rs[0].setType("OpportunityLineItemSchedule");
rs[0].set_any(specificRS);

SaveResult[] sr = null;
try {
  sr = binding.create(rs);
} catch (Exception ex) {
  System.out.println("An unexpected error has occurred." + ex.getMessage());
  ex.printStackTrace();
  return;
}