function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sfg1sfg1 

Identify from where the the method is calling in my organisation

In the below class i want to know from where the method "updateFeedback" is calling in my organisation.

@RestResource(urlMapping='/UpdateFeedback/*')
global with sharing class SMXRestResource {
@HttpPost
global static String doPost(String strActionCode,Decimal decScore,String strComment,String strStatus,String strSubStatus,String strFeedbackReceivedDate,String strInvitationSentDate,String strFirstReminderDate,String strSecondReminderDate,String strThirdReminderDate, String strPersonId,String strDcname, String strDcid) 
{
     RestRequest req = RestContext.request;
     String strFbkId= req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
     strFbkId = EncodingUtil.urlDecode(strFbkId,'UTF-8');
     return updateFeedback(strFbkId,strActionCode,decScore,strComment,strStatus,strSubStatus,strFeedbackReceivedDate,strInvitationSentDate,strFirstReminderDate,strSecondReminderDate,strThirdReminderDate,strPersonId,strDcname,strDcid);         
 }
 
 public static String updateFeedback(String strFbkId,String strActionCode,Decimal decScore,String strComment,String strStatus,String strSubStatus,String strFeedbackReceivedDate,String strInvitationSentDate,String strFirstReminderDate,String strSecondReminderDate,String strThirdReminderDate,String strPersonId,String strDcname, String strDcid) {
     String strReturnVal = '';
     String strFeedbackReceivedDateParsed ='';
     String strInvitationSentDateParsed ='';
     String strFirstReminderDateParsed='';
     String strSecondReminderDateParsed='';
     String strThirdReminderDateParsed='';
     String strContactRecordStatus = 'Failure';
     String status, severity, subject, webServiceStatus;
     String IsAlert = 'N';
     String SurveyIDRef = '';
     
     List <Feedback__c> lstFeedback= [SELECT Id,DataCollectionId__c from Feedback__c where Name=:strFbkId];
    
    if(lstFeedback.isEmpty()){      
        //strContactRecordStatus=createSurveyRecord( strFbkId, strStatus, strPersonId, strSubStatus,strDcname,  strDcid);
        strContactRecordStatus = 'Failure - This Record is not Imported through SFDC';
    }
VinodKRVinodKR
Hi Dhana,

By default in any REST webservice class there can be only one HTTP Method in that case if i see from above it's only "HttpPost",so any body sends a http "POST" request to this URL"(urlMapping='/UpdateFeedback/*')" flow comes to doPost method and "updateFeedback" is returned back.

Hope this answers your question,if not reframe the question again?

Thanks,

Have a great day ahead,Let the Force be with you!
Please mark this as best answer if it helps you.
sfg1sfg1
Thanks for your reply Vinod.
I tried executing my class through workbech and i have activated debug logs but my code is not executing.I have set multiple debug logs but i am not able to see those logs. please find the code which i ran in workkbench.My condition is
 if(listCase.isEmpty() && (IsAlert == 'Y')){
                Case c=new Case();
                c.OwnerId=OwnerID;
                c.parentid=Feedback.case__c;
                c.Subject='CPSE Negative Survey for '+AccountName;
                c.Survey_Details__c ='Primary Score: '+ decScore + '\n Primary Comment: '+strComment              
                c.AccountId=contact.AccountId;              
                c.Survey__c=Feedback.Id;
                c.SurveyDetailsURL__c = strSFDCServer + '/apex/SMXSurveyDetails?ProvID='+strFbkId;
                insert c;
please correct me if i am wrong.


boolean Isalert = True;
case listcase = new case();



if(listcase == null && Isalert == true)
{  
SMXRestResource.updateFeedback('a0Lj0000000HSQCEA4','UpdateESRStatus',5,'Comment','pending','opened','FeedbackReceivedDate', 'SentDate','Date','secondReminderDate','ThirdReminderDate','PersonId','name',  'cid');
}