Hello,
Hello I am developing an iPhone application that allows you to edit the values (unlike the official version). It has been going good so far, but I have 2 problems. I cannot approve a Purchase Order, I can edit any of the other fields but not the orderStatus as it fails. Here is my code in objective C and using wsdl2objc:
platformMsgs_UpdateRequest *update = [[platformMsgs_UpdateRequest alloc] init]; // Allocates the update request
tranPurch_PurchaseOrder *order = [self.orders objectAtIndex:indexPath.row]; //Gets the Purchase Order to be modified from UITableView
tranPurch_PurchaseOrder *updateOrder = [[tranPurch_PurchaseOrder alloc] init]; //Allocates a purchase order instance.
updateOrder.internalId = order.internalId; //Sets the internal Id.
[updateOrder setOrderStatus:tranPurchTyp_PurchaseOrderOrderStatus__pendingReceipt]; //Setting order status to pending receipt.
update.record = updateOrder; //Setting the update record to be modified to the purchase order
[updateOrder release]; //memory management
[binding updateUsingParameters:update passport:self.passport preferences:nil]; //Sending the update.
[update release]; //memory management
The message that is send is:
<soap:Body>
<update xsi:type="platformMsgs:UpdateRequest" xmlns="urn:messages_2009_1.platform.webservices.netsuite.com">
<record xsi:type="tranPurch:PurchaseOrder" xmlns="urn:purchases_2009_1.transactions.webservices.netsuite.com" internalId="3">
<orderStatus>_pendingReceipt</orderStatus>
</record>
</update>
</soap:Body>
I am logged as an Administrator (internal role 3) and the response is:
<platformCore:statusDetail type="ERROR"><platformCore:code>INSUFFICIENT_PERMISSION</platformCore:code><platformCore:message>You do not have permissions to set a value for element orderstatus 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.</platformCore:message></platformCore:statusDetail></platformCore:status><baseRef internalId="3" type="purchaseOrder" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2009_1.platform.webservices.netsuite.com"/></writeResponse></updateResponse></soapenv:Body></soapenv:Envelope>
What do I need to do in order to accept a Purchase Order?.
Additionally I am not quite sure how does the Search work exactly I am trying to send a seach like this to bring only purchase orders:
<soap:Body>
<search xsi:type="platformMsgs:SearchRequest" xmlns="urn:messages_2009_1.platform.webservices.netsuite.com">
<searchRecord xsi:type="platformCommon:TransactionSearchBasic" xmlns="urn:common_2009_1.platform.webservices.netsuite.com">
<purchaseOrder xsi:type="platformCore:SearchMultiSelectField" xmlns="urn:core_2009_1.platform.webservices.netsuite.com" operator="anyOf">
<searchValue xsi:type="platformCore:RecordRef" xmlns="urn:core_2009_1.platform.webservices.netsuite.com" type="purchaseOrder"/>
</purchaseOrder>
</searchRecord>
</search>
</soap:Body>
And a couple others but it always returns a response such as:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Server.userException</faultcode><faultstring>org.xml.sax.SAXException: Expected {urn:common_2009_1.platform.webservices.netsuite.com}purchaseOrder, found {urn:core_2009_1.platform.webservices.netsuite.com}purchaseOrder</faultstring><detail><ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">partners-java010.svale.netledger.com</ns1:hostname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
How can I make a search targeting only Purchase Orders right know I am just doing a TransactioSearchBasic that returns everything in transactions, but it is of course not efficient at all. Thank you in advance.
-Oscar