Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Need help editing the card under My Items Widget - Remove Quantity

saint
Tera Expert

saint_0-1774270753380.png

 

Hi Experts,

 

I'm trying to get rid of Quantity part from the card under My Items Widget. I'm able to find the scripts for ActivityConfigurationUtilSNC where the code is fetched, but need assistance finding this card configuration so i can clone and edit the code.

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@saint 

you will have to find how it comes in this widget "my-items", this is the main widget

Within this widget you need to find other widget which is rendering that and then make changes to HTML

you need to clone the OOTB widget and then make changes

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur, 

 

Thank you for your reply. I think the widget is using this part of the code to build the card from My Items widget.

 

var activityConfigUtil = new sn_ex_sp.ActivityConfigurationUtil();
        data.activityDetails = activityConfigUtil.getActivityData(data.recordLimit, instanceId, portalId);
        //Map actions with associated card
        for (var cardDataIndex = 0; cardDataIndex < data.activityDetails.listViewData.length; cardDataIndex++) {
            var currCardData = data.activityDetails.listViewData[cardDataIndex];
            currCardData.title = currCardData.title ? GlideStringUtil.unEscapeHTML(currCardData.title) : "";
            currCardData.description = currCardData.description ? GlideStringUtil.unEscapeHTML(currCardData.description) : "";
            currCardData.field1Value = currCardData.field1Value ? GlideStringUtil.unEscapeHTML(currCardData.field1Value) : "";
            currCardData.field2Value = currCardData.field2Value ? GlideStringUtil.unEscapeHTML(currCardData.field2Value) : "";
            if (currCardData.actionsWidgetDetail) {
                var context = currCardData.actionsWidgetDetail.parentRecordSysId;

                var actionsWidget = $sp.getWidget("action-widget", {
                    table: currCardData.actionsWidgetDetail.parentTable,
                    context: context,
                    action_group: currCardData.actionsWidgetDetail.actionGrpSysId,
                    max_button_count: 2,
                    primary_colored_button: true,
                    more_icon: 'fa-ellipsis-v'
                });

                currCardData.actionsWidget = actionsWidget;
                currCardData.actionsContext = context;
                currCardData.isActionWidgetVisible = true;

 

The reason its not Todos Requested Item Approval is I have a clone of it already with the commented lines which you have mentioned below. Having said that, I'm trying to understand the Angular ng-template associated with this widget called "card-template".

 

No luck yet. Please let me know if you find anything more. I'll keep you updated. Thanks for your assistance. 

@saint 

I think it's something to do with the Todos Requested Item Approval widget only

Did you check that?

Because that's the widget used in the related list under Todos configuration

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Ankur Bawiskar
Tera Patron

@saint 

this is the widget "Todos Requested Item Approval" which is rendering the quantity, etc

-> clone this widget

-> comment the HTML for quantity

-> then add this newly cloned widget in Todos configuration section in related list

55.png

56.png

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader