• JimmyMac
  • NEWBIE
  • 40 Points
  • Member since 2013

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

I have the following test script:

 

@isTest

public class theBatchLoadTest{

 

    public static testMethod void testMyController() {

        

        BatchLoadDaily controller = new BatchLoadDaily('fm017104');

         Database.executeBatch(controller, 20);

 

        }

}

 

 

Which tests the following:

 

global class BatchLoadDaily implements Database.Batchable<sObject> {

  

  global final String bdId;

   

  global BatchLoadDaily(String bdId) {

    this.bdId = bdId;

     

  }

 

 

  global Database.QueryLocator start(Database.BatchableContext bc) {

     

return Database.getQueryLocator('SELECT payout__PrimaryKey__c, payout__Account_Desc__c, payout__Account_Opening__c, payout__Account_Type__c, payout__Albridge_ID__c, payout__Asset_Fund_Name__c, payout__Asset_Type__c, payout__BD_Id__c, payout__Cirrus_Source__c, CreatedById, CreatedDate, payout__CumDisc__c, payout__Cusip__c, payout__Dealer__c, payout__DealerBranch__c, IsDeleted, payout__Financial_Account_Number__c, payout__FirstName__c, payout__IRS_Code__c, Name, LastModifiedById, LastModifiedDate, payout__LastName__c, payout__Last_Price__c, payout__Last_Price_Update__c, payout__Market_Value__c, payout__MiddleName__c, payout__Num_Of_Shares__c, OwnerId, payout__Payout_Date__c, payout__PersonMailingCity__c, payout__PersonMailingStateProv__c, payout__PersonMailingStreet__c, payout__PersonMailingZip__c, payout__PersonOtherPhone__c, payout__Phone__c, payout__Plan_Status_Code__c, ConnectionReceivedId, Id, payout__Registration_Line_1__c, payout__Registration_Line_2__c, payout__Registration_Line_3__c, payout__Registration_Line_4__c, payout__SSN__c, payout__SSN_Financial_Account__c, ConnectionSentId, payout__Shares__c, payout__Sponsor_Name__c, payout__Symbol__c, SystemModstamp, payout__Systematic_Plan_Type__c, payout__Tax_Status__c, payout__UniqueId__c, payout__Valuation_Date__c, payout__RepId__c  FROM payout__ImportStaging__c where payout__BD_Id__c = \'' + String.escapeSingleQuotes(bdId) + '\' AND payout__Processed_Flag__c <> \' Y \'');

  }

 

  global void execute(Database.BatchableContext bc, List<payout__ImportStaging__c> scope) {

      

       

       System.Debug('Get in void execute');

 

}

 

But for some reason the global void execute code is NOT getting run (tested). Any ideas?.... The query does return rows to the getQueryLocator, but then the test stops and no more code is tested/covered.

 

Thanks so much for any help!

-Jim

The below string works:

mystr = 'SELECT payout__Account_Desc__c FROM payout__ImportStaging__c where payout__BD_Id__c = \'' + bdId + '\'');

 

I want to add the following to the string:

and payout__Processed_Flag__c <> 'Y'

 

but am having an issue with the single quotes around the Y when trying to get the escape syntax correct....

 

Can somone please give me the correct syntax and what the complete mystr would look like ?

 

Thanks in advance.

-Jim

 

 

I am not sure what the variable type declaration should be for my results variable, I thought it was UpsertResult but I am

getting an error "Invalid type UpsertResult"

 

try {
 
           UpsertResult results = Database.Upsert(acctToInsert,payout__SSN__c,false);
            if (results != null)
            {
                for (UpsertResult.SaveResult result : results)
                {
                    if (!result.isSuccess())
                    {
                        Database.Error[] errs = result.getErrors();
                        for(Database.Error err : errs)
                        System.debug(err.getStatusCode() + ' - ' + err.getMessage());
     
                    }
                }
            }    
 
            }
               catch (Exception e)
            {
               System.debug(e.getTypeName() + ' - ' + e.getCause() + ': ' + e.getMessage());
            }
      

Hi,

 

I am trying to execute the following Batch Apex Class from the Developers Console:

Id batjobId = Database.execute(new BatchLoadDaily('fm1000'),200);

 

 

 

Below is my Apex Class:

 

