hi
i am trying to update the customer based on internel id
but its thrwing the error
[Code=INSUFFICIENT_PERMISSION] You do not have permissions to set a value for element entityid due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.
where i need to set the permissions for this...
I am fetchimg the customers data,solutions topics data successfullly
for update its thwing this error
please help ,e out
public void updateCustomer() throws RemoteException,
ExceededUsageLimitFault, UnexpectedErrorFault, InvalidSessionFault,
ExceededRecordCountFault {
// This operation requires a valid session
this.login(true);
Customer customer = new Customer();
// Get internalId for update
_console.write("\nEnter internalId for customer record to be updated : ");
customer.setInternalId(_console.readLn().toUpperCase());
// Set name and email
customer.setEntityId("XYZ 2 Inc");
customer.setCompanyName("XYZ 2, Inc.");
customer.setEmail("bsanders@xyz.com");
// Populate the address. Updating a list through WS results in the
// entire contents of the previous list being replaced by the new
// list.
CustomerAddressbook address = new CustomerAddressbook();
address.setDefaultBilling(Boolean.TRUE);
address.setDefaultShipping(Boolean.FALSE);
address.setLabel("Billing Address");
address.setAddr1("4765 Sunset Blvd");
address.setCity("San Mateo");
address.setState(State._california.toString());
address.setCountry(Country._unitedStates);
// Attach the address to the customer
CustomerAddressbookList addressList = new CustomerAddressbookList();
CustomerAddressbook[] addresses = new CustomerAddressbook[1];
addresses[0] = address;
addressList.setAddressbook(addresses);
customer.setAddressbookList(addressList);
// Invoke add() operation
WriteResponse response = _port.update(customer);
// Process the response
if (response.getStatus().isIsSuccess()) {
_console.info("\nThe following customer was updated successfully:"
+ "\n key="
+ ((RecordRef) response.getBaseRef()).getInternalId()
+ "\n entityId="
+ customer.getEntityId()
+ "\n companyName="
+ customer.getCompanyName()
+ "\n email="
+ customer.getEmail()
+ "\n addressbookList[0].label="
+ customer.getAddressbookList().getAddressbook(0)
.getLabel());
} else {
_console.error(getStatusDetails(response.getStatus()));
}
}
thanks and regards
Ravi