I am looking to add a Cancel Button to a Customers...
# suitecommerce
b
I am looking to add a Cancel Button to a Customers order Summary. But I am struggling to figure out what view to append to in my extension. Is there a list somewhere of all the views the sites use? I am newer to this, so I guess what is the best way to determine the view to be modified
s
What is the reason for why you’re not using the built-in order cancellation functionality?
b
We want to allow them to cancel an individual item.
s
Ah, tricky
The best way to find a view placeholder to add it to is to use the browser’s developer tools and inspect an element nearby to what you want
Essentially, anything with a data-view property will support injecting a view into it
b
Ok, thanks
Also, how would we use the built-in order cancellation functionality for the whole order?
s
Order cancellations are only available when the order status is set to Pending Approval, so you will need to have your order processing set to require approval before moving to Pending Fulfillment
b
And then it just appears on its own?
s
Yes
It’s something we get ‘baked in’ from NetSuite. Essentially, when SC requests the order info from NetSuite, we get sent a status and we derive an
isCancelable
value from that, based on whether it is Pending Approval or not
If orders auto-approve then cancellations are never available to the user
Relevant code form SuiteScript/OrderHistory.Model
b
I've managed to get a button that closes individual lines on the sales order. The only problem is that I cant find anywhere in the front end that lets me know if a line is closed. Do you know where that information might be, or how I can add that? I am looking for this value from the SO. And trying to add it to this view.
message has been deleted
message has been deleted
s
It would probably not be information that the service is set up to request, so you would have to modify the service to fetch it or create your own one