• Anonymous Developer
  • NEWBIE
  • 10 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 14
    Replies
Good Day everyone 

how do I target this in the community? As I am using font awesome icon as a button. I want the button to go back to the previous page that i visited.


<div><a href="javascript:history.go(-1)"onMouseOver="
self.status.referrer; return true">Back Page</a><div>

Need help. Thanks in advance
 
Build tests for all cases (positive, negative, and bulk) specified in the business requirements by using a class named MaintenanceRequestHelperTest. You must have 100% test coverage to pass this section and assert values to prove that your logic is working as expected. Choose Run All Tests in the Developer Console at least once before attempting to submit this section. Be patient as it may take 10-20 seconds to process the challenge check.


Here's my code:

User-added image

User-added image

User-added image

User-added image

User-added image
 

 Equipment__c =cc.Equipment__c,

                    Origin = 'Web',

                    Date_Reported__c = Date.Today()

                    

                );

                

                If (maintenanceCycles.containskey(cc.Id)){

                    nc.Date_Due__c = Date.today().addDays((Integer) maintenanceCycles.get(cc.Id));

                }

                

                newCases.add(nc);

            }

            

           insert newCases;

            

           List<Equipment_Maintenance_Item__c> clonedWPs = new List<Equipment_Maintenance_Item__c>();

           for (Case nc : newCases){

                for (Equipment_Maintenance_Item__c wp : closedCasesM.get(nc.ParentId).Equipment_Maintenance_Items__r){

                    Equipment_Maintenance_Item__c wpClone = wp.clone();

                    wpClone.Maintenance_Request__c = nc.Id;

                    ClonedWPs.add(wpClone);

                    

                }

            }

            insert ClonedWPs;

        }

    }

}

MaintenanceRequest.apxt :-

trigger MaintenanceRequest on Case (before update, after update) { if(Trigger.isUpdate && Trigger.isAfter){ MaintenanceRequestHelper.updateWorkOrders(Trigger.New, Trigger.OldMap); } }


ERROR: Challenge Not yet complete... here's what's wrong:
We could not find the class 'MaintenanceRequestHelperTest' using assertions in the unit tests.
Does anyone know about this error?

User-added image


Need Help I've been stuck on this problem for almost 3 hours. Thanks in advance
Does anyone know how to solve the second challenge? 
  • Relationships
  • Shift Tracking Fields
  • Hours Tracking Fields
  • Other Fields


Create app fields

Add the fields described to establish object relationships, track shifts, calculate hours, and more.

User-added image

 
public with sharing class AS_customTopbarNotification{
    
    @AuraEnabled
    public static Boolean getMessages(String communityId) {
        
        ConnectApi.FeedElementPage unread = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(communityId, ConnectApi.FeedType.DirectMessages);
        Boolean hasUnread = false;
        
        for (ConnectApi.FeedElement feedEl : unread.elements) {
            if (!feedEl.capabilities.readBy.isReadByMe) {
                hasUnread = true;
                break;
            }
        }
        System.debug('hasUnread ' + hasUnread);
        return hasUnread;
    }
}


Can anyone make a test class out of this code?

Thanks in advance.
Is it possible to delete a direct message inside the community or not? If so can you explain in detail how to do it?


Many thanks in advance.
Good Day to All,

I have a question regarding a custom component on Experience Builder. I created a custom notification in the community and even though the condition of the notification badge is correct the badge does not disappear when I read my message/s. Here are my codes.

HTML:

<template>
    <div class={messageBadge}>
        <i class="inbox__icon fal fa-inbox" style = "font-size: 2em;" onclick={navigateToMessage}></i>
    </div>
</template>

CSS:

.inbox {
    cursor: pointer;
    display: block;
    position: relative;
    width: 25px;
}
.inbox__icon{
    align-items: center;
    color: var(--lwc-colorTextDefault);
    cursor: pointer;
    font-size: 50px;
    justify-content: center;
}
.inbox-unread::before{
    background-color: var(--lwc-colorBorder);
    border-radius: 50%;
    content: '';
    display: block;
    height: 10px;
    left: 20px;
    position: absolute;
    top: 0;
    width: 10px;
}

JS:

