• Benazir
  • NEWBIE
  • 60 Points
  • Member since 2016
  • Developer
  • MST Solutions

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 7
    Replies
Here Is my class :
public with Sharing class VisitReportpdf{

Public sic_Visit_Report__c VisitReport{get;set;}
Public VisitReportpdf(apexpages.standardcontroller controller){
VisitReport= [SELECT 
                   id,
                   Name,
                   CreatedBy.name,
                   Our_shares__c,
                   Market_Share__c,
                   Total_demand__c,
                   Visit_title__c,
                   Visit_Date__c,
                   Account__r.name,
                   Competitors__c,
                   Contact__r.name,
                   Internal_Participants__c,
                   Objective__c,
                   Report_details__c                   
               FROM Visit_Report__c 
               where id=:ApexPages.CurrentPage().getparameters().get('id')];
}
}

And this is my Test Class
@isTest(SeeAllData=true)
public Class TestVisitReportpdf{
  public static testmethod void test1(){
   
   Account acc= new Account();
   acc.name ='TestAccount';
   Insert acc;
   
   Contact con = new Contact();
   Con.lastName='Test Contact';
   Con.Accountid=acc.id;
   Insert con;
   
    Visit_Report__c svr = new Visit_Report__c();  
    svr.Account__c=acc.id;
    svr.Competitors__c='test Competitors';
    svr.Contact__c=con.id;
    svr.Visit_Date__c=system.today();
    svr.Internal_Participants__c='Test Participents';
    svr.Our_shares__c=10;
    svr.Market_Share__c=90;
    svr.Total_demand__c=100;
    svr.Objective__c='Commercial';
    svr.Report_details__c='Test Report Details';
    svr.Visit_title__c='Test visit Title';
    Insert svr;  
   

        
    
  ApexPages.Standardcontroller sc = new ApexPages.Standardcontroller(svr);
  VisitReportpdf VRP= new VisitReportpdf(sc);
 
      
 }
}

I'm receiving an error on Line: 1, Column 1 
System.StringException: Unexpected end of expression.

System.schedule('IMSync_At00Minutes', '0 0***?',new IncidentManagerSync());
System.schedule('IMSync_At15Minutes', '0 15***?',new IncidentManagerSync());
System.schedule('IMSync_At30Minutes', '0 30***?',new IncidentManagerSync());
System.schedule('IMSync_At45Minutes', '0 45***?',new IncidentManagerSync());

Can someone tell me what I'm doing wrong? I'm trying to execute a process every 15 minutes.  Did I get the syntax wrong somewhere?
Hi All,
I have an Apex class Class1 with method1,method2 and method3 in it, i would like to set a static variable V1=True initially and have below trigger to be run when the Static variable V1 is false.
trigger Trigger1 on Account (before insert, before update) {


    if((Trigger.isInsert || Trigger.isUpdate) && Trigger.isBefore){
        Class1.Method1(Trigger.new);
        Class1.Method2(Trigger.new);
    }
    if((Trigger.isInsert || Trigger.isupdate) && Trigger.isAfter){
    
        Class1.Method3(Trigger.new,trigger.old);
    }  

}
Help will be appreiated,

Thanks
CvK
Json respone is :

"meta_idx": {
"Account Manager": "Test "
}

In salesforce thru calloutm want to take the value of "Account Manager" and map to custom object field...

{
                    ch.Account_Manager__c = m.Account Manager;
                }

Its not taking Space in between "Account Manager"..
Thanks in advance...
 
  • September 25, 2017
  • Like
  • 0
Here Is my class :
public with Sharing class VisitReportpdf{

Public sic_Visit_Report__c VisitReport{get;set;}
Public VisitReportpdf(apexpages.standardcontroller controller){
VisitReport= [SELECT 
                   id,
                   Name,
                   CreatedBy.name,
                   Our_shares__c,
                   Market_Share__c,
                   Total_demand__c,
                   Visit_title__c,
                   Visit_Date__c,
                   Account__r.name,
                   Competitors__c,
                   Contact__r.name,
                   Internal_Participants__c,
                   Objective__c,
                   Report_details__c                   
               FROM Visit_Report__c 
               where id=:ApexPages.CurrentPage().getparameters().get('id')];
}
}

And this is my Test Class
@isTest(SeeAllData=true)
public Class TestVisitReportpdf{
  public static testmethod void test1(){
   
   Account acc= new Account();
   acc.name ='TestAccount';
   Insert acc;
   
   Contact con = new Contact();
   Con.lastName='Test Contact';
   Con.Accountid=acc.id;
   Insert con;
   
    Visit_Report__c svr = new Visit_Report__c();  
    svr.Account__c=acc.id;
    svr.Competitors__c='test Competitors';
    svr.Contact__c=con.id;
    svr.Visit_Date__c=system.today();
    svr.Internal_Participants__c='Test Participents';
    svr.Our_shares__c=10;
    svr.Market_Share__c=90;
    svr.Total_demand__c=100;
    svr.Objective__c='Commercial';
    svr.Report_details__c='Test Report Details';
    svr.Visit_title__c='Test visit Title';
    Insert svr;  
   

        
    
  ApexPages.Standardcontroller sc = new ApexPages.Standardcontroller(svr);
  VisitReportpdf VRP= new VisitReportpdf(sc);
 
      
 }
}

I'm receiving an error on Line: 1, Column 1 
System.StringException: Unexpected end of expression.

System.schedule('IMSync_At00Minutes', '0 0***?',new IncidentManagerSync());
System.schedule('IMSync_At15Minutes', '0 15***?',new IncidentManagerSync());
System.schedule('IMSync_At30Minutes', '0 30***?',new IncidentManagerSync());
System.schedule('IMSync_At45Minutes', '0 45***?',new IncidentManagerSync());

Can someone tell me what I'm doing wrong? I'm trying to execute a process every 15 minutes.  Did I get the syntax wrong somewhere?
Hi All,
 I am trying to call apex from javascript.  Wrote the below script

<script src="/soap/ajax/15.0/connection.js" type="text/javascript">
</script> <script src="/soap/ajax/15.0/apex.js" type="text/javascript"></script>
var r= confirm ("Are you sure you want to fetch?");
if(r== true)
{
   var a = sforce.apex.execute("web","fetch",{ID: "{!Account.Id}"});
   alert(a);
}
else
{
   alert("Operation aborted");
}

I have already the class named 'web' with method 'fetch'.  I wrote the above script on a button.  When I click on that button,  I get an error 'Unexpected token < '
On debugging , i found issue with the two lines defining the ajax connection and apex.js.  can anyone help what is wrong with the code.
I am facing another issue on this superbadge, specifically in Challenge #10, i am getting the following error:
The Campaign Influence Lightning report must have the correct 1. Aggregate, 2. Columns, 3. Groupings, and 4. Filter.

The requirements have no mention about what fields, groupings, filters, aggregates to include in the report. What am I missing?