• Varsha Pawar 4
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hi All,

We have to build Screen based flow which has few screens. One the screen has First Name, Last Name, Gender, DOB, Education and a checkbox. If this checkbox is checked and we click on Next button, then we want to save the information in Contact object and show the same screen again to add another Contact record.This screen will appear till the checkbox is checked. Also, if we click on Prev/Next button then the contact data should be loaded as they were added.

If we cannot implement this functionality, then please suggest how should we do it. Any pointers would really help me. 

Thanks in advance.
Hi Team,

In my Org, I have enabled Partner Account. On Account Trigger is has some logic, now I want to write a Test Class for this Trigger.

Can someone please help me how to make IsPartner = True/False in Test Class? Currently it gives error "FATAL_ERROR System.SObjectException: Field is not writeable: Account.IsPartner".

Thanks in Advance! 
Hi Team,

Can someone please help me writing a Test class for the below trigger?

public class AccountTriggerHandler {
    public static void executeTriggerHandler(){
        //get Account new and old List
        List<Account> accountNewList = Trigger.New;
        List<Account> accountOldList = Trigger.Old;
       
        Map<Id,Account> mapNewAccount = (Map<Id,Account>)trigger.newMap;
        Map<Id,Account> mapOldAccount = (Map<Id,Account>)trigger.oldMap;
       
        List<Information__c> lstInfo = [SELECT Id, AccountID__c FROM Information__c];
        Map<id, id> mapAcct = new Map<id, id>();
        for(Information__c infoItem : lstInfo){
            if(!mapAcct.containsKey(infoItem.AccountID__c))
                mapAcct.put(infoItem.AccountID__c, infoItem.Id);
        }
        List<Information__c> infoList = new List<Information__c>();
        Information__c informationItem = null;
        //New Account is created so insert in Information
        if(accountOldList == NULL){
            for(Account a: accountNewList){
                informationItem = new Information__c();
                informationItem.Name = a.Name;
                informationItem.Street__c = a.BillingStreet;
                informationItem.City__c = a.BillingCity;
                informationItem.State__c = a.BillingState;
                informationItem.Postal_Code__c = a.BillingPostalCode;
                informationItem.Country__c= a.BillingCountry;
                informationItem.AccountID__c = a.Id;
                infoList.add(informationItem);
            }
        }
        if(Trigger.isAfter)
        {
            //Insert Information
            if(trigger.isInsert){
                insert infoList;
            }
            //Insert/Update/Delete Information
            if(trigger.isUpdate){
                List<Information__c> insertInformationList = new List<Information__c>();
                List<Information__c> updateInformationList = new List<Information__c>();
                List<Information__c> deleteInformationList = new List<Information__c>();
                for(Id accountId : mapNewAccount.keyset()){
                    informationItem = new Information__c();
                    informationItem.Name = mapNewAccount.get(accountId).Name;
                    informationItem.Street__c = mapNewAccount.get(accountId).BillingStreet;
                    informationItem.City__c = mapNewAccount.get(accountId).BillingCity;
                    informationItem.State__c = mapNewAccount.get(accountId).BillingState;
                    informationItem.Postal_Code__c = mapNewAccount.get(accountId).BillingPostalCode;
                    informationItem.Country__c= mapNewAccount.get(accountId).BillingCountry;
                    informationItem.AccountID__c = mapNewAccount.get(accountId).Id;
                    if(mapNewAccount.get(accountId).Information__c != mapOldAccount.get(accountId).Information__c){
                        if(mapNewAccount.get(accountId).Information__c)
                        {
                            //Insert Information
                            insertInformationList.add(informationItem);
                        }
                        else
                        {
                            //get info Id
                            informationItem.Id = mapAcct.get(accountId);
                            //Delete Information
                            deleteInformationList.add(informationItem);
                        }
                    }
                    else
                    {
                        //Update Information
                        informationItem.Id = mapAcct.get(accountId);
                        updateInformationList.add(informationItem);
                    }
                }
                //Insert Information
                if(insertInformationList.size() > 0){
                    insert insertInformationList;
                }
                //Update Information
                if(updateInformationList.size() > 0){
                    update updateInformationList;
                }
                //Delete Information
                if(deleteInformationList.size() > 0){
                    delete deleteInformationList;
                }
            }
        }
    }
}
Thanks in advance
Hi All,

We have to build Screen based flow which has few screens. One the screen has First Name, Last Name, Gender, DOB, Education and a checkbox. If this checkbox is checked and we click on Next button, then we want to save the information in Contact object and show the same screen again to add another Contact record.This screen will appear till the checkbox is checked. Also, if we click on Prev/Next button then the contact data should be loaded as they were added.

If we cannot implement this functionality, then please suggest how should we do it. Any pointers would really help me. 

Thanks in advance.
Hi Team,

In my Org, I have enabled Partner Account. On Account Trigger is has some logic, now I want to write a Test Class for this Trigger.

Can someone please help me how to make IsPartner = True/False in Test Class? Currently it gives error "FATAL_ERROR System.SObjectException: Field is not writeable: Account.IsPartner".

Thanks in Advance!