• david rogger
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I'm trying to learn how to make Visualforce pages, and am on the module https://developer.salesforce.com/trailhead/visualforce_fundamentals/visualforce_variables_expressions
I have created the page per the instructions, but now get this Problem on Line 1:
"Incorrect paramenter type for function 'not()'. Expected boolean, received Text" 
for this page which looks exactly like the example in the module:

<apex:page sidebar="false">
 
    <apex:pageBlock title="User Status">
    <apex:pageBlockSection columns="1">
        {! $User.FirstName &''&! $User.LastName }
        ({! $User.Username})
        <p>Today's Date is {! TODAY()} </p>
        <p>Next week will be {! TODAY() + 7}</p>
      
        </apex:pageBlockSection>
    </apex:pageBlock>
    
</apex:page>
-------------
I have removed the "" from around the sidebar="false", but the error persists.

What is wrong?
 
I need to create a rollup of prices that is coming from an object called Events (This is usally in multiples). These Events have three different objects associated with each one and these three objects can have many records under each. I realized that if I have more than just a few events I get an SOQL query limit.  I am quite new to salesforce and most of my team is off preparing them for a release so I do not want to bug them.  I'm not too sure the code so if you could help me more than just saying the technical way of doing things and put it into simpler terms a noob would understand I would be forever in your debt.
 
