• Dharmin Kansara 8
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies

Hello, 

I am aware that we can run flows normally every day at a specific time, but how can we run it every hour, I need my certain Cases to be edited every hour. To be specific, when record is edited it will trigger a record-triggered flow which will do an action.

 

There is also an app --> https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FZ981UAD&tab=r

But this is not working for me, I can see apex job running but my Cases are not updated.

 

Can you help, I am sure it is possible to do atleast with Apex Jobs

 

I want the apex class  to return a list of Topics in experience cloud, I am getting error that variable does not exists: getNavigationTopics

 

Here is the code, and also can you please provide a test class for this? 

public with sharing class CustomAccordionLWC{
    @AuraEnabled(cacheable=true)
    public static List<ConnectApi.Topic> getNavigationTopics(){

        string commId = [Select Id from Network where Name = 'Payer Help Center'].Id;    
        ConnectApi.ManagedTopicCollection topics = ConnectApi.ManagedTopics.getManagedTopics(commId);
        for (ConnectApi.ManagedTopic managedTopic : topics.managedTopics) {
            System.debug('###managedTopic.topic.name = ' + ((ConnectApi.Topic)managedTopic.topic).name);
        
            Set<String> topicNames = new Set<String>();
            for (ConnectApi.ManagedTopic childManagedTopic : managedTopic.children) {
                topicNames.add(((ConnectApi.Topic)childManagedTopic.topic).name + '\n');
            }
        
            System.debug('### childTopicNames:\n' + String.join(topicNames, '\n'));
        }
			return getNavigationTopics; 
    }
            
}
 

 

I have a use case where I want to show my guest users a list of topics in the form of Accordion, the accordion should have all the sub-topics (child topics) when user is on topic (parent) page.

 

