• rahul soni 20
  • NEWBIE
  • 15 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 8
    Replies

Error:::   <apex:page> is required and must be the outermost tag in the markup at line 1 column 1

 

<apex:page standardController="Opportunity">
    
    <apex:outputField value="{!Opportunity.Name}"/><br/>
    <apex:outputField value="{!Opportunity.Amount}"/><br/>
    <apex:outputField value="{!Opportunity.CloseDate}"/><br/>
    <apex:outputField value="{!Opportunity.Account.Name}"/>
    
</apex:page>

getting error :   Invalid type: WarehouseSyncSchedule

@istest
public class WarehouseSyncScheduleTest
{
     @isTest
    static void WarehousescheduleTest(){
        String scheduleTime = '00 00 01 * * ?';
        Test.startTest();
        Test.setMock(HttpCalloutMock.class, new WarehouseCalloutServiceMock());
        String jobID=System.schedule('Warehouse Time To Schedule to Test', scheduleTime, new WarehouseSyncSchedule());
        Test.stopTest();
        CronTrigger a=[SELECT Id FROM CronTrigger where NextFireTime > today];
        System.assertEquals(jobID, a.Id,'Schedule ');
    }
}
   
// here i am counting error :: Invalid type: WarehouseSyncSchedule

@isTest
public class WarehouseSyncScheduleTest{
    @isTest
    static void testWarehouseSyncSchd(){
        String sch = '0 0 0 * * ? 2020';
        Test.startTest();
            // Set mock callout class
            Test.setMock(HttpCalloutMock.class, new WarehouseCalloutServiceMock());
            String jobId = System.schedule('ScheduledWarehouseTest', sch, new WarehouseSyncSchedule());
            
            CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE Id = :jobId];
            
            System.assertEquals(sch, ct.CronExpression);
        Test.stopTest();
    }
}
can we intergate google meet/ g suit  with education cloud?
Please design the solution accordingly : 

custom objects : university, college, student 
WE NEED TO POPUP THE COLLAGE TOPPER IN COLLAGE TAB ACCORDING TO STUDENT HIGHEST MARKS

UNIVERSITY LOOKUP COLLAGE
COLLAGE    LOOKUP STUDENT



 
// to get the duplicate recored (bulkified)

 trigger duplicateUpdateOnApexObj on APEX_TEST__c (before insert) {   
    Set<APEX_TEST__c> stuList = new Set<APEX_TEST__c>();               // set to store the single record of 1 kind
    for(APEX_TEST__c s : trigger.new){                                  
        stuList.add(s);                                                // add value to set
        
    }    
    
    List<APEX_TEST__c> stuUpdateList = [SELECT ID, Name__c from APEX_TEST__c WHERE Name__c in : stuList];
    
    Map<String, APEX_TEST__c> mapStudent = new Map<String, APEX_TEST__c>();
    for(APEX_TEST__c a : stuUpdateList){
        mapStudent.put(a.Name__c, a);
    }
    for(APEX_TEST__c f : trigger.new){
        if(mapStudent.get(f.APEX_TEST__c) != null){
            f.addError('D U P L I CA TE ');
        }
    }
        
}

17 Variable does not exist: APEX_TEST__c
10 Invalid bind expression type of APEX_TEST__c for column of type String
trigger mobileUpdate on APEX_TEST__c (before insert, after insert, after update, before update) {
    List<APEX_TEST__c> mobile = new List<APEX_TEST__c>();
    
    for(APEX_TEST__c m : mobile){
        m.mobile__c = '9413836278';
    }
    insert mobile;
}

I want to update mobile filed for all record. any help??
trigger checkSecretInformation on Case (after insert, before update) {
    String childCaseSubject = 'case may contaions secrect info';
    
            // 1. create a collection that having each secrect keyword
		     List<String> secrectKeywords = new List<String>();
                secrectKeywords.add('credit card');
                secrectKeywords.add('credit card');
                secrectKeywords.add('social security');
                secrectKeywords.add('ssn');
                secrectKeywords.add('passport');
                secrectKeywords.add('bodyweight');
    
     // 2. check if our case contaions any secrect keyword 
      List<Case>	caseWithSecrectInfo = new List<Case>();
    for(Case myCase :Trigger.new) {
        if(myCase.Subject != childCaseSubject){
        for (String keyword : secrectKeywords) {
             if(myCase.Description != null && myCase.Description.containsIgnoreCase(keyword)){
                caseWithSecrectInfo.add(myCase);
                 System.debug('Case' + myCase.Id + 'include secrect keyword ' + keyword);
                 break;
             }
        }
        }
     
    }
  
  // 3. create a child case, if secrect keyword is there
  List<Case> casestoCreate = new List<Case>();
    for(Case caseWithSecrectInfo : caseWithSecrectInfo ) {
        Case childCase           = new Case();
        childCase.Subject        = childCaseSubject;
        childCase.ParentId       = caseWithSecrectInfo.Id;
        childCase.IsEscalated    = true;
        childCase.Priority       = 'High';
        childCase.Description    = 'Atleast one of the secrect keyword found' + secrectKeywords;
        casestoCreate.add(childCase);
 
    }
    insert childCase;
    }

Secret keyword listed, child case need to create if any word includes,,

How can I display that particular keyword in the child's case?

New to developing.. explanation will be helpful..
 
Hi expert,

 My requirment is to send the analytic dashboard to external layer like: webpage.
what steps do i need to follow. In which form i need to give data to web develpoer sp that they can config to that webpage.
getting error :   Invalid type: WarehouseSyncSchedule

@istest
public class WarehouseSyncScheduleTest
{
     @isTest
    static void WarehousescheduleTest(){
        String scheduleTime = '00 00 01 * * ?';
        Test.startTest();
        Test.setMock(HttpCalloutMock.class, new WarehouseCalloutServiceMock());
        String jobID=System.schedule('Warehouse Time To Schedule to Test', scheduleTime, new WarehouseSyncSchedule());
        Test.stopTest();
        CronTrigger a=[SELECT Id FROM CronTrigger where NextFireTime > today];
        System.assertEquals(jobID, a.Id,'Schedule ');
    }
}
   
// here i am counting error :: Invalid type: WarehouseSyncSchedule

@isTest
public class WarehouseSyncScheduleTest{
    @isTest
    static void testWarehouseSyncSchd(){
        String sch = '0 0 0 * * ? 2020';
        Test.startTest();
            // Set mock callout class
            Test.setMock(HttpCalloutMock.class, new WarehouseCalloutServiceMock());
            String jobId = System.schedule('ScheduledWarehouseTest', sch, new WarehouseSyncSchedule());
            
            CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE Id = :jobId];
            
            System.assertEquals(sch, ct.CronExpression);
        Test.stopTest();
    }
}
Please design the solution accordingly : 

custom objects : university, college, student 
WE NEED TO POPUP THE COLLAGE TOPPER IN COLLAGE TAB ACCORDING TO STUDENT HIGHEST MARKS

UNIVERSITY LOOKUP COLLAGE
COLLAGE    LOOKUP STUDENT



 
trigger mobileUpdate on APEX_TEST__c (before insert, after insert, after update, before update) {
    List<APEX_TEST__c> mobile = new List<APEX_TEST__c>();
    
    for(APEX_TEST__c m : mobile){
        m.mobile__c = '9413836278';
    }
    insert mobile;
}

I want to update mobile filed for all record. any help??
I am writing salesforce certified admin tomorrow.

I have a copule of questions which I have a doubt. I have marked the answer but pls let me know right or woring

1. What happens if some records do NOT meet the data validation criteria when importing data?    

A.   Import process fails only for the records with invalid data.    
B.   Import process ignores the data validation criteria.    
C.   Import process requires user authorizaton to import the invalid records.    
D.   Import process aborts when it encounters the first invalid record.    
Ans :  a

2. Users cannot save email templates in the "Unified Public Email        
    Templates" folder.

    How could a system administrator allow users to save emails to this 
    folder.

a. go to the profile of each user and check the box for Manage public templates.
b. go to the email templates and manually share each with the specific users.
c. go to the user record and check the box for Manager Public templates.
d. go to the email templates and manually share each with the profile of the specific users.

Ans : a

3.  Sales representatives at Universal containers often schedule in-
     person meetings at customer offices. Management wants to track   
     activities for this meeting category to clearly display customer 
     office meetings in the account , contact or opportunitity page 
     layouts, as well as adding this data to reports.
 
      which method should a system administrator use to solve this 
      business request? 

a. Have the user manually enter the meeting details in the description 
    field on accounts , contacts amd opportunities.
b. Add a new value to the Type field on tasks used for accounts , 
    contacts and opportunities.
c. Add a new value to the type field on accounts , contacts and 
    opportunities.
d. have the user manually enter the meeting details in the account 
    comments.

ans : b

4. Universal containers has just acquired a new company whose sales 
    team has a unique sales process with stages that are different       
    than currently set up in salesforce. To make sure the acquistions 
    turns smoothly, the Executive team does not want the new sales 
    team to have to change then process at all. 

a. Create new values for the opportunity stage field and create a new 
     sales process assigned to a custom Record Type for the new sales 
     team.
b. Create a Record type and page layout for the new sales team and 
    custom field for the new stages.
c. Create new values for the opportunity stage field and use field-level 
    security to control which teams see which fields.
d. create new values for the opportunity stage field and order them so 
    that new sales team's values are at the bottom of the picklist.

Ans : a

5.  An administrator needs to create a Sales process for a new 
      product.  
      what are three considerations for this purpose?

a. All Picklist values on the page layout must be added to the Master 
    picklist value list or be active values.
b. The record type's page layout is assigned to Users through their 
    profile assignments.
c. An opportunity record type will need to be created and assigned to 
    the sales process.
d. Adding a new value to the record Type Master Picklist value List 
    adds the value to all existing record type.
e. The record type name assignment becomes permanent upon Save 
     of a new Record type.

Ans :  a,b,d

6.Universal containers (UC) is rolling out a new approval process. As 
   the last step in the process  after an Opportunity has been 
    approved, UC wants to send a contract to its customer for 
    signature.

    What should an administrator suggest to implement the 
     functionality?

a. Check the "Send PDF" box on the approval process setup.
b. Hire a consulting firm to develop a document signing framework.
c. Install an app from the appexchange.
d. Utilize the salesforce autosign flow.

7.  which two are capabilities of the content delivery features of 
     salesforce content? 
      choose 2 answers.

a. associate the content delivery with the salesforce record.
b. password protect content deliveries that contain sensitive data.
c. Customize the URL assigned to the content delivery.
d. encrypt certain content delivery files.

ans : b , c

8. Universal containers has purchased 25 new salesforce licences.
    How many users can a system administrator create at the same 
    time on the Add Multiple Users page?

a. a maximum of 10 users
b. an unlimited numbers of users
c. a maximum of 5 users
d. a maximum of 25 users.

ans : b

Pls correct the answers if wrong.

thanks
sheila
Hello everyone I could use some help on the using future Methods trailhead. Please keep in mind I am not an Apex coder at all but I am trying to learn as much as I can.

Here is the Task

Create an Apex class with a method using the @future annotation that accepts a List of Account IDs and updates a custom field on the Account object with the number of contacts associated to the Account. Write unit tests that achieve 100% code coverage for the class.
Create a field on the Account object called 'Number_of_Contacts__c' of type Number. This field will hold the total number of Contacts for the Account.
Create an Apex class called 'AccountProcessor' that contains a 'countContacts' method that accepts a List of Account IDs. This method must use the @future annotation.
For each Account ID passed to the method, count the number of Contact records associated to it and update the 'Number_of_Contacts__c' field with this value.
Create an Apex test class called 'AccountProcessorTest'.
The unit tests must cover all lines of code included in the AccountProcessor class, resulting in 100% code coverage.
Run your test class at least once (via 'Run All' tests the Developer Console) before attempting to verify this challenge.

I have written an Apex class and a Test class but I think I am doing them both Wrong: because when I try to check the challenge i Get this error

Challenge Not yet complete... here's what's wrong: 
The 'AccountProcessorTest' test class doesn't appear to be calling the 'AccountProcessor.countContacts' method between Test.startTest() and Test.stopTest().


When I run the Test class I get this error :

System.QueryException: List has no rows for assignment to SObject

Here is the CLASS:
 
public class AccountProcessor {
     @future

  public static void someFutureMethod(List<id> scope) {

   Account[] updates = new Account[] {};
        for (AggregateResult ar : [
                select AccountId a, count(Id) c
                from Contact
                where AccountId in :scope
                group by AccountId
                ]) {
            updates.add(new Account(
                    Id = (Id) ar.get('a'),
                    Number_of_Contacts__c = (Decimal) ar.get('c')
                    ));
        }
        update updates;
    }

}

Here is the Test Class:
 
@IsTest
public class AccountProcessorTest {
  public static testmethod void TestAccountProcessorTest() {
 
Test.startTest();
     Account a = new Account();
        a.Name = 'Test Account';
        Insert a;
      
      Contact cont = New Contact();
      
      cont.FirstName ='Bob';
      cont.LastName ='Masters';
      cont.AccountId = a.Id;
      Insert cont;

    Test.stopTest() ;
     Contact ACC = [select AccountId from Contact where id = :a.id LIMIT 1];

 
        System.assert(Cont.AccountId != null);
        System.assertequals(cont.id, ACC.AccountId);

  }}

I have used alot or diffrent google searches to get me this far. But I have not Idea if Im even remotly close to the right answer or not.


 
Hi expert,

I am new in web service region. can any one help me to give an example apex class how to send data from salesforce to external system ?

Thanks