public with sharing class BookingInclusivePriceInlineExt {

	public Booking__c booking { get; set;}

    private QueryTaxGroupSchedule qtgs;
	private BookingEvent__c bEvent;
	public BookingInclusivePriceInlineExt(ApexPages.standardController stdController) 
	{
		booking = new Booking__c();

        booking.AtDefiniteBlendedEventRevenue1__c = 0;
        booking.AtDefiniteBlendedEventRevenue2__c = 0;
        booking.AtDefiniteBlendedEventRevenue3__c = 0;
        booking.AtDefiniteBlendedEventRevenue4__c = 0;
        booking.AtDefiniteBlendedEventRevenue5__c = 0;
        booking.AtDefiniteBlendedEventRevenue6__c = 0;
        booking.AtDefiniteBlendedEventRevenue7__c = 0;
        booking.AtDefiniteBlendedEventRevenue8__c = 0;
        booking.AtDefiniteBlendedEventRevenue9__c = 0;
        booking.AtDefiniteBlendedEventRevenue10__c = 0;
        booking.AtDefiniteBlendedEventRevenue11__c = 0;
        booking.AtDefiniteBlendedEventRevenue12__c = 0;
        booking.AtDefiniteBlendedEventRevenue13__c = 0;
        booking.AtDefiniteBlendedEventRevenue14__c = 0;
        booking.AtDefiniteBlendedEventRevenue15__c = 0;  
         		
    	//Booking__c bookingRecord = new BookingRecord__c();	
    	Booking__c bookingRecord = (Booking__c) stdController.getRecord();
    	
    	for(BookingEvent__c bEvent : [Select Id, TaxGroup__c from BookingEvent__c Where Booking__c =: bookingRecord.id])
    	{
    		BookingEventInclusiveRollup(bEvent.Id, bEvent.TaxGroup__c);
    	}
    	
    	for(BookingOtherIncome__c boi : [Select Id, TaxGroup__c, AdminIsIncludedInInclusivePrice__c, GratuityIsIncludedInInclusivePrice__c, Gratuity__c, AdminCharge__c, RevenueClassification__c, RevenueClassification__r.CategoryMapping__c From BookingOtherIncome__c where Booking__c =: bookingRecord])
    	{
    		
    		InclusiveRevenueBreakdown(boi.RevenueClassification__c, boi.GratuityIsIncludedInInclusivePrice__c, boi.AdminIsIncludedInInclusivePrice__c, boi.UnitPrice__c, boi.AdminCharge__c, boi.Gratuity__c, boi.RevenueClassification__r.CategoryMapping__c, boi.BookingPackageEvent__r.PackageCovers__c, boi.BookingPackageEvent__r.BookingEvent__r.TaxGroup__c);
    	}	
	}
	
    private void BookingEventInclusiveRollup(id bEvent, id taxGroup)
   		{
   		qtgs = new QueryTaxGroupSchedule(taxGroup, false);
   		 		
   		for(EventPackageRevenueBreakdown__c eprb : [Select Id, BookingPackageEvent__r.PackageCovers__c, AdminIsIncludedInInclusivePrice__c, GratuityIsIncludedInInclusivePrice__c, Gratuity__c, AdminCharge__c, UnitPrice__c, RevenueClassification__c, RevenueClassification__r.CategoryMapping__c, BookingPackageEvent__r.BookingEvent__r.TaxGroup__c from EventPackageRevenueBreakdown__c where BookingPackageEvent__r.BookingEvent__c =: bEvent])
   		{	
        	InclusiveRevenueBreakdown(eprb.RevenueClassification__c, eprb.GratuityIsIncludedInInclusivePrice__c, eprb.AdminIsIncludedInInclusivePrice__c, eprb.UnitPrice__c, eprb.AdminCharge__c, eprb.Gratuity__c, eprb.RevenueClassification__r.CategoryMapping__c, eprb.BookingPackageEvent__r.PackageCovers__c, eprb.BookingPackageEvent__r.BookingEvent__r.TaxGroup__c);
       	}
     
       	for(EventItem__c eventItems : [Select Id,  ActualQuantity__c, UnitPrice__c, AdminCharge__c, AdminIsIncludedInInclusivePrice__c, GratuityIsIncludedInInclusivePrice__c, Gratuity__c, RevenueClassification__c, RevenueClassification__r.CategoryMapping__c, Event__r.TaxGroup__c from EventItem__c where EventItem__c.ItemType__c =: 'Item' and Event__c =: bEvent and PriceWithMenu__c = false])
       	{
       		InclusiveRevenueBreakdown(eventItems.RevenueClassification__c, eventItems.GratuityIsIncludedInInclusivePrice__c, eventItems.AdminIsIncludedInInclusivePrice__c, eventItems.UnitPrice__c, eventItems.AdminCharge__c, eventItems.Gratuity__c, eventItems.RevenueClassification__r.CategoryMapping__c, eventItems.ActualQuantity__c, eventItems.Event__r.TaxGroup__c);
       	}
        	
       	for(EventItemRevenueBreakdown__c itemRev : [Select Id, EventItem__r.ActualQuantity__c, AdminIsIncludedInInclusivePrice__c, GratuityIsIncludedInInclusivePrice__c, Gratuity__c, AdminCharge__c, UnitPrice__c, RevenueClassification__r.CategoryMapping__c, RevenueClassification__c, EventItem__r.Event__r.TaxGroup__c from EventItemRevenueBreakdown__c where  EventItem__r.Event__c =: bEvent])
		{
			InclusiveRevenueBreakdown(itemRev.RevenueClassification__c, itemRev.GratuityIsIncludedInInclusivePrice__c, itemRev.AdminIsIncludedInInclusivePrice__c, itemRev.UnitPrice__c, itemRev.AdminCharge__c, itemRev.Gratuity__c, itemRev.RevenueClassification__r.CategoryMapping__c, itemRev.EventItem__r.ActualQuantity__c, itemRev.EventItem__r.Event__r.TaxGroup__c);
       	}
    }
      
    private void InclusiveRevenueBreakdown(id revClassification, boolean gratIncluded, boolean adminIncluded, decimal unitPrice, decimal adminCharge, decimal gratuity, decimal revCategory, decimal quantity, id taxGroup){
    	
    	qtgs = new QueryTaxGroupSchedule(taxGroup, false);
    	decimal totalRate = qtgs.GetInclusiveBaseRate(taxGroup, revClassification);
        
        if(adminIncluded)
            totalRate += (adminCharge==null?0: adminCharge / 100)*(qtgs.GetInclusiveAdminRate(taxGroup, revClassification));
        if(gratIncluded)
            totalRate += (gratuity==null?0: gratuity / 100)*(qtgs.GetInclusiveGratuityRate(taxGroup, revClassification));
        
        booking.put('AtDefiniteBlendedEventRevenue' + String.valueOf(revCategory) + '__c', ((decimal) booking.get('AtDefiniteBlendedEventRevenue' + String.valueOf(revCategory) + '__c') + (unitPrice==null?0:unitPrice)*(totalRate) * (quantity == null? 1:quantity)));              	
    }
}