I have been having a problem where order.getItemCode() has been at times returning null. I have an app that responds to the clover.intent.action.MODIFY_ORDER intent so it can be launched from within the Register app. In the activity that launches if I call OrderConnector.getOrder(orderId) then the JSON includes the itemCode for each of the items in the order. Therefore each call to lineItem.getItemCode() gives me back a String. However if I do the following steps then lineItem.getItemCode() will return null

  1. Press the home button
  2. Open the Orders app
  3. Click on a previous order (don't reopen it)
  4. Click on the done button
  5. Open the Register app - my activity is displayed as it was previously paused by pressing the home button

Now with the call to OrderConnector.getOrder(orderId) - orderId is the same as the previous call as we didn't reopen the old order - the JSON returned does not include itemCode so for the order any call to lineItem.getItemCode() will always return null. As I need the itemCode for my app to function correctly I'm just wondering if my only way out of this prolem is to make a call using the InventoryConnector to get the parent Item in the inventory and get the itemCode that way? It's going to slow things down a bit I guess. Is there a reason why the itemCode is not returned in the json when the steps above are carried out?

Thanks, Steve

asked 2016-05-05 08:49:20 -0500

Steve Egan gravatar image

updated 2016-05-05 09:20:45 -0500