Fetch Catalog Variable from SC Catalog Item Page

sivaranjani3894
Tera Guru

Hi All,

I have a requirement to display a message on right side of Request form if the Catalog Item Variable values meet a condition.

I have created a widget to display message on the right side of "SC Catalog Item" page. I need your help in setting conditions based on the values selected on the Catalog Variable. I tried using below code in Client Controller:

$scope.$watch(function() {
return $scope.page.g_form.getValue('sure').toString();
}, function(value) {
c.data.surevalue = value ? value : "";
});

Getting Error on Console - "TypeError: Cannot read properties of undefined (reading 'getValue')"

Please help with below:
1. getting the value of catalog item variable
2. Display the message widget based on conditions.
 
Thanks,
Siva
1 ACCEPTED SOLUTION

sivaranjani3894
Tera Guru

Resolved now - Below is the steps followed:
1. Create a Widget to capture change in Catalog Item variable and broadcast a variable
2. Create a "Custom" Catalog Item variable and associate the widget created from step 1

3. Create another widget to display necessary text

4. Clone the OOB SC Catalog Item widget to capture the broadcast variable and embed the widget (to display to right side of the page) from step 3 based on broadcast variable value.

View solution in original post

5 REPLIES 5

sivaranjani3894
Tera Guru

Resolved now - Below is the steps followed:
1. Create a Widget to capture change in Catalog Item variable and broadcast a variable
2. Create a "Custom" Catalog Item variable and associate the widget created from step 1

3. Create another widget to display necessary text

4. Clone the OOB SC Catalog Item widget to capture the broadcast variable and embed the widget (to display to right side of the page) from step 3 based on broadcast variable value.