The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamically update catalog variable on service portal

Sagar Solanki
Kilo Expert

I hope you are ready for a weekend full of fun.

I have a catalog item for ordering a laptop. Users have to request a dell dock separately so I am combining both of them. Below is a screenprint for your reference. How can I display the total price of the order before form submission is done? I want to update the total calculated price field as the user changes the number of laptops and docks required. I tried it with an onChange catalog client script but it did not work. I am not familiar with widgets but looks like this is possible with them.

PS: I don't intend to modify the OOB pricing calculation.

find_real_file.png

Any input/help is much appreciated.

1 ACCEPTED SOLUTION

sandeep24
Mega Guru

Hi Sagar,

 

Use below on chage code

 

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

if (newValue == 1){
    g_form.setValue('price','100');
    
}
if(newValue == 2){
    g_form.setValue('price','200');
    
}
    if(newValue == 3){
    g_form.setValue('price','300');
    
}
    
    //Type appropriate comment here, and begin script below
   
}

 

 

find_real_file.png

View solution in original post

1 REPLY 1

sandeep24
Mega Guru

Hi Sagar,

 

Use below on chage code

 

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

if (newValue == 1){
    g_form.setValue('price','100');
    
}
if(newValue == 2){
    g_form.setValue('price','200');
    
}
    if(newValue == 3){
    g_form.setValue('price','300');
    
}
    
    //Type appropriate comment here, and begin script below
   
}

 

 

find_real_file.png