Hey team, I'm looking to modify the New Case view...
# suitecommerce
p
Hey team, I'm looking to modify the New Case view in MyAccount. Specifically, I want to trigger an event so that when a user selects a value in the Type of Inquiry field, a different predefined message is automatically inserted into the Message textarea. I've tried several approaches without success. There doesn’t seem to be a Case Component available in the Extensibility API, and adding a child view doesn’t seem possible either since there’s no identifiable parent view. A similar example from the documentation, https://developers.suitecommerce.com/add-a-new-custom-entity-field-to-the-registration-form.html, but this example also uses the Extensibility API. Could someone guide me on how to approach this? Any help would be appreciated!
s
I would probably just write a simple JS script that triggers on an event
You listen to the dropdown and on change, swap out the text of the message field if, and only if, it is empty or if it contains another templated response. (We wouldn't want the customer to spend ages writing out their question only for you to casually delete it.)
p
Awesome! Thanks a lot, that would work
I also learned while doing my tests that the reason it's not a component is because the case form is a page type. So today, I was going to try extending the base page type to add the event. Do you know if that could also be a possibility?
s
Yeah, you could use the layout component to extend that page type to modify its events object