• Raghubm
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies

Tryring to execute a query byt getting the error 'no viable alternative at character '\' in soql'  

String NSP = 'vlocity_cmt__';

String matrixRowQuery = 'SELECT Id, Name, ' + NSP + 'InputData__c, ' +
            NSP + 'CalculationMatrixVersionId_r.' + NSP + 'Priority_c, ' +
            NSP + 'CalculationMatrixVersionId_r.' + NSP + 'VersionNumber_c ' +
            'FROM ' + NSP + 'CalculationMatrixRow__c WHERE ' +
            NSP + 'CalculationMatrixVersionId__c = \'' + matrixVersion.Id + '\' AND Name != \'Header\'';

matrixRowQuery = String.escapeSingleQuotes(matrixRowQuery);
I have 2 objects (Account and case), where Case record will be created from an external source which passes account number as a input, Based on the account number I need to capture Account ID and assocciate the record. Can you please suggest how to go forward for this requirement?