You need to sign in to do that
Don't have an account?
Ashish Kumar Yadav
how to get record type based on condition hard coaded record type?
Hello Team ,
I am facing issue not getting the record type in soqlQuery
System.debug('------------>'+SchemeApplicablefor);
System.debug('------------>'+samid);
Set<String> RTNames = new Set<String>();
if(SchemeApplicablefor == 'Distributer'){
RTNames.add('India SND');
RTNames.add('Brand W');
RTNames.add('H&H Modern Trade Distributor');
RTNames.add('H&H Traditional Trade Distributor');
}
if(SchemeApplicablefor == 'Retailer'){
RTNames.add('H&H Modern Trade Retailer');
RTNames.add('H&H Traditional Trade Retailer');
RTNames.add('India SND Retailer');
RTNames.add('Brand W Retailer');
}
if(SchemeApplicablefor == 'Both'){
RTNames.add('India SND');
RTNames.add('Brand W');
RTNames.add('H&H Modern Trade Distributor');
RTNames.add('H&H Traditional Trade Distributor');
RTNames.add('H&H Modern Trade Retailer');
RTNames.add('H&H Traditional Trade Retailer');
RTNames.add('India SND Retailer');
RTNames.add('Brand W Retailer');
}
String soqlQuery = 'SELECT Id, Name, RecordType.Name FROM Account where RecordType.Name in:RTNames';
System.debug('soqlQuery@@'+soqlQuery);
Please help me to solve the issue.
I am facing issue not getting the record type in soqlQuery
System.debug('------------>'+SchemeApplicablefor);
System.debug('------------>'+samid);
Set<String> RTNames = new Set<String>();
if(SchemeApplicablefor == 'Distributer'){
RTNames.add('India SND');
RTNames.add('Brand W');
RTNames.add('H&H Modern Trade Distributor');
RTNames.add('H&H Traditional Trade Distributor');
}
if(SchemeApplicablefor == 'Retailer'){
RTNames.add('H&H Modern Trade Retailer');
RTNames.add('H&H Traditional Trade Retailer');
RTNames.add('India SND Retailer');
RTNames.add('Brand W Retailer');
}
if(SchemeApplicablefor == 'Both'){
RTNames.add('India SND');
RTNames.add('Brand W');
RTNames.add('H&H Modern Trade Distributor');
RTNames.add('H&H Traditional Trade Distributor');
RTNames.add('H&H Modern Trade Retailer');
RTNames.add('H&H Traditional Trade Retailer');
RTNames.add('India SND Retailer');
RTNames.add('Brand W Retailer');
}
String soqlQuery = 'SELECT Id, Name, RecordType.Name FROM Account where RecordType.Name in:RTNames';
System.debug('soqlQuery@@'+soqlQuery);
Please help me to solve the issue.
Dushyant srivastava 8