• Pankaj Shakya
  • NEWBIE
  • 40 Points
  • Member since 2018
  • Salesforce Developer
  • Metadesign Solutions


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 9
    Replies
Hello,

I'm trying the RestRessource functionality in Apex and I'm facing a "service not found" every time. Here's how I do it :

First, I create a simple Apex class that return "Hello World" on a GET request.
@RestResource(urlMapping='/test/*')
global with sharing class ApexRestTest {

    @HttpGet
    global static String getMethod()
    {
        return 'Hello World';
    }    
}
Then after saving I go to the workbench connect to the right Organization as Administrator and in the "utilities > REST explorer" I perform this request :
  • GET
  • /services/apexrest/test/123
The response is the following (with the 404 code):
[ {
  "errorCode" : "NOT_FOUND",
  "message" : "Could not find a match for URL"
} ]
On the trailhead it just looks as easy as I did so I don't understand what's wrong.

If any of you have a solution !
 
Hi everyone

Below is my code for showToast but it invokes on doinit(). The problem is I have to reload the page to see the Toast as a notification. Is there a way to fire the toastEvent automatically on a specific time. 

doInit : function(component, event, helper) {
        var action = component.get("c.getAlertDateTime");
            action.setCallback(this, function(response){
                var state = response.getState();
                if(state === "SUCCESS"){
                    var result = response.getReturnValue();
                    var date = new Date();
                    var Today = date.toISOString();
                    for(var i=0; i!=result.length; i++){
                        if(result[i].pshak__Alert_Date_Time__c <= Today){
                            var toastEvent = $A.get("e.force:showToast");
                            toastEvent.setParams({
                                title : 'Note Reminder',
                                message: 'Check out your note \''+result[i].Name+'\'',
                                type: 'warning',
                                mode: 'sticky',
                                });
                            toastEvent.fire();
                        }
                    }
                    component.set("v.notesList", result);
                }
            });
            $A.enqueueAction(action);
    }

Thanks.
 
We have a customized field added to opportunity about contract signing date, we want the field is auto filled by the date when the stage of the opportunities changed to "Won- Agreement Signed". as the stage is a picklist field, I cannot use If, but I also failed when I use Case.
This is my formula, it doesn't work. SF said it cannot be used for picklist field.
CASE((StageName  = "Won - AGREEMENT SIGNED & ACCEPTED"),TODAY())
can anyone help me to give a correct script?

thanks very much
Carol
Hi,
How to call Scheduler class from the trigger?

Regards,
SFDC16
Hello,

I'm trying the RestRessource functionality in Apex and I'm facing a "service not found" every time. Here's how I do it :

First, I create a simple Apex class that return "Hello World" on a GET request.
@RestResource(urlMapping='/test/*')
global with sharing class ApexRestTest {

    @HttpGet
    global static String getMethod()
    {
        return 'Hello World';
    }    
}
Then after saving I go to the workbench connect to the right Organization as Administrator and in the "utilities > REST explorer" I perform this request :
  • GET
  • /services/apexrest/test/123
The response is the following (with the 404 code):
[ {
  "errorCode" : "NOT_FOUND",
  "message" : "Could not find a match for URL"
} ]
On the trailhead it just looks as easy as I did so I don't understand what's wrong.

If any of you have a solution !
 
I want to disable the scheduled apex job, Is there any command in lightning to disable the scheduled job and not aborting the job
while working on the Trailhead Tasks, I am getting the below error, please anyone advise me anyone on this.

Controller code :
public class MyContactListController{
   @AuraEnabled
public static List<Contact> getContacts(Id recordId) {
   return [Select Id, FirstName, LastName, Email, Phone From Contact Where AccountId = :recordId];
}
}
===============================================================================
===============================================================================
component code -

<aura:component controller="MyContactListController" implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >
<aura:attribute name="recordId" type="Id" />
<aura:attribute name="Account" type="Account" />
<aura:attribute name="Contacts" type="Contact" />
<aura:attribute name="Columns" type="List" />

<force:recordData aura:id="accountRecord"
                  recordId="{!v.recordId}"
                  targetFields="{!v.Account}"
                  layoutType="FULL"
                  />

<lightning:card iconName="standard:contact" title="{! 'Contact List for ' + v.Account.Name}">
            <!-- Contact list goes here -->
     </lightning:card>
</aura:component>
=================================================================================
===================================================================================

 I am getting the below error.

Challenge Not yet complete... here's what's wrong: 
Could not find a component named MyContactList' on the Account record page.


 
The validation rule should be on the Case object.
The validation rule should be named 'Mark_as_Escalated'.
The validation rule should fire if someone tries to set a case as escalated and it is closed, closed when created, or does not have a priority of High.
The validation rule should display the error message 'You can only set a case as escalated if it is high priority and not closed' under the Escalated field when triggered.
Add the 'Escalated' field to the Case page layout.