Show Price on Portal catalog view from items in a list collector

iDNS
Tera Expert

Hi Folks,

 

I have a Catalog Item that has a List Collector from cmdb_cI_appl with list of Software & a Custom Column named Software Cost. I have created a Catalog to request for Software but unable to show the price in Catalog View. I have tried to enable Pricing implications post updating Cost for a given line item but the cost is not shown.

 

I am trying to avoid an additional variable to calculate the cost, even if I have a variable that calculates the cost how do I push that to the Price field upon submission on the Catalog. Any thoughts will be helpful. Thanks 

 

iDNS_0-1741528408408.png

 

5 REPLIES 5

Shivalika
Mega Sage

Hello @iDNS 

 

Please create another variable that will store the cost of the selected values from the list collector. 

 

You will need to create a on change catalog client script and pass the values using glideAjax, then you can concatenate all the price values that you got and update the field. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway,

 

Regards, 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Thanks Shivalika, I have gone down this route to create a variable named total_cost & displayed on the Catalog form. I have a OnSubmit Script to update the Price. It still sets to 0 instead of the total_cost. 

 

iDNS_0-1741529690598.png

 

Hello @iDNS 

 

Please share client script and script include screenshot 

 

Regards, 

Shivalika

Thanks, I was not converting the data types causing an issue. I was able to convert to a float & that fixed my issue. BTW I had to use a BR instead of a Client Script. The Client script refuses to work.

 

function onSubmit() {
    var totalCost = g_form.getValue('total_cost'); 
    var finalCost = totalCost.replace('£', ''); 
    //alert(finalCost); 
    g_form.setValue('price', finalCost); 
}