Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(MasterConfiguration__c conf : [SELECT Section_Label__c,
- ColumnsPerSection__c,
- OrderOfSection__c,
- Object__c,
- SectionName__c,
- TermsOfSubmission__c,
- (SELECT FieldNameAPI__c,
- Object__c,
- FieldLabel__c,
- OrderOfField__c,
- DefaultValue__c,
- HelpText__c
- FROM Master_Configurations__r
- WHERE RecordType.DeveloperName = 'Fields'
- AND Object__c IN ('Case', 'Service_Information__c')
- AND Inactive__c = FALSE
- AND HiddenOnCaseDetail__c = FALSE
- ORDER BY OrderOfField__c)
- FROM MasterConfiguration__c
- WHERE RecordType.DeveloperName = 'Section'
- AND ((CaseRecordType__c INCLUDES ('AAA')
- AND (CaseCategory__c = '' OR CaseCategory__c = NULL)
- AND (CaseSubCategory__c = '' OR CaseSubCategory__c = ''))
- OR (CaseCategory__c = 'Heath'
- AND (CaseSubCategory__c = 'My Health'
- OR CaseSubCategory__c = '')))
- AND Inactive__c = FALSE
- AND Object__c = 'Case'
- AND HiddenOnCaseDetail__c = FALSE
- ORDER BY OrderOfSection__c] )
- Case c = new Case();
- c.Category__c = 'Heath';
- c.SubCategory__c = 'My Health';
- c.RecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('Health').getRecordTypeId();
- c.AgreedToTerms__c = true;
- c.Status = 'New';
- c.SubStatus__c = 'Request Submitted';
- c.Receipt_Date__c = Date.today();
- c.Origin = 'Email';
- c.ProjectName__c = 'Testing';
- insert c;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement