• Vinodraj Shivananda
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Pexlify Enterprise Limited

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies
I have this formula field I am trying to build. Here is the current formula that is throwing the compilation error above:
 
IF( 
   ISPICKVAL(Opportunity.StageName,"Closed Lost"),0,
     IF( 
        AND(Opportunity_Record_Type__c = 'Amendment',
           OR(Line_Level_Detail__c <> 'New Logo',
              Line_Level_Detail__c <> 'Cross Sell',
              Line_Level_Detail__c <> 'Upgrade / Downgrade',
              Line_Level_Detail__c  <> 'Services',
              Line_Level_Detail__c  <> 'Product Churn',
              Line_Level_Detail__c  <> 'Product Deprecated',
              Line_Level_Detail__c  <> 'Customer Credit')), TotalPrice,
            IF(
               AND(Opportunity_Record_Type__c  <>  'Amendment',  Line_Level_Type__c  <> 'Removed Product', 
                 OR(Line_Level_Detail__c <> 'New Logo',
                    Line_Level_Detail__c <> 'Cross Sell',
                    Line_Level_Detail__c <> 'Upgrade / Downgrade',
                    Line_Level_Detail__c  <> 'Services',
                    Line_Level_Detail__c  <> 'Product Churn',
                    Line_Level_Detail__c  <> 'Product Deprecated',
                    Line_Level_Detail__c  <> 'Customer Credit')), TotalPrice,
                IF(
                   AND(Opportunity_Record_Type__c  <>  'Amendment',  Line_Level_Type__c = 'Removed Product',
                     OR(Line_Level_Detail__c = 'Upgrade / Downgrade',
                        Line_Level_Detail__c = 'Migration',
                        Line_Level_Detail__c = 'Bundle Adj')), Combined_Renewed_Subscription_Total_Amt__c ,        

           0)
)
)
)

I know that the compilation error is due to things such as formulas on formulas, etc. But is there anything I can do to re-write it.
Hello, I am new to Integrations/ SOAP API, so apologize if this is an elementary question. I received documentation on how to fill the body of the http request, but I realize that I also need to add authorization into the request. I have the key and secret, but I don't know where to put that in the code. 
1. Where would I put it in the request?
2. What would the key/value pair look like in the JSON? 
Here is what my request looks like so far:

       public Object  makePostCallout() {
    Lead ref =[Select Id, firstname, lastname, gender__c, patient_dob__c, patient_ssn__c from Lead where Id = :ApexPages.currentPage().getParameters().get('id')]; 
           system.debug('***NAME OF REFERRAL***: '+ ref.firstname + ' ' + ref.lastname);
    String ssnReplace; 
           if (ref.Patient_SSN__c != null){
            ssnReplace = ref.Patient_SSN__c.replace('-','');
           }
    String genderLetter;
           if (ref.Gender__c == 'Male'){
               genderLetter = 'M';
           } else if (ref.Gender__c == 'Female'){
               genderLetter = 'F';
           }
           
           String first;
           String second;
           String third;
            String d = String.valueOf(ref.Patient_DOB__c);
           system.debug('***dob string raw: ' + d);
                first = d.substring(0,4);
                second = d.substring(5,7);
                third = d.substring(8,10);
           String dob = first + second + third;
           system.debug('***dob formatted: ' + dob);
           
           Map<string, string> patientInfoMap = new Map<string, string>();
                          patientInfoMap.put('social_security_number', ssnReplace);
                          patientInfoMap.put('birthdate', dob);
                          patientInfoMap.put('gender', genderLetter);
                          patientInfoMap.put('last_name', ref.lastname);
                          patientInfoMap.put('first_name', ref.firstname);
           List<Object> patientInfoList = new List<Object>();
           patientInfoList.add(patientInfoMap);
           
           JSONGenerator gen = JSON.createGenerator(true);   
            gen.writeStartObject();     
             gen.writeStringField('processing_mode', 'Realtime');
             gen.writeStringField('request_type', '270');
             gen.writeStringField('information_source_id', '1');
             gen.writeStringField('submitter_system_id', '2');
             gen.writeStringField('submitter_system_type', 'api');
             gen.writeStringField('submitter_request_id', 'R1');
                 gen.writeStringField('submitter_user_id', '99');
            gen.writeObjectField('subscribers', patientInfoList);
              gen.writeEndObject();   
         String jsonS = gen.getAsString();
        System.debug('***jsonMaterials***'+jsonS);
          
       // Continuation con = new Continuation(40);
        //con.continuationMethod='processResponse';

       HttpRequest req = new HttpRequest();
        req.setEndpoint('https://...(left out)');
        req.setMethod('POST');
        req.setBody(jsonS);
       Http http = new Http();  
       //  this.requestLabel = con.addHttpRequest(req);
     HTTPResponse res = http.send(req);
      // return con; 
           
  String result = null;
    Integer statusCode = res.getStatusCode();
          system.debug('***statusCode is***: ' + statusCode);
   if(statusCode == 200){
             system.debug('***API invoked successfully***');
    result = res.getBody();
          system.debug('***RESULT***: ' + result);
      }   
           return result;   
        
    }
 
Input search text given but output was not displaying

Lightning Component
Component
Controller
ControllerApex Class
Apex ClassOutput Preview
Output