Script for creating a product "basket"?

Script for creating a product "basket"?

I trying to create a multline field that's supposed inherit the current value of the Product field, based on a manual trigger (pick list). So far I've manage to copy the value to the Product field to the basket, it's pretty straight forward, but I can't figure out how to solve the rest.

First, the vaule is overwritten every time, I would like them to be added instead, on the next row, or space-separated. I'd also like the pick list that I use as the trigger (additional field "add to basket" yes/-), to be resetted to "-" every time it's triggered by "yes". Se the script below.


var product=$CS.getText("PRODUCT")
$CS.setValue("UDF_CHAR3",product);


Any suggestions?

                New to ADSelfService Plus?