Discussion:
help! problem when customize the return command.
(too old to reply)
b***@hotmail.com
2006-10-28 20:42:59 UTC
Permalink
Hi,guys. I have a problem when I try to custmize the return command.
I have created a wrapper command and put required commandcontex and propertie to call ReturnItemAdd command. After command excuted, there is no exception throwed out, and I can get the rma Id and rmaItem Id. However, I cannot find those id in database. So weird!
Belows is the sample code, please help!

if(orderItemId != null)
property.put("orderItemId_" + j, orderItemId);
else
property.put("catEntryId_" + j, catentryId);
property.put("quantity_" + j, returnQuantity);
if(raId==null)
property.put("RMAId", "**");
else property.put("RMAId",raId);

property.put("reason_" + j, defaultReturnReason);


property.put("forUserId", oAB.getMemberId());
property.put("outRMAName","RMAId");
property.put("URL", "");
ReturnItemAddCmd returnItemAdd = (ReturnItemAddCmd)CommandFactory.createCommand(ReturnItemAddCmd.NAME, getCommandContext().getStoreId());
if(returnItemAdd == null)
{
ECTrace.trace(25L, getClass().getName(), "executeReturnItemAdd", "No ReturnItemAddCmd instance");
throw new ECApplicationException(ECMessage._ERR_CMD_CMD_NOT_FOUND, getClass().getName(), "executeReturnItemAdd");
} else
{
tempCmdContext.setLanguage("-1");
tempCmdContext.setStoreId(new Integer(storeentId));
tempCmdContext.setRequestProperties(property);
returnItemAdd.setCommandContext(tempCmdContext);
returnItemAdd.setRequestProperties(property);
// ECTrace.trace(25L, getClass().getName(), "executeReturnItemAdd", "ReturnItemAddCmd request property: " + traceFormat(property));
returnItemAdd.execute();
raId=returnItemAdd.getResponseProperties().get("RMAId").toString();
geo
2006-10-31 15:23:47 UTC
Permalink
If these ids are not showing up in the db, you are likely getting an
exception and associated rollback. I do not see you setting the RMA status
which is required, and there may be additional missing parameters, but I did
not dig too deeply into your sample. There are also a number of requisites
regarding t&c, etc. Feel free to send me the command wrapper and any
necessary registration and I can take a look further if the above does not
get you back on track.
Post by b***@hotmail.com
Hi,guys. I have a problem when I try to custmize the return command.
I have created a wrapper command and put required commandcontex and
propertie to call ReturnItemAdd command. After command excuted, there is
no exception throwed out, and I can get the rma Id and rmaItem Id.
However, I cannot find those id in database. So weird!
Belows is the sample code, please help!
b***@hotmail.com
2006-11-04 00:38:45 UTC
Permalink
You are right. I found an unhandle exception in wrapper command.
Thanks.

BTW, I don't need set the RAM status in wrapper command, since ram was auto approved.

Anyway, thanks

Tony

Continue reading on narkive:
Loading...