• hanumanth rao Naidu
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi Folks,

i have a requirement for checking duplicate email for particular domains and fraud domains
Please find a way to mark any leads coming from the following email addresses as Duplicate. This will be for leads coming via API only
  • From @xyzasdf.com
  • Containing xyzasdfautomation
  • Containing neelamy2k
could you please suggest how should i achieve this scenario,if code is there please send the code ,it would be great to help for me
 
HI Developers,

I have an urgent Requirement , Please see the below requirement and let me know various possibiliteis to achieve my Task,

Create a report to display all users,( how many licenses of each type we have available and how many we have purchased, but we can't run a user report to find out which users are in which license type.)

I have to show report like this and i also scheduled every month 1st week to generate report and send email to administrator

User-added image
Thanks in Advance
  Hanu
 
I want to display all users in my org and how to recognize which users having which access.....EX: 1000 users are there in my org i want to display read access users and change read access to write access at a time.... if it is any query related pls send the query ...its very urgnt.........please suggest me this scenario  


Thanks in Advance
Hai i am getting this error while i test the test class...please anyone help me on this ........
 below is my test class
@isTest
Private class TestCloseParentCase{
static testMethod void TestCloseParentCase() {


Profile p = [select id from Profile where name = 'Custom - RSE'];

User TestUser = new User(Alias = 'newUser', Email='newuser@testorg.com',
                 EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US',
                 LocaleSidKey='en_US', ProfileId = p.Id,
                 TimeZoneSidKey='America/Los_Angeles', UserName='newuser@test.philips.com', I3_Username__c = 'TestUser');
insert TestUser;

System.runAs(TestUser){

            OneEmsRecordTypes__c cs = new OneEmsRecordTypes__c(name='Case',Active__c = true, Description__c = 'Test Data'  );   
            insert cs;

            OneEmsRecordTypes__c cs1 = new OneEmsRecordTypes__c(name='Closed Case',Active__c = true, Description__c = 'Test Data'  );   
            insert cs1;            

            OneEmsRecordTypes__c cs2 = new OneEmsRecordTypes__c(name='Case - New',Active__c = true, Description__c = 'Test Data'  );   
            insert cs2;            
            
            OneEmsRecordTypes__c cs3 = new OneEmsRecordTypes__c(name='Case - SubCase',Active__c = true, Description__c = 'Test Data'  );   
            insert cs3;            
             
            Account  Acc = new Account( Name='Test Account',  Credit_status__c='Good',Account_Group__c = '0001' );
            insert Acc;
           
            Contact  Con = new Contact( FirstName = 'Test',  LastName ='Contact',  AccountID = Acc.id, Phone ='1234567890');
            insert Con;
           
            Functional_Location__c FnLocation = new Functional_Location__c(Name='TestFunctionalLocation');
            insert FnLocation;
           
            Asset  Assets = new Asset( Name = 'Test Asset',Plant__c = 'US', AccountId = Acc.Id, Main_Workcenter__c = 'Test', Functional_Location__c = FnLocation.id);
            insert Assets;
           
            Product2 prd=new Product2(name='Test Product');              
            insert prd;
           
            ServiceContract Scon = new ServiceContract(Name='Test Service contract',AccountId=Acc.Id,ContactId=Con.Id);
            insert Scon;
           
            Line_Item__c LineItem = new Line_Item__c(Name ='Test line Item',
                                    Ship_To__c = Acc.Id,
                                    Bill_To__c  = Acc.Id,
                                    Payor__c = Acc.Id,
                                    Sold_To__c = Acc.Id,
                                    Start_Date__c = system.Today(),
                                    End_Date__c = system.Today().addDays(30),
                                    Service_Contract__c = Scon.ID);
                                   
            insert LineItem;
           
            Entitlement Ent = new Entitlement(
                                    Name = 'Test Entitlement',
                                    AssetId = Assets.Id,
                                    AccountId = Acc.id,
                                    Line_Item__c = LineItem.Id,
                                    Case_Priorities_Covered__c = 'Priority 1-2'
                                    );
                                   
            insert Ent; 
          
            Id RecordTypId = [select id from RecordType where Name =:'Case' limit 1].Id; 
           
            Id SubcaseRecordTypId = [select id from RecordType where Name =:'Case - SubCase' limit 1].Id;
           
            Id subCaseActionPlanRes = [select id from RecordType where Name =: 'Subcase Response' limit 1].Id;
           
            Id subCaseActionPlan = [select id from RecordType where Name =: 'Subcase Action Plan' limit 1].Id;           
           
            OneEMSTriggerHelper.CaseFieldUpdatesExecuted();
            OneEMSTriggerHelper.CaseAfterUpsertTriggerExecuted();
                           
            Case ParentCase= new Case(
                                     Entitlement_Category__c ='Contract',
                                     AccountID=Acc.id,
                                     AssetID = Assets.id,
                                     RecordTypeId = RecordTypId,
                                     ContactID= Con.Id,
                                     Priority = '1-Critical Need',
                                     Description = 'Test Data' ,
                                     //Status='New',
                                     Type='Email',
                                     Origin='Email',
                                     Credit_Status_Override__c=false,
                                     ProductId=prd.Id,
                                     Service_Contract__c =Scon.Id,
                                     Customer_Unable_to_Provide__c = True,
                                     Reason='Application Support',
                                     EntitlementId = Ent.Id
                                     );
            insert ParentCase;           
            System.Debug('#Parent Case : '+ParentCase);
           
            Case subcase=new Case(
                                    ParentId =ParentCase.Id,
                                    AccountID=Acc.id,
                                  
                                    RecordTypeId = SubcaseRecordTypId,
                                    Problem_Description__c='test',
                                    Previous_Actions__c='test',
                                    Replaced_Parts__c='test',
                                    Status='New',
                                    Problem_Occurrence__c=system.now(),
                                    Priority = '1-Critical Need',
                                    Customer_Unable_to_Provide__c = True);
            insert subcase;
            System.Debug('#Sub Case : '+subcase);
            Action_Plan__c actionPlan = new Action_Plan__c(
                                                        Name = 'Test Action Plan',
                                                        Status__c = 'New',
                                                        Action_Plan_Executor_Role__c ='L1 Owner',
                                                        Sub_Case__c = subcase.Id,
                                                        Information_Only__c = false,
                                                        RecordTypeId = subCaseActionPlan,
                                                        Next_PAO__c = TestUser.Id,
                                                        Next_Action_Due_Date__c = System.Today()
                                                        );
            insert actionPlan; 
            actionPlan.Status__c = 'Submitted';
            update actionPlan;                                     
           
            /***calling starttest() to start test to avoid hitting SOQL Row limit ***/
            Test.starttest();
            Action_Plan__c actionPlanResp = new Action_Plan__c(
                                                        Name = 'Test Action Plan',
                                                        Status__c = 'New',
                                                        Action_Plan__c = actionPlan.Id,
                                                        RecordTypeId = subCaseActionPlanRes ,                     
                                                        Action_Plan_Executor_Role__c ='L1 Owner',
                                                        Sub_Case__c = subcase.Id
                                                        //Information_Only__c = false,
                                                        //Next_Action_Due_Date__c = null
                                                        );
            insert actionPlanResp;
            actionPlanResp.Status__c = 'Submitted';
            update actionPlanResp;
           
            try{
                subcase.Status = 'Closed';
                update subcase;                            
            }catch(Exception e){
                System.Debug('#Exception'+e);
                System.assertEquals('FIELD_CUSTOM_VALIDATION_EXCEPTION', e.getDmlStatusCode(0));
            }
           
            ParentCase.Status = 'Fixed';
            ParentCase.Reason = 'Void';
            update ParentCase;
            Test.stoptest();
            /***calling stoptest() to avoid hitting SOQL Row limit ***/                                                 
    }
  }
}
HI Developers,

I have an urgent Requirement , Please see the below requirement and let me know various possibiliteis to achieve my Task,

Create a report to display all users,( how many licenses of each type we have available and how many we have purchased, but we can't run a user report to find out which users are in which license type.)

I have to show report like this and i also scheduled every month 1st week to generate report and send email to administrator

User-added image
Thanks in Advance
  Hanu
 
Hi there,

Whenever I try to send an email to a Lead in the activity side panel in Lightning, it throws the following error:
 
Review the errors on this page.
You can’t send an email to a lead when there’s a value in the Related To field. Remove the lead or the Related To entry.

Email messages work fine for Contacts, so this is exclusively an issue for Leads. It appears to be a validation rule of some sort, yet if it is, I cannot find the object the rule is on, so I cannot access it in order to change it.

Does anyone have any insight that would help me solve this problem? Is this expected behaviour?

Thanks!
Hi,
 Duplicate alert

As shown in the image i need to get the possible duplicate records when i am inserting record from apex class or Api.

when i am executing from apex class with the following code
Account ll =  new lead();
ll.Name = 'Burlington Textiles Corp of America';
insert ll;

it showing error without possibilities like this
User-added image

Please help on this.
Hai i am getting this error while i test the test class...please anyone help me on this ........
 below is my test class
@isTest
Private class TestCloseParentCase{
static testMethod void TestCloseParentCase() {


Profile p = [select id from Profile where name = 'Custom - RSE'];

User TestUser = new User(Alias = 'newUser', Email='newuser@testorg.com',
                 EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US',
                 LocaleSidKey='en_US', ProfileId = p.Id,
                 TimeZoneSidKey='America/Los_Angeles', UserName='newuser@test.philips.com', I3_Username__c = 'TestUser');
insert TestUser;

System.runAs(TestUser){

            OneEmsRecordTypes__c cs = new OneEmsRecordTypes__c(name='Case',Active__c = true, Description__c = 'Test Data'  );   
            insert cs;

            OneEmsRecordTypes__c cs1 = new OneEmsRecordTypes__c(name='Closed Case',Active__c = true, Description__c = 'Test Data'  );   
            insert cs1;            

            OneEmsRecordTypes__c cs2 = new OneEmsRecordTypes__c(name='Case - New',Active__c = true, Description__c = 'Test Data'  );   
            insert cs2;            
            
            OneEmsRecordTypes__c cs3 = new OneEmsRecordTypes__c(name='Case - SubCase',Active__c = true, Description__c = 'Test Data'  );   
            insert cs3;            
             
            Account  Acc = new Account( Name='Test Account',  Credit_status__c='Good',Account_Group__c = '0001' );
            insert Acc;
           
            Contact  Con = new Contact( FirstName = 'Test',  LastName ='Contact',  AccountID = Acc.id, Phone ='1234567890');
            insert Con;
           
            Functional_Location__c FnLocation = new Functional_Location__c(Name='TestFunctionalLocation');
            insert FnLocation;
           
            Asset  Assets = new Asset( Name = 'Test Asset',Plant__c = 'US', AccountId = Acc.Id, Main_Workcenter__c = 'Test', Functional_Location__c = FnLocation.id);
            insert Assets;
           
            Product2 prd=new Product2(name='Test Product');              
            insert prd;
           
            ServiceContract Scon = new ServiceContract(Name='Test Service contract',AccountId=Acc.Id,ContactId=Con.Id);
            insert Scon;
           
            Line_Item__c LineItem = new Line_Item__c(Name ='Test line Item',
                                    Ship_To__c = Acc.Id,
                                    Bill_To__c  = Acc.Id,
                                    Payor__c = Acc.Id,
                                    Sold_To__c = Acc.Id,
                                    Start_Date__c = system.Today(),
                                    End_Date__c = system.Today().addDays(30),
                                    Service_Contract__c = Scon.ID);
                                   
            insert LineItem;
           
            Entitlement Ent = new Entitlement(
                                    Name = 'Test Entitlement',
                                    AssetId = Assets.Id,
                                    AccountId = Acc.id,
                                    Line_Item__c = LineItem.Id,
                                    Case_Priorities_Covered__c = 'Priority 1-2'
                                    );
                                   
            insert Ent; 
          
            Id RecordTypId = [select id from RecordType where Name =:'Case' limit 1].Id; 
           
            Id SubcaseRecordTypId = [select id from RecordType where Name =:'Case - SubCase' limit 1].Id;
           
            Id subCaseActionPlanRes = [select id from RecordType where Name =: 'Subcase Response' limit 1].Id;
           
            Id subCaseActionPlan = [select id from RecordType where Name =: 'Subcase Action Plan' limit 1].Id;           
           
            OneEMSTriggerHelper.CaseFieldUpdatesExecuted();
            OneEMSTriggerHelper.CaseAfterUpsertTriggerExecuted();
                           
            Case ParentCase= new Case(
                                     Entitlement_Category__c ='Contract',
                                     AccountID=Acc.id,
                                     AssetID = Assets.id,
                                     RecordTypeId = RecordTypId,
                                     ContactID= Con.Id,
                                     Priority = '1-Critical Need',
                                     Description = 'Test Data' ,
                                     //Status='New',
                                     Type='Email',
                                     Origin='Email',
                                     Credit_Status_Override__c=false,
                                     ProductId=prd.Id,
                                     Service_Contract__c =Scon.Id,
                                     Customer_Unable_to_Provide__c = True,
                                     Reason='Application Support',
                                     EntitlementId = Ent.Id
                                     );
            insert ParentCase;           
            System.Debug('#Parent Case : '+ParentCase);
           
            Case subcase=new Case(
                                    ParentId =ParentCase.Id,
                                    AccountID=Acc.id,
                                  
                                    RecordTypeId = SubcaseRecordTypId,
                                    Problem_Description__c='test',
                                    Previous_Actions__c='test',
                                    Replaced_Parts__c='test',
                                    Status='New',
                                    Problem_Occurrence__c=system.now(),
                                    Priority = '1-Critical Need',
                                    Customer_Unable_to_Provide__c = True);
            insert subcase;
            System.Debug('#Sub Case : '+subcase);
            Action_Plan__c actionPlan = new Action_Plan__c(
                                                        Name = 'Test Action Plan',
                                                        Status__c = 'New',
                                                        Action_Plan_Executor_Role__c ='L1 Owner',
                                                        Sub_Case__c = subcase.Id,
                                                        Information_Only__c = false,
                                                        RecordTypeId = subCaseActionPlan,
                                                        Next_PAO__c = TestUser.Id,
                                                        Next_Action_Due_Date__c = System.Today()
                                                        );
            insert actionPlan; 
            actionPlan.Status__c = 'Submitted';
            update actionPlan;                                     
           
            /***calling starttest() to start test to avoid hitting SOQL Row limit ***/
            Test.starttest();
            Action_Plan__c actionPlanResp = new Action_Plan__c(
                                                        Name = 'Test Action Plan',
                                                        Status__c = 'New',
                                                        Action_Plan__c = actionPlan.Id,
                                                        RecordTypeId = subCaseActionPlanRes ,                     
                                                        Action_Plan_Executor_Role__c ='L1 Owner',
                                                        Sub_Case__c = subcase.Id
                                                        //Information_Only__c = false,
                                                        //Next_Action_Due_Date__c = null
                                                        );
            insert actionPlanResp;
            actionPlanResp.Status__c = 'Submitted';
            update actionPlanResp;
           
            try{
                subcase.Status = 'Closed';
                update subcase;                            
            }catch(Exception e){
                System.Debug('#Exception'+e);
                System.assertEquals('FIELD_CUSTOM_VALIDATION_EXCEPTION', e.getDmlStatusCode(0));
            }
           
            ParentCase.Status = 'Fixed';
            ParentCase.Reason = 'Void';
            update ParentCase;
            Test.stoptest();
            /***calling stoptest() to avoid hitting SOQL Row limit ***/                                                 
    }
  }
}
Hi All,

We have a requirement to display popup window on the edit page(before click on save button) on opportunity Standard page based on selection of particular picklist value.

Can anyone aware on this requirement.Please sugest me how to overcome from this scenario.

Many Thanks in Advance,

Regards,
Surekha