• Sewalther
  • NEWBIE
  • 35 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies
I have a process that invokes an @InvocableMethod Class, which should post to an endpoint. I am not getting any errors, but it isn't making the call. My Class is below. What am I missing? Any help is appreciated. Thank you!


global class SalesCloudOnboardCustomerClass {
  
    @InvocableMethod(label ='Call Sales Cloud' description='Sends the Opportunity Id to Sales Cloud.')
    public static void makeCallout(List<Id> ids) {
      System.debug('DebugMe ids: ' + ids);
      String endpoint='';
      HttpRequest request = new HttpRequest();
      // Set the HTTP verb to POST.
      request.setMethod('POST');

      for(Id id : ids){
        //Set the endpoint URL.
        Remote_Endpoint__mdt onboardCustomer = [select Endpoint__c from Remote_Endpoint__mdt where QualifiedApiName = 'OnboardCustomer' Limit 1];
          endpoint = onboardCustomer.endpoint__c + id;
        }
                
     
        // Set the endpoint URL.
        request.setEndPoint(endpoint);
        // Set timeout to 40 seconds.
        request.setTimeout(40000); 
        // Send the HTTP request and get the response.
        System.debug('DebugMe request: ' + request);
        //HttpResponse response = new HTTP().send(request);
        
      }

  }
I have created a visual workflow to find the opty team members on a related opty (Previous Year Opty) and add them to the current opportunity being created. When I tested the flow, it only created 1 of 3 opty team records I assumed it would. When reviewing my debug logs, I see that it looped through all three, but only one created.  Any help would be appreciated. My Flow is below. Any help is appreciated! Thank you!  

User-added image
User-added image
User-added imageUser-added imageUser-added image
I have created a @RestResource, but the developer I am working with who is making the GET call from an external system is having an issue accessing. What am I missing? Thank you in advance for any help. 

[    
    {        
"errorCode": "FORBIDDEN",        
"message": "You do not have access to the Apex class named:
BlueCloudGetOptyDetail"    
     }
]
Hello Community,

I have a trigger on the Lead that I would like to execute only when the Lead custom_field_1_c is not populated and Lead custom_field_2_c has the value of approved, but I keep having either syntax errors or an error saying that my variable does not exist. Any help would be appreciated. I have included my current trigger & class that aren't throwing errors. Thank you!

My Current Trigger (not giving an error):
trigger SalesCloudOnboardLead on Lead (after insert, after update) {
for(Lead leadRecord : Trigger.New){
SalesCloudOnboardClass.makeCallout(leadRecord.Id,'Lead');
    }
}

My Current Trigger (giving an error):
trigger SalesCloudOnboardLead on Lead (after insert, after update) {
for(Lead leadRecord : Trigger.New){
(Lead.custom_field_1_c=null && Lead.custom_field_2_c==('Approved'));
SalesCloudOnboardClass.makeCallout(leadRecord.Id,'Lead');
    }
}

My Class (not giving an error):
global class SpheraCloudOnboardClass {
    @future(callout=true)
    public static void makeCallout(String recordID,String recordType) {
    String endpoint='';
      
    if(recordType == 'Lead'){
     endpoint = 'https://demo.salessolutions.com/onboard/trial/type/Lead/id/'+recordID;
        }else if(recordType == 'Contact'){
             endpoint = 'https://demo.salessolutions.com/onboard/trial/type/Contact/id/'+recordID;
          }
               
        HttpRequest request = new HttpRequest();
        // Set the endpoint URL.
        request.setEndPoint(endpoint);
        // Set the HTTP verb to POST.
        request.setMethod('POST');
        // Send the HTTP request and get the response.
        HttpResponse response = new HTTP().send(request);
        }
   }
I have created a flow which walks users through screens to have them answer questions which populates fields that are found on the opportunity record. The flow then updates the opportunity fields. However, I am having a difficult time either excluding fields that have already been populated on the opportunity or at least showing the current field values in the Screens. Does anyone have an idea to share how to do this? Thank you!
I have a process that invokes an @InvocableMethod Class, which should post to an endpoint. I am not getting any errors, but it isn't making the call. My Class is below. What am I missing? Any help is appreciated. Thank you!


global class SalesCloudOnboardCustomerClass {
  
    @InvocableMethod(label ='Call Sales Cloud' description='Sends the Opportunity Id to Sales Cloud.')
    public static void makeCallout(List<Id> ids) {
      System.debug('DebugMe ids: ' + ids);
      String endpoint='';
      HttpRequest request = new HttpRequest();
      // Set the HTTP verb to POST.
      request.setMethod('POST');

      for(Id id : ids){
        //Set the endpoint URL.
        Remote_Endpoint__mdt onboardCustomer = [select Endpoint__c from Remote_Endpoint__mdt where QualifiedApiName = 'OnboardCustomer' Limit 1];
          endpoint = onboardCustomer.endpoint__c + id;
        }
                
     
        // Set the endpoint URL.
        request.setEndPoint(endpoint);
        // Set timeout to 40 seconds.
        request.setTimeout(40000); 
        // Send the HTTP request and get the response.
        System.debug('DebugMe request: ' + request);
        //HttpResponse response = new HTTP().send(request);
        
      }

  }
I have created a visual workflow to find the opty team members on a related opty (Previous Year Opty) and add them to the current opportunity being created. When I tested the flow, it only created 1 of 3 opty team records I assumed it would. When reviewing my debug logs, I see that it looped through all three, but only one created.  Any help would be appreciated. My Flow is below. Any help is appreciated! Thank you!  

User-added image
User-added image
User-added imageUser-added imageUser-added image
I have created a @RestResource, but the developer I am working with who is making the GET call from an external system is having an issue accessing. What am I missing? Thank you in advance for any help. 

[    
    {        
"errorCode": "FORBIDDEN",        
"message": "You do not have access to the Apex class named:
BlueCloudGetOptyDetail"    
     }
]