• bharthi
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies

Hi Guys,

 

I need to do the following :

 

I have a related list matrix grid  Like so on my Call Report Page (the below is from an Object called Call Report Vehicles) :

 

 

Call Report Vehicles

 

 

 

 

Action

Call Report Vehicle: CRV#

REG/MVA/Product

Due to Term

Vehicle Over Term

Vehicle Over Km's

Over/Under Utilised by 40%

Service Missed

Service Due

Outstanding Odometer Readings(30 Days)

Vehicle Fault

Edit | Del

CRV-12387

ND190977/1284125/FML

X

 

X

 

X

X

 

 X

Edit | Del

CRV-12388

ZWW158GP/1284124/FML

X

X

 

 X X  X

 

 

Basically i want to allow users to search this related list as sometimes there are more than 100 vehicles in the list an users are not able to find the vehicle they are looking for.

 

I thought of creating a new VF page that would be called by a button on the related list, and having a search box and a search button on the Search Page. But i am unsure how to get the above list to filter by the search criteria.

 

any help would be greatly appreciated.

Hi Guys,

 

Ok here is what i am trying to achieve, I have a roll up summary of the following data from an object called Call report Vehicles and this data is displayed on another Object Call Report:

 

Vehicles due for service : 2

Vehicles due for term : 6

Services missed : 10

 

and so on..

 

I created the above in the Call report, then i added a button to email the above summary in pdf to a sales rep. I also added to this supporting pdf's which is detailed summary of the above listing for example services missed - all the vehicles and their details.

 

When i email the Pdf's there is no issues and if i add it as a custom link(https://VehicleServicesMissed?id=a07P0000000mUXZ) there is no issues but custom links were not looking neat and tidy hence we went with hyperlinks.

 

the issue arises when i create a new section on Call Report to have hyperlinks to these pdf's (i tried to do a hyperlink on the summary values but failed) so i decided to go the route of hyperlinks however if i create a hyperlink and used the path from the custom link like the one below it worked for one record as the "a07P0000000mUXZ" references a specific call report.

 

How do i change the hyperlink below so if i access the link from call report 1,2 OR 3 the data that would be represented would be for that call report. I suspect i need to do some sort of id record match but since im new to salesforce i am absolutely clueless.

https:///VehicleServicesMissed?id=a07P0000000mUXZ

 

 

any help would be greatly appreciated.

 

Bharthi Ramsewak

 

 

 

 

 

 

 

Hi ,

 

Basically i have Roll up summary fields. example Total Fleet vehicles = 2, services missed = 4. I want the users to be able to click on the number 2 or 4 or the caption Total Fleet vehicles and a pdf should be generated with details of those 4 vehicles.

 

I have created the PDF's and if i do a custom link i dont have any issues i can see the pdf.

 The only issue i have with custom links is that they can only be under the custom links section and at this point it does not look professional as there are custom buttons listed as well.

 

I would like to know if there is a way i can do this on either the number 2 or the caption Total fleet. Any help would be greatly appreciated.

 

Regards,

Bharthi 

I'm tyring to insert a master record and detail record from one visualforce page, but I can't get the test class to work, any idea?

 

I'm only getting 64% coverage and it's throwing this message.  Thanks in advance!

 

System.DmlException: Insert failed. First exception on row 0 with id a1OS0000000B8yiMAC; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]


Class.newVendorPriceController.save: line 43, column 7 Class.TestNewVendorPriceController.TestNewVendorPriceController: line 41, column 1 External entry point

 

public class newVendorPriceController {
   
   
   Vendor_Price_Line_Item__c vendorlineitem;
   Vendor_Pricing__c vendorprice;
   Order__c order;
   
    private final Map<String, String> currentpageParams;

     
     public newVendorPriceController(ApexPages.StandardController controller) {
     
     this.vendorprice = (Vendor_Pricing__c)controller.getRecord();
     this.currentpageParams = ApexPages.currentPage().getParameters();

            
    }   
    
   public Vendor_Pricing__c getvendorprice() {
      if(vendorprice == null) vendorprice = new Vendor_Pricing__c();
      return vendorprice;
   }
   
