レコードプロデューサーのリストコレクターの制御について

TianhanJ
Mega Guru

レコードプロデューサーのリストコレクター変数について、

デフォルトで最大何個まで選択できますでしょうか?

また、選択できる個数を制御することができますか?

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron

@TianhanJ 

you cannot enforce minimum value in list collector without scripting.

So if you want user to select max 5 values then you will have to use onChange catalog client script and throw error to user if they cross that limit.

Something like this

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || !newValue) {
        return;
    }

    var selectedValues = g_form.getValue('<list_collector_name>').toString().split(',');

    if (selectedValues.length > 10) {
        alert('You can select a maximum of 10 values.');
    }
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@TianhanJ 

you cannot enforce minimum value in list collector without scripting.

So if you want user to select max 5 values then you will have to use onChange catalog client script and throw error to user if they cross that limit.

Something like this

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || !newValue) {
        return;
    }

    var selectedValues = g_form.getValue('<list_collector_name>').toString().split(',');

    if (selectedValues.length > 10) {
        alert('You can select a maximum of 10 values.');
    }
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Thanks for your response.

I'm done with it.

 

And what is the default maximum number of the list collector?