
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 09:14 AM
Hi,
I need to hide the "Submit" button in our Service Portal, only for one Catalog Item.
Do you suggest using a Catalog Client Script or to change the whole SC Catalog Item widget script?
Thanks,
Federico
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 09:20 AM
If you don't want show Submit button and if catalog item is just for informational purpose without any fields/values in it, I recommend you to create a Content Item instead of Catalog item. Content Item does not contain these buttons and can be used in place of catalog item.
Please hit correct based on impact of response.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 09:17 AM
Hi,
Clone widget:
Server Script:
- var validatedItem = new GlideappCatalogItem.get(data.sys_id);
- if (!validatedItem.canView())
- return;
- data.sc_cat_item = $sp.getCatalogItem(data.sys_id);
- //prepped data for the controller here:
- data.sc_cat_item.no_show_attach = validatedItem.gr.u_no_attach == true;
- data.sc_cat_item.no_submit_btn = validatedItem.gr.u_no_submit_button == true;
Client:
- c.showAddCartBtn = function() {
- return c.options.show_add_cart_button &&
- c.data.sc_cat_item.sys_class_name !== "sc_cat_item_producer" &&
- !c.data.sc_cat_item.no_cart;
- };
- //added 2 functions here:
- c.allowAttach = function() {
- return !c.data.sc_cat_item.no_show_attach;
- };
- c.showSubmitBtn = function() {
- return !c.data.sc_cat_item.no_submit_btn;
- };
HTML:
- <!-- added a new ng-if to this line: -->
- <button ng-if="c.showSubmitBtn()" name="submit" ng-disabled="submitted" ng-click="triggerOnSubmit()" class="btn btn-primary">{{submitButtonMsg}}</button>
- <button ng-if="c.showAddCartBtn()" name="submit" ng-disabled="submitted" ng-click="triggerAddToCart()" class="btn btn-default">${Add to Cart}</button>
- <span ng-if="submitting" style="padding-left:4px">${Submitting...}</span>
- <!-- added to the ng-if that was on this line: -->
- <label ng-if="!submitted && c.allowAttach()" style="float:right;font-weight:normal;cursor:pointer;"><sp-attachment-button></sp-attachment-button><span style="padding-left:4px;">${Add attachments}</span></label>
- <div ng-if="hasMandatory(mandatory)" class="alert alert-info" style="margin-top: .5em">
- <span ng-if="hasMandatory(mandatory)">${Required information} </span>
- <span ng-repeat="f in mandatory" class="label label-danger" style="margin-right: .5em; display: inline-block;">{{::f.label}}</span>
- </div>
Source found here:
Hide submit button on load of catalog item in Service Portal
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 09:20 AM
If you don't want show Submit button and if catalog item is just for informational purpose without any fields/values in it, I recommend you to create a Content Item instead of Catalog item. Content Item does not contain these buttons and can be used in place of catalog item.
Please hit correct based on impact of response.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2018 08:25 AM
Thanks Nitin, I didn't know about Content Item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2018 09:26 AM
Hi Federico,
Please check the below links it may help you
Hide submit button on load of catalog item in Service Portal
Hide Service Portal 'Submit' button based on Form condition.
Hide Submit Button in catalog form of service portal