How to display a custom field on catalog item form in Portal?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 11:17 AM
Hi Everyone,
I've been asked to add a couple of custom fields to the Header of the Catalog Item form in Portal. I added these fields to the sc_cat_item table but am not able to get them to display on the portal view. I modified the SC Catalog Item widget and was able to put the "Price" field below the 'Short Description" but have cannot figure out what I'm doing wrong to get the custom fields to display.
Here is one of the methods I've tried to display the "u_sla" Translated Text field. What am I missing or am I taking the wrong approach all together?
<h1 class="h2 m-t-none m-b-sm font-thin" ng-if="::data.sc_cat_item.name">{{::data.sc_cat_item.name}}</h1>
<div class="text-muted sc-cat-item-short-description" ng-if="::data.sc_cat_item.short_description">{{::data.sc_cat_item.short_description}}</div>
<br>
<br>
<div class="m-b text-left" ng-if="data.showPrices && (data.sc_cat_item.price || data.sc_cat_item.recurring_price)" >
<b>:</b> {{data.sc_cat_item.price_display}}<em ng-if="data.sc_cat_item.recurring_price" class="cat_item_price"> {{data.sc_cat_item.price ? '+' : ''}} {{data.sc_cat_item.recurring_price_display + ' ' + data.sc_cat_item.recurring_price_frequency}}</em>
</div>
<div class="m-b text-right" ><b>:</b> {{::c.data.sc_cat_item.u_sla}}</div>
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 12:00 PM
What is standing out to me, and maybe there is a reason you included them here is the :: in the below line of code:
ng-if="::data.sc_cat_item.name"
that is used in the html template if you want to set the value once, and only once. Generally it would be used like this in a template: to pull a value, bind it, and let the controller know you are finished with it, it will not change. Can you try removing those and see if the value is correctly pulled from the server? I see them included nowhere in the price field values that you mention are displaying. Is there a reason you included them with the short description? I also see no code above for the sla translated text field, unless I am missing it?
Let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2019 04:49 PM
Strange, I could swear I saw the line when I posted the question. Here it is again with the u_sla piece. I just tried to mirror what the OOB code did for the short_description (minus the ng-if statement).
<div class="text-muted sc-cat-item-short-description" ng-if="::data.sc_cat_item.short_description">{{::data.sc_cat_item.short_description}}</div>
<br>
<br>
<div class="m-b text-left" ng-if="data.showPrices && (data.sc_cat_item.price || data.sc_cat_item.recurring_price)" >
<b>${Price}:</b> {{data.sc_cat_item.price_display}}<em ng-if="data.sc_cat_item.recurring_price" class="cat_item_price"> {{data.sc_cat_item.price ? '+' : ''}} {{data.sc_cat_item.recurring_price_display + ' ' + data.sc_cat_item.recurring_price_frequency}}</em>
</div>
<div class="m-b text-right" ><b>${SLA}:</b> {{::c.data.sc_cat_item.u_sla}}</div>
<br>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 03:15 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2019 03:28 PM