I have created a LWC and I am already aware we can query topics using ConnectedAPI (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ManagedTopics_static_methods.htm#apex_ConnectAPI_ManagedTopics_getManagedTopics_3) so here is my code below, this can query Parent Topic, but I don't know how to query sub-topic and relate to Accordion.

 

.html

<template>
    <lightning-card lwc:if={topic.data} title={name} icon-name="utility:knowledge_base">
        <div class="slds-m-around_medium">
            <lightning-button
                label="Expand All"
                onclick={expandAll}
                class="slds-m-around_medium">
            </lightning-button>
            <lightning-button
                label="Collapse All"
                onclick={collapseAll}
                class="slds-m-around_medium">
            </lightning-button>
        </div>


        <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium" active-section-name={activeSections}>
            <lightning-accordion-section name="A" label={topicList}>
                <p>
                    Related Article 1 - for Payment & Deliveries   <br/>                      
                    Related Article 2- for Payment & Deliveries   <br/>
                    .....  {recordId} <br/> 

                    
                    
                </p>
                <p><lightning-formatted-url value="https://elopage.my.site.com/helpcenter/s/topic/{recordId}"  
                    label="Related Article 1 - for Payment & Deliveries " target="_blank" ></lightning-formatted-url></p>
                <p><lightning-formatted-url value="https://elopage.my.site.com/helpcenter/s/topic/{recordId}"  
                    label="Related Article 2 - for Payment & Deliveries " target="_blank" ></lightning-formatted-url></p>    

            </lightning-accordion-section>
            <lightning-accordion-section name="B" label="Notes On End Customer Support">
                <p>
                    Testing 4<br/>
                    Testing 5<br/>
                    Testing 6<br/>

                </p>
            </lightning-accordion-section>
            <lightning-accordion-section name="C" label="Contact The Seller">
                <p>
                    Testing 7<br/>
                    Testing 8<br/>
                    Testing 9<br/>
 
                </p>
            </lightning-accordion-section>
        </lightning-accordion>
    </lightning-card>
</template>


.js

import { LightningElement, api, wire} from 'lwc';
import { getRecord, getFieldValue } from 'lightning/uiRecordApi';

import TOPIC_NAME from '@salesforce/schema/Topic.Name';


const fields = [TOPIC_NAME];

export default class CustomAccordionLWC extends LightningElement {



// handling Topic header (parent)    
    @api recordId;

    @wire(getRecord, { recordId: '$recordId', fields })
    topic;

    get name() {
        return getFieldValue(this.topic.data, TOPIC_NAME);
    }

 


// handling the button actions
    activeSections = [];

    expandAll() {

        this.activeSections = [ 'A', 'B', 'C' ];

    }

    collapseAll() {

        this.activeSections = [];
 
    }

}


.cls

public with sharing class CustomAccordionLWC{
    @AuraEnabled
    public static List<ConnectApi.Topic> getNavigationTopics(){
    string commId = [Select Id from Network where Name = 'Payer Help Center'].Id;    
    ConnectApi.ManagedTopicCollection topics = ConnectApi.ManagedTopics.getManagedTopics(commId);
    for (ConnectApi.ManagedTopic managedTopic : topics.managedTopics) {
        System.debug('###managedTopic.topic.name = ' + ((ConnectApi.Topic)managedTopic.topic).name);
    
        Set<String> topicNames = new Set<String>();
        for (ConnectApi.ManagedTopic childManagedTopic : managedTopic.children) {
            topicNames.add(((ConnectApi.Topic)childManagedTopic.topic).name + '\n');
        }
    
        System.debug('### childTopicNames:\n' + String.join(topicNames, '\n'));
    }
    }
}

What am I missing here? Can someone help?

Hello, 

I am aware that we can run flows normally every day at a specific time, but how can we run it every hour, I need my certain Cases to be edited every hour. To be specific, when record is edited it will trigger a record-triggered flow which will do an action.

 

There is also an app --> https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FZ981UAD&tab=r

But this is not working for me, I can see apex job running but my Cases are not updated.

 

Can you help, I am sure it is possible to do atleast with Apex Jobs

 

I want the apex class  to return a list of Topics in experience cloud, I am getting error that variable does not exists: getNavigationTopics

 

Here is the code, and also can you please provide a test class for this? 

public with sharing class CustomAccordionLWC{
    @AuraEnabled(cacheable=true)
    public static List<ConnectApi.Topic> getNavigationTopics(){

        string commId = [Select Id from Network where Name = 'Payer Help Center'].Id;    
        ConnectApi.ManagedTopicCollection topics = ConnectApi.ManagedTopics.getManagedTopics(commId);
        for (ConnectApi.ManagedTopic managedTopic : topics.managedTopics) {
            System.debug('###managedTopic.topic.name = ' + ((ConnectApi.Topic)managedTopic.topic).name);
        
            Set<String> topicNames = new Set<String>();
            for (ConnectApi.ManagedTopic childManagedTopic : managedTopic.children) {
                topicNames.add(((ConnectApi.Topic)childManagedTopic.topic).name + '\n');
            }
        
            System.debug('### childTopicNames:\n' + String.join(topicNames, '\n'));
        }
			return getNavigationTopics; 
    }
            
}
 

 

I have a use case where I want to show my guest users a list of topics in the form of Accordion, the accordion should have all the sub-topics (child topics) when user is on topic (parent) page.

 

I have created a LWC and I am already aware we can query topics using ConnectedAPI (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_ConnectAPI_ManagedTopics_static_methods.htm#apex_ConnectAPI_ManagedTopics_getManagedTopics_3) so here is my code below, this can query Parent Topic, but I don't know how to query sub-topic and relate to Accordion.

 

.html

<template>
    <lightning-card lwc:if={topic.data} title={name} icon-name="utility:knowledge_base">
        <div class="slds-m-around_medium">
            <lightning-button
                label="Expand All"
                onclick={expandAll}
                class="slds-m-around_medium">
            </lightning-button>
            <lightning-button
                label="Collapse All"
                onclick={collapseAll}
                class="slds-m-around_medium">
            </lightning-button>
        </div>


        <lightning-accordion allow-multiple-sections-open class="slds-m-around_medium" active-section-name={activeSections}>
            <lightning-accordion-section name="A" label={topicList}>
                <p>
                    Related Article 1 - for Payment & Deliveries   <br/>                      
                    Related Article 2- for Payment & Deliveries   <br/>
                    .....  {recordId} <br/> 

                    
                    
                </p>
                <p><lightning-formatted-url value="https://elopage.my.site.com/helpcenter/s/topic/{recordId}"  
                    label="Related Article 1 - for Payment & Deliveries " target="_blank" ></lightning-formatted-url></p>
                <p><lightning-formatted-url value="https://elopage.my.site.com/helpcenter/s/topic/{recordId}"  
                    label="Related Article 2 - for Payment & Deliveries " target="_blank" ></lightning-formatted-url></p>    

            </lightning-accordion-section>
            <lightning-accordion-section name="B" label="Notes On End Customer Support">
                <p>
                    Testing 4<br/>
                    Testing 5<br/>
                    Testing 6<br/>

                </p>
            </lightning-accordion-section>
            <lightning-accordion-section name="C" label="Contact The Seller">
                <p>
                    Testing 7<br/>
                    Testing 8<br/>
                    Testing 9<br/>
 
                </p>
            </lightning-accordion-section>
        </lightning-accordion>
    </lightning-card>
</template>


.js

import { LightningElement, api, wire} from 'lwc';
import { getRecord, getFieldValue } from 'lightning/uiRecordApi';

import TOPIC_NAME from '@salesforce/schema/Topic.Name';


const fields = [TOPIC_NAME];

export default class CustomAccordionLWC extends LightningElement {



// handling Topic header (parent)    
    @api recordId;

    @wire(getRecord, { recordId: '$recordId', fields })
    topic;

    get name() {
        return getFieldValue(this.topic.data, TOPIC_NAME);
    }

 


// handling the button actions
    activeSections = [];

    expandAll() {

        this.activeSections = [ 'A', 'B', 'C' ];

    }

    collapseAll() {

        this.activeSections = [];
 
    }

}


.cls

public with sharing class CustomAccordionLWC{
    @AuraEnabled
    public static List<ConnectApi.Topic> getNavigationTopics(){
    string commId = [Select Id from Network where Name = 'Payer Help Center'].Id;    
    ConnectApi.ManagedTopicCollection topics = ConnectApi.ManagedTopics.getManagedTopics(commId);
    for (ConnectApi.ManagedTopic managedTopic : topics.managedTopics) {
        System.debug('###managedTopic.topic.name = ' + ((ConnectApi.Topic)managedTopic.topic).name);
    
        Set<String> topicNames = new Set<String>();
        for (ConnectApi.ManagedTopic childManagedTopic : managedTopic.children) {
            topicNames.add(((ConnectApi.Topic)childManagedTopic.topic).name + '\n');
        }
    
        System.debug('### childTopicNames:\n' + String.join(topicNames, '\n'));
    }
    }
}

What am I missing here? Can someone help?
I want to display Featured Topics in an Accordion. I have the Accordion set up in an LWC, but I don't know how to call the Featured Topic from the LWC. Any ideas? Any references that could help?