     public Vendor_Price_Line_Item__c getvendorlineitem() {
      if(vendorlineitem == null) vendorlineitem = new Vendor_Price_Line_Item__c();
      return vendorlineitem;
   }
   

    public string oId = apexpages.currentpage().getParameters().get('id');
    
    
    public PageReference cancel() {
          PageReference pr = new PageReference('/ui/desktop/DesktopPage');
          pr.setRedirect(true);
          return pr;
     }

      public PageReference save() {

      insert vendorprice;
    
      vendorlineitem.Vendor_Price__c=vendorprice.id;
      insert vendorlineitem;


      PageReference vendyPage = new ApexPages.StandardController(vendorprice).view();
      vendyPage.setRedirect(true);

      return vendyPage;
   }

   }

 

 

 

 

 

Test Method:

 

@isTest

private class TestNewVendorPriceController {


static testMethod void TestNewVendorPriceController(){

   Vendor_Pricing__c venprice;
   ApexPages.StandardController sc;
   newVendorPriceController vpc;

Account account = new Account();// specify all the required fields
account.name = 'testing';
account.shippingcity = 'baltimore';
account.shippingstate = 'MD';
account.shippingcountry = 'USA';
account.shippingpostalcode = '21228';
insert account;
Contact contact = new Contact();// specify all the required fields
contact.lastname = 'test';
insert contact;
States__c state = new States__c ();
state.State_Code__c = 'BB';
insert state;
Order__c ord = new Order__c ();
ord.Account__c = account.Id;
insert ord;
Vendor_Pricing__c ven = new Vendor_Pricing__c ();
ven.Order__c = ord.Id;
insert ven;
Vendor_Price_Line_Item__c venline = new Vendor_Price_Line_Item__c ();
venline.Vendor_Price__c = ven.Id;
insert venline;

System.assertNotEquals(null, ven.Id);//tests to see if your insert was successful
   vpc = new newVendorPriceController(new ApexPages.StandardController(ven)); //here you instantiate the controller with a standard controller.
   //start you user testing.

vpc.getvendorprice();
vpc.getvendorlineitem ();
vpc.save();
vpc.cancel();



}

}

Hi Guys,

 

Ok here is what i am trying to achieve, I have a roll up summary of the following data from an object called Call report Vehicles and this data is displayed on another Object Call Report:

 

Vehicles due for service : 2

Vehicles due for term : 6

Services missed : 10

 

and so on..

 

I created the above in the Call report, then i added a button to email the above summary in pdf to a sales rep. I also added to this supporting pdf's which is detailed summary of the above listing for example services missed - all the vehicles and their details.

 

When i email the Pdf's there is no issues and if i add it as a custom link(https://VehicleServicesMissed?id=a07P0000000mUXZ) there is no issues but custom links were not looking neat and tidy hence we went with hyperlinks.

 

the issue arises when i create a new section on Call Report to have hyperlinks to these pdf's (i tried to do a hyperlink on the summary values but failed) so i decided to go the route of hyperlinks however if i create a hyperlink and used the path from the custom link like the one below it worked for one record as the "a07P0000000mUXZ" references a specific call report.

 

How do i change the hyperlink below so if i access the link from call report 1,2 OR 3 the data that would be represented would be for that call report. I suspect i need to do some sort of id record match but since im new to salesforce i am absolutely clueless.

https:///VehicleServicesMissed?id=a07P0000000mUXZ

 

 

any help would be greatly appreciated.

 

Bharthi Ramsewak

 

 

 

 

 

 

 

Hi ,

 

Basically i have Roll up summary fields. example Total Fleet vehicles = 2, services missed = 4. I want the users to be able to click on the number 2 or 4 or the caption Total Fleet vehicles and a pdf should be generated with details of those 4 vehicles.

 

I have created the PDF's and if i do a custom link i dont have any issues i can see the pdf.

 The only issue i have with custom links is that they can only be under the custom links section and at this point it does not look professional as there are custom buttons listed as well.

 

I would like to know if there is a way i can do this on either the number 2 or the caption Total fleet. Any help would be greatly appreciated.

 

Regards,

Bharthi