Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. for(MasterConfiguration__c conf : [SELECT Section_Label__c,
  2. ColumnsPerSection__c,
  3. OrderOfSection__c,
  4. Object__c,
  5. SectionName__c,
  6. TermsOfSubmission__c,
  7.  
  8. (SELECT FieldNameAPI__c,
  9. Object__c,
  10. FieldLabel__c,
  11. OrderOfField__c,
  12. DefaultValue__c,
  13. HelpText__c
  14. FROM Master_Configurations__r
  15. WHERE RecordType.DeveloperName = 'Fields'
  16. AND Object__c IN ('Case', 'Service_Information__c')
  17. AND Inactive__c = FALSE
  18. AND HiddenOnCaseDetail__c = FALSE
  19. ORDER BY OrderOfField__c)
  20.  
  21. FROM MasterConfiguration__c
  22. WHERE RecordType.DeveloperName = 'Section'
  23.  
  24. AND ((CaseRecordType__c INCLUDES ('AAA')
  25. AND (CaseCategory__c = '' OR CaseCategory__c = NULL)
  26. AND (CaseSubCategory__c = '' OR CaseSubCategory__c = ''))
  27.  
  28. OR (CaseCategory__c = 'Heath'
  29. AND (CaseSubCategory__c = 'My Health'
  30. OR CaseSubCategory__c = '')))
  31.  
  32. AND Inactive__c = FALSE
  33. AND Object__c = 'Case'
  34. AND HiddenOnCaseDetail__c = FALSE
  35. ORDER BY OrderOfSection__c] )
  36.  
  37. Case c = new Case();
  38. c.Category__c = 'Heath';
  39. c.SubCategory__c = 'My Health';
  40. c.RecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('Health').getRecordTypeId();
  41. c.AgreedToTerms__c = true;
  42. c.Status = 'New';
  43. c.SubStatus__c = 'Request Submitted';
  44. c.Receipt_Date__c = Date.today();
  45. c.Origin = 'Email';
  46. c.ProjectName__c = 'Testing';
  47. insert c;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement