• santanu boral
  • NEWBIE
  • 135 Points
  • Member since 2015

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 34
    Replies
Hi ,
Im trying to auto populate a text field with the same value as I selected in the picklist. How can I add this as a workflow action.
If i select a value in the picklist the same value shuld be displayed as a text in the text field.
Im a newbie to salesforce and I really need help on this one.

Thanks!
Hi,
I have written an email service and I need to find a specific phrase in the subject line and place that phrase into my query for relating case.
The subject can come in such as this "ref ABC company DNA1234567 lets go ref" The specific word i need is DNA1234567... this DNA word can be max 10 characters or less. How do I parse out just DNA1234567 in apex code?

String EmailSubject = email.subject;

Please help
thanks
Z
Hello Everyone,

could you provide me soluction for displaying relationship data, in the below code debug statement always displaying NULL( in line number 17)
@istest  
public class testdatafactory {
    public static List<account > accountRecords(Integer num) {
        List < account > AccList = new List < account > ();
        for (Integer i = 0; i < num; i++)
        {
            account Acc = new account ();
            Acc.name = 'Account Testdata '+ i;
            Acc.BillingCity = 'chennai';
            Acc.BillingCountry = 'India';
            Acc.BillingPostalCode = '6000003';
            Acc.BillingState = 'tamilnadu';
            Acc.BillingStreet = 'West street';
            AccList.add(Acc);
        }
        insert AccList;
        return AccList;
    }
    public static List<contact > contactRecords(Integer num,list<account> acc) {
        List < contact > AccList = new List < contact > ();
        for (Integer i = 0; i < num; i++)
        {
            contact c = new contact ();
             c.LastName= ' Last Name'+i;
            c.accountID=acc[i].id;
            AccList.add(c);
            
        }
        insert AccList;
        return AccList;
    }
}

@istest
public class TestClass {
  static testmethod void Unittest()
    {
         list<account> acc= testdatafactory.accountRecords(10);
        //list<account> acclist=[select name,BillingCity from account];
         list<contact> con= testdatafactory.contactRecords(10,acc);
        
         
        for(contact c:con)
         {
             system.debug('===>'+c.account.name);
         }
 }

Thanks
Vijay
I have Two custom  Object Account And Opportunity 
Account :Parent
Opportunity:Chlid
on the parent object, I have a checkbox:Request,
On the child object, I have a Picklist: Model,Completed,runnig
In opportunity  Selected the Piclist Value Model And Running When Parent Account Checkbox is True otherwise Select Picklist Value Runnng When Parent Account Checkbox is False
how  to write a Apex Trigger Code

thanks in advance 
At the time of submitting the challenge at Step 3, I am facing this issue.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: UADXOASV

Please help me to understand the issue is.

Thanks.
I have a business requirement as follows:
When a knowledge article gets approved, the article title, subject and article link to be posted on chatter and will be available to specific group(s).
I already have an approval process which is updating an article as 'Published' status after final approval action. I want to leverage this same approval process with this additional action.
I know that we cannot define trigger on Knowledge article types.
Any feedback and help is appreciated to implement this functionality. Thanks.
I am frustrated and need help with challenge 5 of this superbadge. 
I keep getting this error: The 'Lightning Hobbies by Contact' report does not appear to have either the correct report type or (most likely) the correct columns.
I´ve tried creating the report many times. The report type is the same, as I´ve also tried creating the report by cloning the other two. 

Here is my work:
- Creating a Full Name field on the Contact object; also tried naming it "Contact Full Name"
User-added image
- The report type and name
User-added image
- End version
User-added image
User-added image
Tried it with and without Hobby Type column, in the unfiled folder and in the private folder. The bucket field is locked.
What am I doing wrong?
why we need to maintain 75% code coverage ?
At the time of submitting the challenge at Step 3, I am facing this issue.

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: UADXOASV

Please help me to understand the issue is.

Thanks.
I have a business requirement as follows:
When a knowledge article gets approved, the article title, subject and article link to be posted on chatter and will be available to specific group(s).
I already have an approval process which is updating an article as 'Published' status after final approval action. I want to leverage this same approval process with this additional action.
I know that we cannot define trigger on Knowledge article types.
Any feedback and help is appreciated to implement this functionality. Thanks.
Hi All,

Regarding before insert or update trigger:
Technically, if we insert/update a value in a table we have to commit so that the values are added to DB. and then only we compare, fetch, update the values.
In Before insert or update, even before the values are commited to DB how salesforce validate/fetch the values and 'before' scenario is executed.

Please clarify. If possible can i have a flowchart how trigger is working behind the scenes.
I have created a custom task trigger to update Custom number field on Task Object which counts number of time a task has been created for a lead record with the task record type. This is working fine. Now i want to add standard status field to Update a custom text field on the lead record with the last updated status with the same record type. I am stumped i cannot figure how to do it ! Need some help
The Task trigger is below:

 
trigger TaskUpdateLead on Task (after delete, after insert, after undelete, after update) {

Set<ID> LeadIds = new Set<ID>();

//We only care about tasks linked to Leads.

String leadPrefix = Lead.SObjectType.getDescribe().getKeyPrefix();


//Add any Lead ids coming from the new data

if(trigger.new!=null){
    for (Task t : Trigger.new) {
     if (t.WhoId!= null && string.valueof(t.WhoId).startsWith(leadPrefix) ) {

if(!LeadIds.contains(t.WhoId)){
//adding unique lead ids since there can be many tasks with single lead
LeadIds.add(t.WhoId);
}
}
      }
} 


//Also add any Lead ids coming from the old data (deletes, moving an activity from one Lead to another)

if(trigger.old!=null){
    for (Task t2 : Trigger.old) {
     if (t2.WhoId!= null && string.valueof(t2.WhoId).startsWith(leadPrefix) )
         {
if(!LeadIds.contains(t2.WhoId)){
//adding unique lead ids since there can be many tasks with single lead
LeadIds.add(t2.WhoId);
}
}
      }
}

     if (LeadIds.size() > 0){



List<Lead> leadsWithTasks = [select id,Dialler_Status__c,Dialler_Count__c,(select id from Tasks where recordtype.name LIKE '%Dialler%') from Lead where Id IN : Leadids];

List<Lead> leadsUpdatable = new List<Lead>();

for(Lead L : leadsWithTasks){

L.Dialler_Count__c = L.Tasks.size();
leadsUpdatable.add(L);

}

if(leadsUpdatable.size()>0){

update leadsUpdatable;
//update all the leads with dialler count

}

    }
}

 
Hi ,
Im trying to auto populate a text field with the same value as I selected in the picklist. How can I add this as a workflow action.
If i select a value in the picklist the same value shuld be displayed as a text in the text field.
Im a newbie to salesforce and I really need help on this one.

Thanks!
Hello everybody,

I am creating a app which needs to track how a person is progressing towards their goal over time, for this we use a rating out of 5. We will need to be able to give a rating out of 5 for each goal once a week, starting from the date the goal is created through until the due date. This means each goal may have a different number of ratings in total and I need to track customers using standard Accounts and contacts. Each contact may have multiple goals  and each goal has a name, description, category(career, financial, personal, social, health, etc. ) and target date to achieve the goal by and I need to show progress for a various goals for a contact. 

Any idea on how to give weekly rating on a custom field and disable it once the rating is given for the week and also how to incorporate that into chart.
Hi Everyone,

I have the following trigger in play:

                                                          --------------------------------------------------------------------------------------

trigger PrimaryContact on Contact (before insert, before update) {
  
   set<id> getid = new set<id>();
    string contactId;
    List<Contact> conList = new List<Contact>();
  
    if(Trigger.isInsert || Trigger.isUpdate) {
      
        for(Contact cont: Trigger.New) {
          
            if(cont.Primary_Contact__c == true) {
              
                getid.add(cont.AccountId);
                contactId = cont.id;
            }
        }
    }
  
    List<contact> cList = [select id, Primary_Contact__c from contact where accountid IN: getid                                                   AND Primary_Contact__c = true];
  
    if(cList.size() > 0) {
      
        for(Contact newClst: cList) {
          
            if(newClst.id != contactId) {
              
                newClst.Primary_Contact__c = false;
                conList .add(newClst);
            }
        }
    } 
    update conList; 
  }

                                                 ---------------------------------------------------------------------------------------------

What this Trigger currently does is only allow one contact to be selected as the primary contact. I am quite new to coding so I am a little stuck with what I want to achieve.

What I want to modify this code to do is ensure that you cannot select a contact as a primary contact, if that contact is not active. So only active contacts can be selected as primary. Also, if a primary active contact becomes inactive there should be some immediate actions to allow you to select another contact as Primary.

The active checkbox is driven using a formula on an "expiration date" field within the contact object, so if the expiration date field is populated, the active checkbox is automatically unchecked. If the expiration field is empty, the active checkbox is checked by default

Also, I would like to have an error message display if a user tries to add more than one Primary Contact. 

If anyone could help that would be greatly appreciated

Regards,
Raz
Hi,

I have around 8 years of experience in Siebel Development. I am interested to move to SFDC and have started SFDC training. I need to know what all certifications are required to pursue career as a SFDC Business Analyst or Designer. All suggestions/advices are welcome.

Thanks,
Ashwini
we have a custom  checkbox on contact  is_primary__c , if we enter a number in field "  phone " on contact , corresponding Account should also have the same number populated on account . 



solution :

//Phone number from primary Contact (if Is_Primary__c checkbox is true )  will get updated to parent Account
//verified and working fine
trigger IsprimaryCOntact on Contact (after insert , after update ) 
{
  // contacts will be having id,accountid , so adding to their respective id 
Set<Id> accountIdSet= new Set<Id>();
Set<Id> contactIdSet=new Set<Id>();
List<Account> updateAccList=new List<Account>();
        
            for(Contact contact:Trigger.new)
            {
                accountIdSet.add(contact.accountId);
                contactIdSet.add(contact.Id);
            }
            // Get accounts with their contacts.
 Map<Id,Account> accountMap=new Map<Id,Account>([select id, Phone,(select id, Name from Contacts where Is_Primary__c=true and 
                                                               id not in :contactIdSet) from Account where Id in: accountIdSet]); 
 
 
                                                                          
   
   // checking the data     
           
            for(Contact contact:Trigger.new)
            {
            
                if(contact.Is_Primary__c && accountMap.containsKey(contact.accountId))
                {
                    //This will identify if account already has primary contact set
                    Account updAccount = accountMap.get(contact.accountId);
                    system.debug('--updAccount--'+updAccount);
                    updAccount.Phone=contact.Phone;
                    
                        if(updAccount.Contacts!= null && updAccount.Contacts.size() >0)
                        {
                            contact.addError('Error in saving data!!! Account already has primary contact');                                                
                        }
                    updateAccList.add(updAccount);
                }
            }
            
        update updateAccList;
}  
 
Hello All,
I'm attempting to write a class that will allow me to take AggregateResults from two unrelated objects and list them on a visualforce page for display and charting. I understand that I will need to use a wrapper class to accomplish this, but for the life of me, I can’t get it to work the way I expect. Although I am getting the information to pass to my visualforce page, when displayed, it shows the entire list in one column as opposed to being iterated. I have been reading the docs for a while now and can’t seem to find out what I’m doing wrong. Any guidance would be greatly appreciated

Apex:
public class ErrorTableClass3 {
    
	public ErrorTableClass3(){
        getWrapperC();
    }
    
    public list<WrapperClass> ErrorTable {get; set;}
    
    public class WrapperClass{
    	public list<integer> Mem {get; set;}
        public list<integer> Err {get; set;}
        public list<string> Errmon {get; set;}
        public list<string> MemMonth {get; set;}
            
        public WrapperClass (list<string> ErrorMonth, list<string> Memmonth, list<integer> Memberships, list<integer> Errors){
            Mem = Memberships;
            Err = Errors;
            ErrMon = ErrorMonth;
            MemMonth = MemMonth;
        }     
    }
  
    Public list<WrapperClass> getWrapperC(){

        list<AggregateResult> MembershipAggList = new list<AggregateResult>([SELECT SUM(New_Memberships__c) Memberships, Calendar_month(event_date__c) EventMonth FROM Campaign WHERE Facilitated_By_MD__C = '005i0000000z0nW'GROUP BY Calendar_month(event_date__c )]);  
        list<AggregateResult> ErrorAggList = new list<AggregateResult>([SELECT count(ID) Errors, Calendar_month (App_sign_Date__c) Datemonth FROM Missing_Info_Errors__C WHERE Officer__c = 'John Smith' AND App_Sign_Date__c = THIS_YEAR GROUP BY Calendar_month(App_Sign_Date__c)]);
        
       	list<integer> MembershipIntList = new list<integer>();
        list<string> MemMonth           = new list<string>();
        list<string> ErrorMonth         = new list<string>();
        list<integer> ErrorIntList      = new list<integer>();
		list<WrapperClass> ErrorTable = new list<WrapperClass>();
        
        for(AggregateResult m : MembershipAggList){
        	MembershipIntList.add(integer.valueOf(m.get('Memberships')));
            MemMonth.add(string.valueOf(m.get('EventMonth')));
       	}
        
        for(AggregateResult e : ErrorAggList){
        	ErrorIntList.add(integer.valueOf(e.get('Errors')));
            ErrorMonth.add(string.valueOf(e.get('DateMonth')));
        }
        

        ErrorTable.add(new WrapperClass(ErrorMonth, MemMonth, MembershipIntList, ErrorIntList));
            return ErrorTable;
        
    }
   
}
Markup:
<apex:page controller="ErrorTableClass3">
    <apex:pageBlock >
			<apex:pageBlockTable value="{!WrapperC}" var="e">
                <apex:column headerValue="Errors" footerValue="Total" value="{!e.Err}" />
                <apex:column headerValue="Memberships" footerValue="Total" value="{!e.Mem}" />
                <apex:column headerValue="Month" footerValue="Total" value="{!e.ErrMon}" />
            </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

Result Screenshot
User-added image

 
Hi,
I have written an email service and I need to find a specific phrase in the subject line and place that phrase into my query for relating case.
The subject can come in such as this "ref ABC company DNA1234567 lets go ref" The specific word i need is DNA1234567... this DNA word can be max 10 characters or less. How do I parse out just DNA1234567 in apex code?

String EmailSubject = email.subject;

Please help
thanks
Z
I've created this field formula, but it exceeds the character limit. can anyone help me reduce the characters?

IF( AND( Industry ="Agriculture", Emp_Range__c ="1-4"),"1.0"),IF( AND( Industry ="Agriculture", Emp_Range__c ="5-9"),"1.0"),IF( AND( Industry ="Agriculture", Emp_Range__c ="10-24"),"1.2"),IF( AND( Industry ="Agriculture", Emp_Range__c ="25-49"),"1.5"),IF( AND( Industry ="Agriculture", Emp_Range__c ="50-99"),"2.1"),IF( AND( Industry ="Agriculture", Emp_Range__c ="100-249"),"2.6"),IF( AND( Industry ="Agriculture", Emp_Range__c ="250+"),"3.0"), IF( AND( Industry ="Banking", Emp_Range__c ="1-4"),"1.1"),IF( AND( Industry ="Banking", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Banking", Emp_Range__c ="10-24"),"1.5"),IF( AND( Industry ="Banking", Emp_Range__c ="25-49"),"1.9"),IF( AND( Industry ="Banking", Emp_Range__c ="50-99"),"2.9"),IF( AND( Industry ="Banking", Emp_Range__c ="100-249"),"3.4"),IF( AND( Industry ="Banking", Emp_Range__c ="250+"),"6.2"),IF( AND( Industry ="Construction", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Construction", Emp_Range__c ="5-9"),"1.2"),IF( AND( Industry ="Construction", Emp_Range__c ="10-24"),"1.3"),IF( AND( Industry ="Construction", Emp_Range__c ="25-49"),"1.4"),IF( AND( Industry ="Construction", Emp_Range__c ="50-99"),"2.1"),IF( AND( Industry ="Construction", Emp_Range__c ="100-249"),"2.2"),IF( AND( Industry ="Construction", Emp_Range__c ="250+"),"4.1"),IF( AND( Industry ="Consulting", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Consulting", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Consulting", Emp_Range__c ="10-24"),"1.4"),IF( AND( Industry ="Consulting", Emp_Range__c ="25-49"),"1.9"),IF( AND( Industry ="Consulting", Emp_Range__c ="50-99"),"2.0"),IF( AND( Industry ="Consulting", Emp_Range__c ="100-249"),"3.0"),IF( AND( Industry ="Consulting", Emp_Range__c ="250+"),"5.0"),IF( AND( Industry ="Education", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Education", Emp_Range__c ="5-9"),"1.5"),IF( AND( Industry ="Education", Emp_Range__c ="10-24"),"1.7"),IF( AND( Industry ="Education", Emp_Range__c ="25-49"),"1.9"),IF( AND( Industry ="Education", Emp_Range__c ="50-99"),"3.2"),IF( AND( Industry ="Education", Emp_Range__c ="100-249"),"4.3"),IF( AND( Industry ="Education", Emp_Range__c ="250+"),"5.0"),IF( AND( Industry ="Energy", Emp_Range__c ="1-4"),"1.1"),IF( AND( Industry ="Energy", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Energy", Emp_Range__c ="10-24"),"1.5"),IF( AND( Industry ="Energy", Emp_Range__c ="25-49"),"2.3"),IF( AND( Industry ="Energy", Emp_Range__c ="50-99"),"3.0"),IF( AND( Industry ="Energy", Emp_Range__c ="100-249"),"3.7"),IF( AND( Industry ="Energy", Emp_Range__c ="250+"),"6.7"),IF( AND( Industry ="Engineering", Emp_Range__c ="1-4"),"1.3"),IF( AND( Industry ="Engineering", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Engineering", Emp_Range__c ="10-24"),"1.5"),IF( AND( Industry ="Engineering", Emp_Range__c ="25-49"),"1.6"),IF( AND( Industry ="Engineering", Emp_Range__c ="50-99"),"2.2"),IF( AND( Industry ="Engineering", Emp_Range__c ="100-249"),"3.3"),IF( AND( Industry ="Engineering", Emp_Range__c ="250+"),"6.0"),IF( AND( Industry ="Entertainment", Emp_Range__c ="1-4"),"1.0"),IF( AND( Industry ="Entertainment", Emp_Range__c ="5-9"),"1.0"),IF( AND( Industry ="Entertainment", Emp_Range__c ="10-24"),"1.2"),IF( AND( Industry ="Entertainment", Emp_Range__c ="25-49"),"1.4"),IF( AND( Industry ="Entertainment", Emp_Range__c ="50-99"),"1.9"),IF( AND( Industry ="Entertainment", Emp_Range__c ="100-249"),"2.0"),IF( AND( Industry ="Entertainment", Emp_Range__c ="250+"),"3.8"),IF( AND( Industry ="Finance", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Finance", Emp_Range__c ="5-9"),"1.2"),IF( AND( Industry ="Finance", Emp_Range__c ="10-24"),"1.5"),IF( AND( Industry ="Finance", Emp_Range__c ="25-49"),"2.3"),IF( AND( Industry ="Finance", Emp_Range__c ="50-99"),"3.5"),IF( AND( Industry ="Finance", Emp_Range__c ="100-249"),"3.7"), IF( AND( Industry ="Finance", Emp_Range__c ="250+"),"4.0"), IF( AND( Industry ="Government", Emp_Range__c ="1-4"),"1.6"),IF( AND( Industry ="Government", Emp_Range__c ="5-9"),"2.0"),IF( AND( Industry ="Government", Emp_Range__c ="10-24"),"2.2"),IF( AND( Industry ="Government", Emp_Range__c ="25-49"),"2.9"),IF( AND( Industry ="Government", Emp_Range__c ="50-99"),"3.1"),IF( AND( Industry ="Government", Emp_Range__c ="100-249"),"3.3"), IF( AND( Industry ="Government", Emp_Range__c ="250+"),"4.0"), IF( AND( Industry ="Healthcare", Emp_Range__c ="1-4"),"1.3"),IF( AND( Industry ="Healthcare", Emp_Range__c ="5-9"),"1.5"),IF( AND( Industry ="Healthcare", Emp_Range__c ="10-24"),"1.6"),IF( AND( Industry ="Healthcare", Emp_Range__c ="25-49"),"2.3"),IF( AND( Industry ="Healthcare", Emp_Range__c ="50-99"),"2.7"),IF( AND( Industry ="Healthcare", Emp_Range__c ="100-249"),"2.8"), IF( AND( Industry ="Healthcare", Emp_Range__c ="250+"),"8.5"), IF( AND( Industry ="Hospitality", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Hospitality", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Hospitality", Emp_Range__c ="10-24"),"1.7"),IF( AND( Industry ="Hospitality", Emp_Range__c ="25-49"),"2.3"),IF( AND( Industry ="Hospitality", Emp_Range__c ="50-99"),"3.9"),IF( AND( Industry ="Hospitality", Emp_Range__c ="100-249"),"4.2"), IF( AND( Industry ="Hospitality", Emp_Range__c ="250+"),"4.5"), IF( AND( Industry ="Insurance", Emp_Range__c ="1-4"),"1.0"),IF( AND( Industry ="Insurance", Emp_Range__c ="5-9"),"1.4"),IF( AND( Industry ="Insurance", Emp_Range__c ="10-24"),"1.6"),IF( AND( Industry ="Insurance", Emp_Range__c ="25-49"),"2.6"),IF( AND( Industry ="Insurance", Emp_Range__c ="50-99"),"3.0"),IF( AND( Industry ="Insurance", Emp_Range__c ="100-249"),"4.0"), IF( AND( Industry ="Insurance", Emp_Range__c ="250+"),"14.0"), IF( AND( Industry ="Manufacturing", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Manufacturing", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Manufacturing", Emp_Range__c ="10-24"),"1.4"),IF( AND( Industry ="Manufacturing", Emp_Range__c ="25-49"),"1.7"),IF( AND( Industry ="Manufacturing", Emp_Range__c ="50-99"),"2.2"),IF( AND( Industry ="Manufacturing", Emp_Range__c ="100-249"),"2.6"), IF( AND( Industry ="Manufacturing", Emp_Range__c ="250+"),"3.0"), IF( AND( Industry ="Not for Profit", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Not for Profit", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Not for Profit", Emp_Range__c ="10-24"),"1.4"),IF( AND( Industry ="Not for Profit", Emp_Range__c ="25-49"),"2.3"),IF( AND( Industry ="Not for Profit", Emp_Range__c ="50-99"),"3.4"),IF( AND( Industry ="Not for Profit", Emp_Range__c ="100-249"),"4.5"), IF( AND( Industry ="Not for Profit", Emp_Range__c ="250+"),"5.0"), IF( AND( Industry ="Other", Emp_Range__c ="1-4"),"1,2"),IF( AND( Industry ="Other", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Other", Emp_Range__c ="10-24"),"1.4"),IF( AND( Industry ="Other", Emp_Range__c ="25-49"),"1.8"),IF( AND( Industry ="Other", Emp_Range__c ="50-99"),"2.2"),IF( AND( Industry ="Other", Emp_Range__c ="100-249"),"2.7"), IF( AND( Industry ="Other", Emp_Range__c ="250+"),"4.7"), IF( AND( Industry ="Retail", Emp_Range__c ="1-4"),"1.2"),IF( AND( Industry ="Retail", Emp_Range__c ="5-9"),"1.3"),IF( AND( Industry ="Retail", Emp_Range__c ="10-24"),"1.3"),IF( AND( Industry ="Retail", Emp_Range__c ="25-49"),"1.6"),IF( AND( Industry ="Retail", Emp_Range__c ="50-99"),"1.6"),IF( AND( Industry ="Retail", Emp_Range__c ="100-249"),"2.3"), IF( AND( Industry ="Not for Profit", Emp_Range__c ="250+"),"5.6"), IF( AND( Industry ="Transportation", Emp_Range__c ="1-4"),"1.1"),IF( AND( Industry ="Transportation", Emp_Range__c ="5-9"),"1.2"),IF( AND( Industry ="Transportation", Emp_Range__c ="10-24"),"1.2"),IF( AND( Industry ="Transportation", Emp_Range__c ="25-49"),"1.5"),IF( AND( Industry ="Transportation", Emp_Range__c ="50-99"),"2.1"),IF( AND( Industry ="Transportation", Emp_Range__c ="100-249"),"2.3"), IF( AND( Industry ="Transportation", Emp_Range__c ="250+"),"2.8"),””))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
 
 
Hello Everyone,

could you provide me soluction for displaying relationship data, in the below code debug statement always displaying NULL( in line number 17)
@istest  
public class testdatafactory {
    public static List<account > accountRecords(Integer num) {
        List < account > AccList = new List < account > ();
        for (Integer i = 0; i < num; i++)
        {
            account Acc = new account ();
            Acc.name = 'Account Testdata '+ i;
            Acc.BillingCity = 'chennai';
            Acc.BillingCountry = 'India';
            Acc.BillingPostalCode = '6000003';
            Acc.BillingState = 'tamilnadu';
            Acc.BillingStreet = 'West street';
            AccList.add(Acc);
        }
        insert AccList;
        return AccList;
    }
    public static List<contact > contactRecords(Integer num,list<account> acc) {
        List < contact > AccList = new List < contact > ();
        for (Integer i = 0; i < num; i++)
        {
            contact c = new contact ();
             c.LastName= ' Last Name'+i;
            c.accountID=acc[i].id;
            AccList.add(c);
            
        }
        insert AccList;
        return AccList;
    }
}

@istest
public class TestClass {
  static testmethod void Unittest()
    {
         list<account> acc= testdatafactory.accountRecords(10);
        //list<account> acclist=[select name,BillingCity from account];
         list<contact> con= testdatafactory.contactRecords(10,acc);
        
         
        for(contact c:con)
         {
             system.debug('===>'+c.account.name);
         }
 }

Thanks
Vijay
I have use batch class to perform DML operation but I got a an email saying I have " System.LimitException :Too many DML rows: 10001". I try to solve this issue but could not figure out. Would be glad if anyone could help me out with this issue.