• Angelina Muddamalle
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 8
    Replies
I have a requirement where the accept button should be available on the lead detail page. I came across the javascript custom button code shared in this link https://salesforce.stackexchange.com/questions/167037/accept-button-on-lead-detail-page which works well for admins and other manager profiles but is giving issues with Sales rep profiles.
Any suggestions what the issue might be?
Hi, I need to write a test class for my httppost method which uses json as input. i have tried implementing a test class using the HttpCalloutMock Interface but the apex class gets 0% code coverage in that case. Please suggest how can i go about this.

My apex class:
@RestResource(urlMapping='/abc/xyz/*')
global class MyClass{

    @HttpPost
    global static void updateMethod(){    
        try {        
            //get the json from the request
            RestRequest req1=RestContext.request;           
            String jsonInput= req1.requestBody.toString();       

            //create map for the obtained json input
            Map<String, Object> jsonMap = (Map<String, Object>) JSON.deserializeUntyped(jsonInput); 
            Id opptyId = String.valueOf(jsonMap.get('opportunity_SF_Id')) ;            
            
            //get the opportunity object       
            Sobject oppty = [SELECT id, description FROM opportunity WHERE id=:opptyId];
            //some more processing
            update oppty;        
        }catch(Exception e){
               System.debug('The following exception has occurred: ' + e.getMessage());
       }
    } 
}
Hello, This question is already asked, But I didn't get the exact solution of any trick to solve the issue.


Actually, I have a standard picklist field "Opportunity Currency" in Opportunity Object. I can see that for some standard fields we cannot add the help text, and "Opportunity Currency" is one of them. So I would like to know if we can do some tricks to show the texts in front of the picklist.

Any help will be really appreciated. Thank you 
I have a requirement where the accept button should be available on the lead detail page. I came across the javascript custom button code shared in this link https://salesforce.stackexchange.com/questions/167037/accept-button-on-lead-detail-page which works well for admins and other manager profiles but is giving issues with Sales rep profiles.
Any suggestions what the issue might be?
Hi Everyone,

I am currently working on a Flow for Field Service Lightning that after a series of questions being asked, updates a record. The problem I am having is that I do not know how to pass the RecordId into my Flow from the record I was on in the Field Service Lightning app. Any help would be appreciated.

Thank you,

Jeremy
Hi, I need to write a test class for my httppost method which uses json as input. i have tried implementing a test class using the HttpCalloutMock Interface but the apex class gets 0% code coverage in that case. Please suggest how can i go about this.

My apex class:
@RestResource(urlMapping='/abc/xyz/*')
global class MyClass{

    @HttpPost
    global static void updateMethod(){    
        try {        
            //get the json from the request
            RestRequest req1=RestContext.request;           
            String jsonInput= req1.requestBody.toString();       

            //create map for the obtained json input
            Map<String, Object> jsonMap = (Map<String, Object>) JSON.deserializeUntyped(jsonInput); 
            Id opptyId = String.valueOf(jsonMap.get('opportunity_SF_Id')) ;            
            
            //get the opportunity object       
            Sobject oppty = [SELECT id, description FROM opportunity WHERE id=:opptyId];
            //some more processing
            update oppty;        
        }catch(Exception e){
               System.debug('The following exception has occurred: ' + e.getMessage());
       }
    } 
}
Hi Everyone,
I am trying to create my own custom Accept button.  Must of the JavaScript code is working, but I can not figure out how  to identify what record is selected in the Queue.   Has anyone done this?

Here's the code that I have so far.
 {!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}

try{


    var changeRequestToUpdate = new sforce.SObject("Underwriting__c");

    changeRequestToUpdate.Id = "{!Underwriting__c.Id}";
    changeRequestToUpdate.OwnerId = "{!$User.Id}";
    changeRequestToUpdate.Status__c = "In Progress";

    var result = sforce.connection.update([changeRequestToUpdate]);

    if(result[0].success == "true"){
        location.reload();
    }
    else{
        alert(
            "An Error has Occurred. Error: " + 
            result[0].errors.message
        );
    }
}
catch(e){
    alert(
        "An Error has Occurred. Error: " + 
        e
    );
}

Thanks