• seamas li
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies
Hi Expert,

I can not get phoneNumber in testing. but it is working in WorkBeach 

  @HttpGet
    global static String doGet() {
    
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;

        String phoneNumber = req.params.get('phoneNumber');
        String subscriptionId = req.params.get('subscriptionId');    
        system.debug('phoneNumber : '+ phoneNumber) ;  


        return response;
    }

    static testMethod void getSubscriptionByPhoneNumberTest() {
        
        test.startTest();        
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/subscriptions?phoneNumber=416360999 1234567891 0488888888';
        req.httpMethod = 'GET';
        
        RestContext.request = req;
        
        String result=NewsSubscriptionController.doGet();

  
        test.stopTest();
    
    }
Hi Expert,

Why I can not get phoneNumber parameter?
Thank you so much.

I am testing Rest Api Apex code:

@RestResource(urlMapping='/mytest/*')
global with sharing class salesforceRestCall{
    
    @HttpGet
    global static String doGet() { 
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
              
        system.debug(' RestContext.request.params :: '+  RestContext.request.params);        
        
        String phoneNumber=req.params.get('subscriptionId');

        String response = processRequest( phoneNumber);

        return response;
    }


Testing Apex class:

    static testMethod void getSubscriptionByPhoneNumberTest() {
    

        test.startTest();
        
        
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/subscriptions?phoneNumber=416360999';
        req.httpMethod = 'GET';

        RestContext.request = req;
        RestContext.response= res;
        
        String susbscriptionDetail = salesforceRestCall.doGet();  
        test.stopTest();
    
    }
Hi Expert,

I am testing Rest Api Apex code:

@RestResource(urlMapping='/mytest/*')
global with sharing class salesforceRestCall{
    
    @HttpGet
    global static String doGet() { 
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
              
        system.debug(' RestContext.request.params :: '+  RestContext.request.params);        
        
        String phoneNumber=req.params.get('subscriptionId');

        String response = processRequest( phoneNumber);

        return response;
    }


Testing Apex class:

    static testMethod void getSubscriptionByPhoneNumberTest() {
    

        test.startTest();
        
        
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/subscriptions?phoneNumber=416360999';
        req.httpMethod = 'GET';

        RestContext.request = req;
        RestContext.response= res;
        
        String susbscriptionDetail = salesforceRestCall.doGet();  
        test.stopTest();
    
    }

Why I can not get phoneNumber parameter?
Thank you so much.
Hi, 
I have requirement, in a flow plugin send a http request and get a Object List response.
I need pass the Object list to flow as OutputParameter, How can I do it?

Thank you so much
Hi Experts
I want to move Send an Email button from related list to top of Cases detail page, and near to Edit button(standard button).

Or Can I create a Custom button has same function and behavior with Send an Email button?

Because the Send an Email button always in the bottom of the screen, it is hard to find.

Thanks you so much.
Hi Experts

I am trying to load Apex/pages from SFDC Sandbox to Force prokect. But I always get the following error message. 

Unable to connect to hostname 'test.salesforce.com' with given login credentials

My user name:seamas.li@news.com.au.primarydev

Please help check, much appriaciate.
Hi Experts
I want to move Send an Email button from related list to top of Cases detail page, and near to Edit button(standard button).

Or Can I create a Custom button has same function and behavior with Send an Email button?

Because the Send an Email button always in the bottom of the screen, it is hard to find.

Thanks you so much.
Hi Expert,

Why I can not get phoneNumber parameter?
Thank you so much.

I am testing Rest Api Apex code:

@RestResource(urlMapping='/mytest/*')
global with sharing class salesforceRestCall{
    
    @HttpGet
    global static String doGet() { 
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
              
        system.debug(' RestContext.request.params :: '+  RestContext.request.params);        
        
        String phoneNumber=req.params.get('subscriptionId');

        String response = processRequest( phoneNumber);

        return response;
    }


Testing Apex class:

    static testMethod void getSubscriptionByPhoneNumberTest() {
    

        test.startTest();
        
        
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/subscriptions?phoneNumber=416360999';
        req.httpMethod = 'GET';

        RestContext.request = req;
        RestContext.response= res;
        
        String susbscriptionDetail = salesforceRestCall.doGet();  
        test.stopTest();
    
    }
Hi Experts
I want to move Send an Email button from related list to top of Cases detail page, and near to Edit button(standard button).

Or Can I create a Custom button has same function and behavior with Send an Email button?

Because the Send an Email button always in the bottom of the screen, it is hard to find.

Thanks you so much.
I don't see a Setup menu to run the Lightning App Builder for a challange.  I'm using the Summer `15 Developer Edition.  How is it enabled?