global class BatchLoadDaily implements Database.Batchable<sObject> {
  global final String bdId;
 
 
  global BatchLoadDaily(String bdId) {
    this.bdId = bdId;
    
  }
 
  global Database.QueryLocator start(Database.BatchableContext bc) {
    return Database.getQueryLocator('SELECT payout__Account_Desc__c, payout__Account_Opening__c, payout__Account_Type__c, payout__Albridge_ID__c, payout__Asset_Fund_Name__c, payout__Asset_Type__c, payout__BD_Id__c, payout__Cirrus_Source__c, CreatedById, CreatedDate, payout__CumDisc__c, payout__Cusip__c, payout__Dealer__c, payout__DealerBranch__c, IsDeleted, payout__Financial_Account_Number__c, payout__FirstName__c, payout__IRS_Code__c, Name, LastModifiedById, LastModifiedDate, payout__LastName__c, payout__Last_Price__c, payout__Last_Price_Update__c, payout__Market_Value__c, payout__MiddleName__c, payout__Num_Of_Shares__c, OwnerId, payout__Payout_Date__c, payout__PersonMailingCity__c, payout__PersonMailingStateProv__c, payout__PersonMailingStreet__c, payout__PersonMailingZip__c, payout__PersonOtherPhone__c, payout__Phone__c, payout__Plan_Status_Code__c, ConnectionReceivedId, Id, payout__Registration_Line_1__c, payout__Registration_Line_2__c, payout__Registration_Line_3__c, payout__Registration_Line_4__c, payout__SSN__c, payout__SSN_Financial_Account__c, ConnectionSentId, payout__Shares__c, payout__Sponsor_Name__c, payout__Symbol__c, SystemModstamp, payout__Systematic_Plan_Type__c, payout__Tax_Status__c, payout__UniqueId__c, payout__Valuation_Date__c  FROM payout__ImportStaging__c where payout__BD_Id__c = \'' + bdId + '\'');
  }
 
  global void execute(Database.BatchableContext bc, List<payout__ImportStaging__c> scope) {
   
       boolean upsertCertainFields;
       boolean noUpsertHldOrMVH;
       string recType;

 

I am getting an error saying it is an incorrect signature..... What am I doing wrong? Thanks to all.

I think the answer to this is “yes”  but are there any govonor limits to worry about if we are using Batch Apex?

 

If the answer is yes, then in my Staging object I have over 30K rows and I need to loop thru each row and do a SOQL query to find the corresponding object to update.

 

I know we aren’t supposed to do SOQL inside of loops so what is the “best practice” for NOT doing this, how else can I accomplish updating corresponding objects without using SOQL in a loop?

 

Thanks.

Is there a way for me to run a SOQL query against an excel spreadsheet?

 

I need to write an inport/update process of my Salesforce objects, with the source data contained in Excel. Can I write SOQL against the Excel file, or do I need to export the Excel data into a Staging Object first and then run the SOQL against the Staging table?

 

Thanks to all in advance.

-Jim

I am brand new to the Data Loader, if I have a business rule that I need to apply to a column before it gets loaded can I implement it in the data loader process or do I need to write special code after the load is done to take care of it.

 

Is the best practice to do my business logic in a trigger?

 

Thanks to all for any help.

 

-Jim

In my Account object I have id and refid that relates who referred a client

 

I need to display a referal list tree in a VisualForce page as follows: (Note I just need to display the Name the other fields are to show the relationships)

 

Name=Jim id = 99

     Name=MO, id=1, refid = 99

           Name=JA, id=2, refid=1

                Name=BA, id=3, refid=2

                Name=MA, id=4,refid=2

 

     Name=MB, id=5, refid=99

          Name=CB, id=6, refid=5

                SF id=7, refid =6

                      AA id=8, refid = 7

                 SB id=9, refid=6

 

So the start is Jim, and because of Jim, the following tree has been created based on who each person has referred.

 

Since SOQL doens't have a way of doing a CONNECT BY to bring back the data in the tree order, what are your suggestions for accomplishing this?

 

I assume we need a recursive loop approach but would love to see what you gurus come up with.

 

Thanks so much.

 

I know we are not allowed to have a subquery on the same object as our main query, so I am not sure how to write the following SOQL:

 

Select  payout__Households__c
from Account
where payout__Households__c  in

   (

  Select  payout__Households__c
   from Account
   where id = '001A000000Iw0nxIAB'

   )

 

Thanks in advance!

-Jim

What is the best practices for saving client preferences that I can read to determine whether or not to turn "on"/"off" functionality?

 

If someone could give me an example and what the syntax would be to retrieve the data that would be very helpful.

 

Thanks so much in advance.

I am new to Apex, and the testing has me a bit confused as to how to perform certain types of tests:

 

Below is my code, can some one help me see how to write a test for this as well as answer the questions below?

1. How to test a method that is defined as a PageReference? (i.e how to CALL it in a test method?)

2. When creating test data "on the fly" how long does the test data stay available (i.e If I create test data in the FIRST test method,  is the data gone right after that test completes or is that test data available to all the rest of the test methods I have defined. So Can I just add the test data ONCE, for ALL my tests or do I need to do it for EACH test method I have defined?

 

 

public PageReference processViewHousehold() {
 
        //Householdis is a PUBLIC variable contains list of id's
        if(householdid != null)
        {
            List<Account> HouseHold = new List<Account>(
            [
            Select id                    
            from account
            where payout__Households__c = :householdid
        
            ]
            );
        
        
           List<Id> myClientIdList = new List<id> ();
       
           for(Account a : HouseHold){
               myClientIdList.add(a.id);
           }       
   
           ClientIdList = myClientIdList;
        }
        
      
        return null;
    }

Hi I am new to Apex, and  I need to create a Test  for a method that references a Public variable(ClientIdList) see below:

 

public Void getRb() {

List <laserapp3__Ben2__c> relatedBene = new List<laserapp3__Ben2__c> (

[
SELECT
name,
ownerid,
Policy_Number__c,
Insurance__c,
Financial_Account_Number__c,
laserapp3__Percentage__c,
laserapp3__Relationship__c,
laserapp3__First__c,
laserapp3__Last__c,
laserapp3__Account__c,
Financial_Account__c

FROM laserapp3__Ben2__c
where laserapp3__Account__c in :ClientIdList

order by Financial_Account_Number__c nulls last, Policy_Number__c
]
);
 
 Id myId;
 for (laserapp3__Ben2__c ar : relatedBene)
 {   
 
      myId = (Id)ar.get('laserapp3__Account__c');
      
     BeneMap.put(myId,getClientName(ar.laserapp3__Account__c));
 }
 
Rb = relatedBene;  
 
}

 

Can anyone please help me understand what the Test method should be to test this properly? THANKS!
 

Hi All,

 

I need to loop thru an orderd SObject list(Ordered by Policy Number)  and I was hoping to sum up the values as I looped for EACH POLICY NUMBER GROUP, and then perform a display a subtotal of the summed value, and then break after I get done with each Policy.

 

The reason I am doing the SUM in a loop and not in a query is that the object I need to query against does NOT allow Grouping by the Policy_Number field (Don't ask :))

 

Can someone tell me the "best practices" for doing this?

 

Thanks so much.

-Jim

I have read a lot of things on the net saying this can be done but I have tried all the suggestions and can't get it to work. My page always ends up in portrait. Below is the stylesheet I am using. In addition to what I have here, I have also tried:

 

@page{size: a4 landscape}

@page(size: landscape}

 

 

<style>
th {white-space:nowrap;background-color:#000080;

 @page {
  size: 297mm 210mm;
}

odd {
background-color: #FCF7F7;
}
even {
background-color: #E3DCDB;
}

.showme
{
   position:static;
 
   display: none;
   overflow: auto;
   visibility:visible;
 
}
.showhim:hover .showme
{
display :block;
}
</style>

 

Has anyone else had this problem?.... I also gutted my page and just put one simple html table and tried to render this landscape, and again it came back portrait.

 

Thanks in advance for any help on this!

I have the following MAP defined: CarrierMap<Id, String>

 

It contains the following:

1ax123abc,Banner Life

1ax123def,Banner Life

1ax123ghi,Prudential

 

All I want to do in my page is loop thru and when I find a match on i.payout__Carrier__c  versus the Id in my map, I want to display the keyvalue (i.e Banner Life)

 

<td  height="18px" width="5%" style="text-align:left">

                   <apex:repeat value="{!CarrierMap}" var="key" >

                      <apex:repeat value="{!CarrierMap[key]}" var="keyvalue" >

                        

                            <apex:outputText value="{!if(key == i.payout__Carrier__c,keyvalue ,'')}" >

                        

                      </apex:repeat>

                   </apex:repeat>

 </td>  

 

 

The value 'Banner Life' is not a valid number

Error is in expression '{!if(key == i.payout__Carrier__c,keyvalue,'')}' in component <apex:outputText> in page statements

 

It appears that the apex:outputText is ALWAYS expecting a numeric value, can I not use a STRING value to display inside a <apex:outputText> ?

 

Thanks this has been driving me INSANE!

Can anyone tell me where I can see the actual stylesheet values used for a standard SF pageblockTable?

 

I need to create a custom table and want to to look exactly like the standard SF blockTable.

 

Or is there a simple way to just set a style='The Standard SF Table Style' to a dataTable to make it look exacty like the standard SF table.

 

Thanks so much in advance.

-Jim

Hi, I need to perform some page break logic, and would like to be able to look at the NEXT row from within a repeat loop to determine if the value is about to change.

For the display logic I can't check AFTER the next row is read, I need to check the NEXT row's value while processing the CURRENT row.

 

So is there some way to access the relatedHoldings2[row + 1] while I am processing the current row in the loop?

 

Thanks!

 

 

<apex:repeat var="fa" value="{!relatedHoldings2}">  
Compare relatedHoldings2.val from row #2 with relatedHoldings2.val from current row
</apex>

 var="fa" value="{!relatedHoldings2}">

I need to total up a column in a <apex:pageBlockTable and display it at the bottom (I want it inside the pageBlockTable not out of it).

 

The code to create the Total is done, I just need to put the value inside the <apex:pageBlockTable at the bottom.

 

Is there a way while looping through the <apex:pageBlockTable to check for EOF condition. If there is, then I could use that to check in the RENDERED attribute and only

show the total column if EOF is true.

 

Thanks to all in advance!

-Jim

Hi all,

 

I am trying to compare two apex:variables (Current Prod Type and the previous prod type) and if they are different do a Subtotal line in a table:

 

 <apex:outputText value="{!if(!myProdTyp == !LastProdTyp,'','<tr><td>SUBTOTAL</td></tr>')} ">
  </apex:outputText>

 

Both LastProdTyp and myProdTyp are apex:variables.

 

I am getting an error message when I try the above syntax saying: Error: Incorrect parameter type for function 'not()'. Expected Boolean, received Text

 

Please advise. Thanks in advance!

-Jim

I have a requirement to create SUBTOTAL's for the  Market Value and Gain/Loss grouped by Product Type.: So the "Other" product type needs to have a SUBTOTAL line below it. My solution was to create a MAP(Product Type,Summed total)... And that works but my issue is in the display logic. How do I tell it to when to print the SUBTOTAL line?....

 

I basically need logic to say I have 'x' number of the same product types (x=2 for the 'Other' scenario) and to only print the SUBTOTAL for the LAST occurrence of 'Other'

 

Below is what the chart looks like. Thx to all! 

 

 

 

Account Type

Product TypeTax StatusHoldings
IRAMutual FundsQualified Account Name: FA-0090 - IRA12345
   
AssetAsset TypeSharesMarket ValueGain/Loss
Demo AssetFixed Income1000$101,250$8,250
American Skandia Growth IIGrowth100$8,000$500
Total:  $109,250$8,750
IRA Employer EstablishedOtherQualified Account Name: FA-0013 - ADV56789
   
AssetAsset TypeSharesMarket ValueGain/Loss
Flex Plus VIIFixed Income102.3$0$0
American Skandia Growth IIGrowth50$2,500$2,500
Total:  $2,500$2,500
JointOther  Account Name: FA-0015 - Glavey NEW
   
AssetAsset TypeSharesMarket ValueGain/Loss
Flex Plus VIIFixed Income1500$18,000$18,000
Total:  $18,000$18,000
401(k)Variable Annuities  Account Name: FA-0014 - PRU12345
   
AssetAsset TypeSharesMarket ValueGain/Loss
American Skandia Growth IIGrowth100$1,500$1,500
Total:  $1,500$1,500
   
Grand Total:  $131,250$32,25

 

 

I have the following test script:

 

@isTest

public class theBatchLoadTest{

 

    public static testMethod void testMyController() {

        

        BatchLoadDaily controller = new BatchLoadDaily('fm017104');

         Database.executeBatch(controller, 20);

 

        }

}

 

 

Which tests the following:

 

global class BatchLoadDaily implements Database.Batchable<sObject> {

  

  global final String bdId;

   

  global BatchLoadDaily(String bdId) {

    this.bdId = bdId;

     

  }

 

 

  global Database.QueryLocator start(Database.BatchableContext bc) {

     

return Database.getQueryLocator('SELECT payout__PrimaryKey__c, payout__Account_Desc__c, payout__Account_Opening__c, payout__Account_Type__c, payout__Albridge_ID__c, payout__Asset_Fund_Name__c, payout__Asset_Type__c, payout__BD_Id__c, payout__Cirrus_Source__c, CreatedById, CreatedDate, payout__CumDisc__c, payout__Cusip__c, payout__Dealer__c, payout__DealerBranch__c, IsDeleted, payout__Financial_Account_Number__c, payout__FirstName__c, payout__IRS_Code__c, Name, LastModifiedById, LastModifiedDate, payout__LastName__c, payout__Last_Price__c, payout__Last_Price_Update__c, payout__Market_Value__c, payout__MiddleName__c, payout__Num_Of_Shares__c, OwnerId, payout__Payout_Date__c, payout__PersonMailingCity__c, payout__PersonMailingStateProv__c, payout__PersonMailingStreet__c, payout__PersonMailingZip__c, payout__PersonOtherPhone__c, payout__Phone__c, payout__Plan_Status_Code__c, ConnectionReceivedId, Id, payout__Registration_Line_1__c, payout__Registration_Line_2__c, payout__Registration_Line_3__c, payout__Registration_Line_4__c, payout__SSN__c, payout__SSN_Financial_Account__c, ConnectionSentId, payout__Shares__c, payout__Sponsor_Name__c, payout__Symbol__c, SystemModstamp, payout__Systematic_Plan_Type__c, payout__Tax_Status__c, payout__UniqueId__c, payout__Valuation_Date__c, payout__RepId__c  FROM payout__ImportStaging__c where payout__BD_Id__c = \'' + String.escapeSingleQuotes(bdId) + '\' AND payout__Processed_Flag__c <> \' Y \'');

  }

 

  global void execute(Database.BatchableContext bc, List<payout__ImportStaging__c> scope) {

      

       

       System.Debug('Get in void execute');

 

}

 

But for some reason the global void execute code is NOT getting run (tested). Any ideas?.... The query does return rows to the getQueryLocator, but then the test stops and no more code is tested/covered.

 

Thanks so much for any help!

-Jim

The below string works:

mystr = 'SELECT payout__Account_Desc__c FROM payout__ImportStaging__c where payout__BD_Id__c = \'' + bdId + '\'');

 

I want to add the following to the string:

and payout__Processed_Flag__c <> 'Y'

 

but am having an issue with the single quotes around the Y when trying to get the escape syntax correct....

 

Can somone please give me the correct syntax and what the complete mystr would look like ?

 

Thanks in advance.

-Jim

 

 

I am not sure what the variable type declaration should be for my results variable, I thought it was UpsertResult but I am

getting an error "Invalid type UpsertResult"

 

try {
 
           UpsertResult results = Database.Upsert(acctToInsert,payout__SSN__c,false);
            if (results != null)
            {
                for (UpsertResult.SaveResult result : results)
                {
                    if (!result.isSuccess())
                    {
                        Database.Error[] errs = result.getErrors();
                        for(Database.Error err : errs)
                        System.debug(err.getStatusCode() + ' - ' + err.getMessage());
     
                    }
                }
            }    
 
            }
               catch (Exception e)
            {
               System.debug(e.getTypeName() + ' - ' + e.getCause() + ': ' + e.getMessage());
            }
      

Hi,

 

I am trying to execute the following Batch Apex Class from the Developers Console:

Id batjobId = Database.execute(new BatchLoadDaily('fm1000'),200);

 

 

 

Below is my Apex Class:

 

global class BatchLoadDaily implements Database.Batchable<sObject> {
  global final String bdId;
 
 
  global BatchLoadDaily(String bdId) {
    this.bdId = bdId;
    
  }
 
  global Database.QueryLocator start(Database.BatchableContext bc) {
    return Database.getQueryLocator('SELECT payout__Account_Desc__c, payout__Account_Opening__c, payout__Account_Type__c, payout__Albridge_ID__c, payout__Asset_Fund_Name__c, payout__Asset_Type__c, payout__BD_Id__c, payout__Cirrus_Source__c, CreatedById, CreatedDate, payout__CumDisc__c, payout__Cusip__c, payout__Dealer__c, payout__DealerBranch__c, IsDeleted, payout__Financial_Account_Number__c, payout__FirstName__c, payout__IRS_Code__c, Name, LastModifiedById, LastModifiedDate, payout__LastName__c, payout__Last_Price__c, payout__Last_Price_Update__c, payout__Market_Value__c, payout__MiddleName__c, payout__Num_Of_Shares__c, OwnerId, payout__Payout_Date__c, payout__PersonMailingCity__c, payout__PersonMailingStateProv__c, payout__PersonMailingStreet__c, payout__PersonMailingZip__c, payout__PersonOtherPhone__c, payout__Phone__c, payout__Plan_Status_Code__c, ConnectionReceivedId, Id, payout__Registration_Line_1__c, payout__Registration_Line_2__c, payout__Registration_Line_3__c, payout__Registration_Line_4__c, payout__SSN__c, payout__SSN_Financial_Account__c, ConnectionSentId, payout__Shares__c, payout__Sponsor_Name__c, payout__Symbol__c, SystemModstamp, payout__Systematic_Plan_Type__c, payout__Tax_Status__c, payout__UniqueId__c, payout__Valuation_Date__c  FROM payout__ImportStaging__c where payout__BD_Id__c = \'' + bdId + '\'');
  }
 
  global void execute(Database.BatchableContext bc, List<payout__ImportStaging__c> scope) {
   
       boolean upsertCertainFields;
       boolean noUpsertHldOrMVH;
       string recType;

 

I am getting an error saying it is an incorrect signature..... What am I doing wrong? Thanks to all.

I think the answer to this is “yes”  but are there any govonor limits to worry about if we are using Batch Apex?

 

If the answer is yes, then in my Staging object I have over 30K rows and I need to loop thru each row and do a SOQL query to find the corresponding object to update.

 

I know we aren’t supposed to do SOQL inside of loops so what is the “best practice” for NOT doing this, how else can I accomplish updating corresponding objects without using SOQL in a loop?

 

Thanks.

In my Account object I have id and refid that relates who referred a client

 

I need to display a referal list tree in a VisualForce page as follows: (Note I just need to display the Name the other fields are to show the relationships)

 

Name=Jim id = 99

     Name=MO, id=1, refid = 99

           Name=JA, id=2, refid=1

                Name=BA, id=3, refid=2

                Name=MA, id=4,refid=2

 

     Name=MB, id=5, refid=99

          Name=CB, id=6, refid=5

                SF id=7, refid =6

                      AA id=8, refid = 7

                 SB id=9, refid=6

 

So the start is Jim, and because of Jim, the following tree has been created based on who each person has referred.

 

Since SOQL doens't have a way of doing a CONNECT BY to bring back the data in the tree order, what are your suggestions for accomplishing this?

 

I assume we need a recursive loop approach but would love to see what you gurus come up with.

 

Thanks so much.

 

I know we are not allowed to have a subquery on the same object as our main query, so I am not sure how to write the following SOQL:

 

Select  payout__Households__c
from Account
where payout__Households__c  in

   (

  Select  payout__Households__c
   from Account
   where id = '001A000000Iw0nxIAB'

   )

 

Thanks in advance!

-Jim

I am new to Apex, and the testing has me a bit confused as to how to perform certain types of tests:

 

Below is my code, can some one help me see how to write a test for this as well as answer the questions below?

1. How to test a method that is defined as a PageReference? (i.e how to CALL it in a test method?)

2. When creating test data "on the fly" how long does the test data stay available (i.e If I create test data in the FIRST test method,  is the data gone right after that test completes or is that test data available to all the rest of the test methods I have defined. So Can I just add the test data ONCE, for ALL my tests or do I need to do it for EACH test method I have defined?

 

 

public PageReference processViewHousehold() {
 
        //Householdis is a PUBLIC variable contains list of id's
        if(householdid != null)
        {
            List<Account> HouseHold = new List<Account>(
            [
            Select id                    
            from account
            where payout__Households__c = :householdid
        
            ]
            );
        
        
           List<Id> myClientIdList = new List<id> ();
       
           for(Account a : HouseHold){
               myClientIdList.add(a.id);
           }       
   
           ClientIdList = myClientIdList;
        }
        
      
        return null;
    }

I have read a lot of things on the net saying this can be done but I have tried all the suggestions and can't get it to work. My page always ends up in portrait. Below is the stylesheet I am using. In addition to what I have here, I have also tried:

 

@page{size: a4 landscape}

@page(size: landscape}

 

 

<style>
th {white-space:nowrap;background-color:#000080;

 @page {
  size: 297mm 210mm;
}

odd {
background-color: #FCF7F7;
}
even {
background-color: #E3DCDB;
}

.showme
{
   position:static;
 
   display: none;
   overflow: auto;
   visibility:visible;
 
}
.showhim:hover .showme
{
display :block;
}
</style>

 

Has anyone else had this problem?.... I also gutted my page and just put one simple html table and tried to render this landscape, and again it came back portrait.

 

Thanks in advance for any help on this!

I have the following MAP defined: CarrierMap<Id, String>

 

It contains the following:

1ax123abc,Banner Life

1ax123def,Banner Life

1ax123ghi,Prudential

 

All I want to do in my page is loop thru and when I find a match on i.payout__Carrier__c  versus the Id in my map, I want to display the keyvalue (i.e Banner Life)

 

<td  height="18px" width="5%" style="text-align:left">

                   <apex:repeat value="{!CarrierMap}" var="key" >

                      <apex:repeat value="{!CarrierMap[key]}" var="keyvalue" >

                        

                            <apex:outputText value="{!if(key == i.payout__Carrier__c,keyvalue ,'')}" >

                        

                      </apex:repeat>

                   </apex:repeat>

 </td>  

 

 

The value 'Banner Life' is not a valid number

Error is in expression '{!if(key == i.payout__Carrier__c,keyvalue,'')}' in component <apex:outputText> in page statements

 

It appears that the apex:outputText is ALWAYS expecting a numeric value, can I not use a STRING value to display inside a <apex:outputText> ?

 

Thanks this has been driving me INSANE!

Hi, I need to perform some page break logic, and would like to be able to look at the NEXT row from within a repeat loop to determine if the value is about to change.

For the display logic I can't check AFTER the next row is read, I need to check the NEXT row's value while processing the CURRENT row.

 

So is there some way to access the relatedHoldings2[row + 1] while I am processing the current row in the loop?

 

Thanks!

 

 

<apex:repeat var="fa" value="{!relatedHoldings2}">  
Compare relatedHoldings2.val from row #2 with relatedHoldings2.val from current row
</apex>

 var="fa" value="{!relatedHoldings2}">

I need to total up a column in a <apex:pageBlockTable and display it at the bottom (I want it inside the pageBlockTable not out of it).

 

The code to create the Total is done, I just need to put the value inside the <apex:pageBlockTable at the bottom.

 

Is there a way while looping through the <apex:pageBlockTable to check for EOF condition. If there is, then I could use that to check in the RENDERED attribute and only

show the total column if EOF is true.

 

Thanks to all in advance!

-Jim

Hi all,

 

I am trying to compare two apex:variables (Current Prod Type and the previous prod type) and if they are different do a Subtotal line in a table:

 

 <apex:outputText value="{!if(!myProdTyp == !LastProdTyp,'','<tr><td>SUBTOTAL</td></tr>')} ">
  </apex:outputText>

 

Both LastProdTyp and myProdTyp are apex:variables.

 

I am getting an error message when I try the above syntax saying: Error: Incorrect parameter type for function 'not()'. Expected Boolean, received Text

 

Please advise. Thanks in advance!

-Jim

I have 2 custom objects related by a related list definition (called Holdings):

1. financial_acct__c

2.Holding__c

 

I need to display in the follwoing format in a VisualForce Page: (The tables are related by AccountId)

 

financial acct: XXX

      Holding1

      Holding2

 

financial acct: YYY

      Holding3

      Holding4

 

Once way I tried was to pass the finacial account id into a method getRelated() which would bring back a list of the related holdings. But when I tried to pass the

Account Id by using a <apex param> it was null when I debugged it in the method. I had declared the param variable as Public String myKey(get{}:,set{}}

 

When I debugged it in the class, it said myKey was null. When you do the "assignto=myKey"  in the <apex:param tag, doesn't that put the value in the variable?

 

 

 

 

 

Can you please help me out, I have been trying everything!