Tuesday, November 27, 2018

Require attachment for catalog item in Platform and Service Portal

Follow the below steps:-

1.Create UI Script

UI Script: GlobalCatalogItemFunctions
Global: true
Script:

function getSCAttachmentCount() {
   var length;
   try {
   length = angular.element("#sc_cat_item").scope().attachments.length;
   } catch(e) {
   length = -1;
   }
   return length;

}


2. Select your Portal > Theme(Open the theme and go to the related list section, click JS include tab and click the new UI action). 

Create New:- JS Theme

Display Name:- GlobalCatalogItemFunctions

Source:- UI Script

UI Script: GlobalCatalogItemFunctions(Select the UI script that is you created)


3. Catalog Client Script:

function onSubmit() {

   //Works in non-portal UI

   try {

   var attachments = document.getElementById('header_attachment_list_label');

   if (attachments.style.visibility == 'hidden' || attachments.style.display == 'none' ) {

   alert('You must attach the completed form before submitting this request.');

   return false;

   }

   }

   //For Service Portal

   catch(e) {

   var count = getSCAttachmentCount();

   if(count <= 0) {

   alert('You must attach the completed form before submitting this request.');

   return false;

   }

   }

}

Tuesday, October 9, 2018

Prevent users from following records in Connect for a specific table

Users can follow records in Connect for any table that extends Task [task] by default. You can disable this functionality for a specific table.

To disable record conversations for a specific table, prevent the Follow button from appearing in form headers for the table. To do so, set the live_feed dictionary attribute to false for the table.

Procedure
  1. Navigate to the list view of a table for which you want to disable record conversations.
  2. Right-click any column header.
  3. Select Configure > Dictionary.
  4. The list of dictionary entries for the table appears.
  5. Open the dictionary entry that has Type set to Collection.
  6. The Dictionary Entry form appears.
  7. In the Attributes related list, locate the Live feed dictionary attribute.
  8. Set the Value to false.