How do I "Remove All" multirow variable set rows using a client script?

kevinharalson
Mega Expert

I need a client script for use in an onChange function to remove all rows from a multirow variable set.

Scenario

  1. A user will select a CI in a catalog item, and add maximum rows to a multirow variable set based on max_rows attribute.
  2. Then, the user realizes the wrong CI was selected, and changes the selected CI
  3. Upon selection of a new CI, I need a client script to remove all rows from the multirow variable set and enable the "Add" button.

I have tried the following without success

  • g_form.setValue(< mrvs name>, '');
  • g_form.setValue(< mrvs name>, '[]');
  • g_form.clearValue(< mrvs name>);

In all instances the information is removed, but the "Add" button remains disabled.

1 ACCEPTED SOLUTION
30 REPLIES 30

Glad you have it working!

Could you please mark answers as Helpful and maybe the answer linking to the Article as Correct? That way other people can find the answer as well.

Would also really appreciate it if you can mark the article itself Helpful as well.

 

Kind regards,

Willem