import { LightningElement, track , api} from 'lwc';
import {NavigationMixin} from "lightning/navigation";
import communityId from '@salesforce/community/Id';
import getMessages from '@salesforce/apex/AS_customTopbarNotification.getMessages';
export default class AS_InboxMessage extends NavigationMixin(LightningElement)
{
    @api getMessages;
    communityId = communityId;
        navigateToMessage(event){
       
            console.log('clicked');
            const url = '/messages/Home';
            console.log(url);
       
            this[NavigationMixin.Navigate]({
                type: 'standard__webPage',
                attributes: {
                    url : url
                }
            });
            }
        connectedCallback() {
            getMessages({
                communityId : this.communityId
            }).then((result) => {
                    console.log(result);
                    this.getMessages = result;
            }).catch((error) =>{
                    console.log(error);
            });
        }
    get messageBadge() {
        if(this.getMessages != null){
            return this.getMessages ? 'inbox-unread' : 'inbox';
        }else{
            return 'inbox';
        }
    }
}

JS-META.XML:

<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>52.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>AS Message Inbox</masterLabel>
    <targets>
        <target>lightningCommunity__Default</target>
        <target>lightningCommunity__Page</target>
    </targets>
</LightningComponentBundle>

APEX CLASS:

public with sharing class AS_customTopbarNotification{
    
    @AuraEnabled
    public static Boolean getMessages(String communityId) {
        
        ConnectApi.FeedElementPage unread = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(communityId, ConnectApi.FeedType.DirectMessages);
        Boolean hasUnread = false;
        
        for (ConnectApi.FeedElement feedEl : unread.elements) {
            if (!feedEl.capabilities.readBy.isReadByMe) {
                hasUnread = true;
                break;
            }
        }
        System.debug('hasUnread ' + hasUnread);
        return hasUnread;
    }
}



This is LWC if anyone is wondering.

Thanks in advance.​​​​​​
Good Day to all,

Is it possible for a custom component notification created in the community to receive the same notifications as the custom notification inside your org, if so please explain to me how it works?

 
Can anyone make a test class example using these custom fields:
 
  • Option Name
  • Option Value
  • Option Type
  • Community ID

any example will do.


Thanks in advance.
Good Day everyone 

how do I target this in the community? As I am using font awesome icon as a button. I want the button to go back to the previous page that i visited.


<div><a href="javascript:history.go(-1)"onMouseOver="
self.status.referrer; return true">Back Page</a><div>

Need help. Thanks in advance
 
I got an "unexpected error" on a superbadge, and it said to post here with the error ID, which was KSDJVGLC. I'm not sure what info I'm allowed to share/receive, but I'm using a new DE. Can I get some help with this?
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: KSDJVGLC
Thanks for any help you're allowed to provide!
Does anyone know about this error?

User-added image


Need Help I've been stuck on this problem for almost 3 hours. Thanks in advance
Does anyone know how to solve the second challenge? 
  • Relationships
  • Shift Tracking Fields
  • Hours Tracking Fields
  • Other Fields


Create app fields

Add the fields described to establish object relationships, track shifts, calculate hours, and more.

User-added image

 
public with sharing class AS_customTopbarNotification{
    
    @AuraEnabled
    public static Boolean getMessages(String communityId) {
        
        ConnectApi.FeedElementPage unread = ConnectApi.ChatterFeeds.getFeedElementsFromFeed(communityId, ConnectApi.FeedType.DirectMessages);
        Boolean hasUnread = false;
        
        for (ConnectApi.FeedElement feedEl : unread.elements) {
            if (!feedEl.capabilities.readBy.isReadByMe) {
                hasUnread = true;
                break;
            }
        }
        System.debug('hasUnread ' + hasUnread);
        return hasUnread;
    }
}


Can anyone make a test class out of this code?

Thanks in advance.
Is it possible to delete a direct message inside the community or not? If so can you explain in detail how to do it?


Many thanks in advance.
Good Day to all,

Is it possible for a custom component notification created in the community to receive the same notifications as the custom notification inside your org, if so please explain to me how it works?

 
Can anyone make a test class example using these custom fields:
 
  • Option Name
  • Option Value
  • Option Type
  • Community ID

any example will do.


Thanks in advance.
i need to retrieve all case records that are added 50 days before(last created case should be display first) and case origin should be email. How to write query for this?
Hi,

Im stucked on this report for 10 days i tried every setting but couldnt make it work, i dont know what i'm doing wrong ??
User-added imageUser-added imageUser-added image

I use the correct fields, i summarize shift hours by sum
I use correct filters
I use the correct report type!

thanks
Can anybody explain the Annotations concept, types of annotations, why & where to use those ?

Hi All,

 

How can we delete chatter messages present in a SF org?

 

Regards,

Naren

  • April 13, 2012
  • Like
  • 0