• Jonathan Crow 10
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
When I am in the Data Management Import Data trailhead challenge I right click on the file to download the contacts and I get the error message that it failed to find the file contacts_to_import.csv. When I click on the link it sends me to a 404 not found error on Github. 

Is there another link to the file somehere so that I can complete the challenge?
I have some code in my Apex class that basically says:

    public PageReference redirect(){
        
        String somekey = [SELECT Key__c FROM Some_metadata__mdt WHERE Organization_Id__c = :runningOrg.Id].Destination_Key__c;    
        
    String URL='https://myurl.com/' + someKey + '?accId='+Account_Id__c.Id+'&sourceId='Source_Record_Id__c.Source+'&svcType='+Service_Type__c.Service+'&rsrcId='+Event_Id__c;
        PageReference getFeedback=new PageReference(URL);
        getFeedback.setRedirect(true);
        return getFeedback;

I have written the test code as such:

    @istest
    static void TestPageRedirect(){
        String somekey = 'UsFZNSFf';
        String URL='https://myurl.com/' + surveyKey + '?accId=123456789&sourceId=123456789&svcType=My Service Type&rsrcId=My Event ID';
        PageReference getFeedback=new PageReference(URL);
        Test.setCurrentPage(getFeedback);

The test executes without problems but none of the code in the Apex class is shown as covered.

What am I doing wrong?
I am still trying to understand test classes so any help is apprecated.
I have a statement in my Apex class:

    public Organization runningOrg {
      get {
           return [SELECT Id, IsSandbox FROM Organization LIMIT 1];
      }
      set;
  }

How do I test against this?
I am trying not to use (SeeAllData=true), but when I don't use it the test returns no data. When I try to insert data into the record I get an error message that the field cannot be written.

Is there a way around this?
I have an LWC that takes the metadata from an Article and adds it to a JSON object which adds it to the header as a script for Google to use as Structured Data as a FAQPage type.

The problem I am running into is that when I pass the second @Type required by the FAQPage Schema Markup standards it adds the URL.

So when I pass 
myArticle.mainEntity['@type'] = 'Question';

The result is
https://mydomain/mycommunity/s/article/Question
instead of just "Question"

Here is the pertinent code:
… fetch list of articles from APEX class …
    theseArticles({error, data}) {
        if (data) {
            this.articles = [];
            for (let article of data) {
                myArticle = {};
                myArticle.mainEntity = {};
                myArticle.mainEntity.acceptedAnswer = {};
                myArticle.context =   'http://schema.org';
                myArticle['@type'] = '@FAQPage';
                 myArticle.mainEntity['@type'] = 'Question';
                 myArticle.mainEntity.name = JSON.stringify(article.Question__c);
                 myArticle.mainEntity.acceptedAnswer['@type'] = 'Answer';
                 myArticle.mainEntity.acceptedAnswer.text = JSON.stringify(article.Answer__c);
                }
// call event listener in header to add this data to script
                document.dispatchEvent(new CustomEvent('addToHeader, {'detail': {data: JSON.stringify(myArticle)}}));
… do some other stuff…
    }
Any thoughts on how I can remove the URL?
 
I want to grab some of the metadata from the article showing on the article detail page. Any pointers on how I can accomplish this?
 
Use Case
When Knowledge Articles are crawled by Google I want the metadata from that article to be manipulated and passed to Google as JSON for use as schema markup so that we can have the article show in Featured Snippets. For example, I have a how-to Knowledge Article that I want to display via JSON as a how-to Structured Data type. I need to query the article to find out what Article Record Type it is to set that schema. Then grab other metadata like Title, Step 1, etc.

Hello All,

On the account when my users wants to send a email to clients they click on email address which is on the account. As soon as they click on the email address they are getting this component error message. 

User-added image

They literally have to close this box like 20 times then they will be able to send the email to the clients.

I have raised the ticket with the salesforce support as well but they were not been able to reproduce the error from the affected user.

I have like 3 users who are affected with this issue and dont have clue how to resolve this.

Any help will be really appreciated.

 

Thank you 
Shrikant Samarth