• bdstang
  • NEWBIE
  • 50 Points
  • Member since 2009

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

Developed post install script -- no problem.

However, when I try to add a test script (see below), I get "Method does not exist or incorrect signature: System.Test.testInstall". The testInstall method does not show up in the list of methods available for the Test class in Eclipse IDE, and editing/saving the test class directly in the Salesforce UI results in the same error.

Please advise.

 

@isTest
static void testInstallScript() {
PostInstallClass postinstall = new PostInstallClass();
System.Test.testInstall(postinstall, null);
System.Test.testInstall(postinstall, new Version(1,0), true);
List<Account> a = [Select id, name from Account where name ='Newco'];
System.assertEquals(a.size(), 1, 'Account not found');
}

I have two <div>s. I know I can use page-break-after on the first <div> to force a page break, but I don't want to force a break. I only want to break after the first <div> if the second <div> won't fit on the same printed page as the first <div>.

I want 0 widows from the first <div> to show up on the next page where the second <div> starts.

 

So, if I use

.break{page-break-inside:avoid;}

as expected, I get a page break between the first <div> and the second <div>, and I get 2 "widows" on the next page, which I would expect because 2 widows is the default.

 

However, so that I don't get any "widows" I try to use

 

.break{page-break-inside:avoid; widows:0;}

 

However, when I do that, the page break does not occur at all. I've tried setting children:0; widows:0; and various combinations of both, but don't seem to be able to get things to work correctly.

 

Any help would be appreciated.

I've created Tabs for some custom objects that are included in a Package and would like to add the Tabs to a Package. However, when I go to Add To Package, select the Component Type: Tab, the new Tabs do not show up. The filter on the Add To Package page is set to All

Any Ideas?

I have a single user who receives the following error "...not a valid child relationship name for entity Account".

Normally when I have received this error, it is because a particular VF page is not  enabled for a particular Profile, or a package is not Deployed.  However, the odd thing in this case is that this error is only happening to a single user who has the same Profile as a number of other users of the same Profile who are not getting the error.  Also, when I create a new account for this user, using the same Profile as his old account, the new account works just fine.  What am I missing?

Your help in understanding and resolving this issue would be appreciated.

I'm having a heck of a time getting code coverage on the if statements in this snippet of code from my controller.  Any help would be appreciated.

 

public AssessmentPlanController(ApexPages.StandardController controller)
{      ea=(Assessment_Plan__c)Controller.getRecord();
this.controller=Controller;

Task[] tsks = [Select t.WhoId, t.WhatId, t.Subject, t.OwnerId, t.Owner.Name, t.who.Name,t.ReminderDateTime, t.Id, t.Description, t.ActivityDate, t.AccountIdFrom Task t WHERE t.WhatId=:ea.id];
integer x = tsks.size();
if (x>0)
{
  for (Task t : tsks)
  {
    if(t.Subject=='AP: Academic / Pre-Academic ' + ea.student__r.name)
      {Task01Id=t.Id;
          if(t.who.name!=null)
            {Task01AssignedTo=t.who.name;} else
            {Task01AssignedTo=t.Owner.Name;}
       Task01Date=t.ActivityDate;}
    else if(t.Subject=='AP: Transition / Vocational ' + ea.student__r.name)  
      {Task02Id=t.Id;
          if(t.who.name!=null)
            {Task02AssignedTo=t.who.name;} else
            {Task02AssignedTo=t.Owner.Name;}
       Task02Date=t.ActivityDate;}

 

 

 

 

  • September 14, 2010
  • Like
  • 0

Does anyone know how to refer to custom object permissions in user profiles?

 

{$Profile.Name} will get me the name in a visualforce page, and I can see query some of the attributes of a user profile in SOQL like

 

Select p.PermissionsAuthorApex, p.PermissionsApiEnabled, p.Name From Profile p

 

but i can't find any of the Custom Object Permissions or Standard Object Permissions for that matter.

 

Any help would be appreciated.

I'm Trying to use the Rich Text field.  My intention is to replace an exising Long Text field.  The new field displays on my VF page, but when I enter data in it & use the standard controller !save, the information that I entered in the field is not saved.  The !save is not the problem as with the standard Long Text field things save just fine. 

 

Additionally, I have 3 events attached to the field that work fine with the standard Long Text field but does not with Rich Text version of the field.

 

Here is my VF Code:

 

 

<td ><apex:InputField id="AcademicAchievementRichText" value="{!I4__c.AcademicAchievementText__c}" style="width: 99%; height: 500px" onfocus="CharRemaining.style.visibility='visible';
                                      maxLngth = 3500;
                                      elmnt = '{!$Component.AcademicAchievementText}';
                                      charRemain(elmnt , maxLngth );"   
                             onblur="CharRemaining.style.visibility='hidden';"
                             onkeyup="charRemain(elmnt , maxLngth );">
                        </apex:InputField></td>

 Any help would be greatly appreciated.

 

 

I've created a custom controller that allows me to provide saving, cancelling, viewing PDF, and return URL navigation -- code below.  Works great, but it is specific to a single custom object, meaning that if I have pages bound to different custom objects, the way I have it structured, I have to have a custom controller for each custom oject. 

 

Is there a way to create a custom controller similar to the functionality mine is providing, but be able to reference it regardless of the custom object bound to the VF page?

 

Any help/thoughts woul be appreciated.

 

 

public class eaSaveReturn {E_A_Eligibility_Autism__c ea; public ApexPages.StandardController controller; public string retURL{get; set;} public eaSaveReturn(ApexPages.StandardController controller) { ea=(E_A_Eligibility_Autism__c)Controller.getRecord(); } public PageReference savereturn() { {upsert ea;} PageReference contactPage= new PageReference('/'+ApexPages.currentPage().getParameters().get('retURL')); return contactPage; } public PageReference cancelOnly() { PageReference contactPage= new PageReference('/'+ApexPages.currentPage().getParameters().get('retURL')); return contactPage; } public PageReference saveOnly() { {upsert ea;} PageReference contactPage= ApexPages.currentPage(); return contactPage; } public PageReference PDF() { {upsert ea;} PageReference contactPage= new PageReference('/apex/E_A_Eligibility_Autism_PDF?id='+ ApexPages.currentPage().getParameters().get('id')); return contactPage; } }

 

 

 

 

 

Hi

 

How can I right-align my header items in a datatable (as in the code below)

 

       <apex:dataTable value="{!opportunity.opportunitylineitems}" var="line" rowClasses="odd,even"
                columnsWidth="550px, 60px, 100px, 100px, 100px">
                   <td><apex:column width="390px" ><apex:facet name="header">Description</apex:facet><apex:outputField value="{!line.PricebookEntry.name}"/></apex:column>
		           <td><apex:column style="text-align:right" width="60px"><apex:facet name="header" >Quantity</apex:facet> <apex:outputField value="{!line.Quantity}"/></apex:column></td>
		            <apex:column style="text-align:right" width="100px"> <apex:facet name="header" >Initial Fee</apex:facet><apex:outputText value="{0,number,R #,###.00}"> <apex:param value="{!line.UnitPrice}" /> </apex:outputText></apex:column> 
		            <apex:column style="text-align:right" width="100px"> <apex:facet name="header" >Est. Annual Fee</apex:facet><apex:outputText value="{0,number,R #,###.00}"> <apex:param value="{!line.UnitPrice}" /> </apex:outputText></apex:column> 
		            <apex:column style="text-align:right" width="100px" ><apex:facet name="header" >Total Price</apex:facet> <apex:outputText value="{0,number,R #,###.00}"> <apex:param value="{!line.TotalPrice}" /> </apex:outputText></apex:column> 
		        </apex:datatable>

 Many thanks

Ross

 

 

 

 

  • March 27, 2012
  • Like
  • 0

I've created Tabs for some custom objects that are included in a Package and would like to add the Tabs to a Package. However, when I go to Add To Package, select the Component Type: Tab, the new Tabs do not show up. The filter on the Add To Package page is set to All

Any Ideas?

I have a single user who receives the following error "...not a valid child relationship name for entity Account".

Normally when I have received this error, it is because a particular VF page is not  enabled for a particular Profile, or a package is not Deployed.  However, the odd thing in this case is that this error is only happening to a single user who has the same Profile as a number of other users of the same Profile who are not getting the error.  Also, when I create a new account for this user, using the same Profile as his old account, the new account works just fine.  What am I missing?

Your help in understanding and resolving this issue would be appreciated.

I'm having a heck of a time getting code coverage on the if statements in this snippet of code from my controller.  Any help would be appreciated.

 

public AssessmentPlanController(ApexPages.StandardController controller)
{      ea=(Assessment_Plan__c)Controller.getRecord();
this.controller=Controller;

Task[] tsks = [Select t.WhoId, t.WhatId, t.Subject, t.OwnerId, t.Owner.Name, t.who.Name,t.ReminderDateTime, t.Id, t.Description, t.ActivityDate, t.AccountIdFrom Task t WHERE t.WhatId=:ea.id];
integer x = tsks.size();
if (x>0)
{
  for (Task t : tsks)
  {
    if(t.Subject=='AP: Academic / Pre-Academic ' + ea.student__r.name)
      {Task01Id=t.Id;
          if(t.who.name!=null)
            {Task01AssignedTo=t.who.name;} else
            {Task01AssignedTo=t.Owner.Name;}
       Task01Date=t.ActivityDate;}
    else if(t.Subject=='AP: Transition / Vocational ' + ea.student__r.name)  
      {Task02Id=t.Id;
          if(t.who.name!=null)
            {Task02AssignedTo=t.who.name;} else
            {Task02AssignedTo=t.Owner.Name;}
       Task02Date=t.ActivityDate;}

 

 

 

 

  • September 14, 2010
  • Like
  • 0

I have a managed package that had 2 triggers on the same object.  There were fired on completely different operations by the CheckMarx scan kept saying that multiple triggers on the same object is a bad thing so as part of a maintenance release I decided to consolidate the two existing triggers into a single new trigger.  I was able to delete the old triggers from my org and build a new version of the package (beta build at the moment) that only contained a the new single trigger.  Install into a clean environment and the one and only trigger is installed and everything works great. 

 

So far, so good.  However, when I install the new version into an org with the old version it does not remove the old triggers.  Now I have 3 triggers instead of 2 and if all are firing then I am doing everything twice.  All 3 are listed as Active but I can't tell if all 3 are firing.

 

Anyone have a clue as to why if I was able to remove the triggers from my org/package the upgrade install will not remove the old triggers? 

 

Thanks,

 

Bob

  • August 24, 2010
  • Like
  • 0

Has anyone else tried to disable a rich text area using the apex:inputTextArea tag?

 

 

<apex:inputTextarea richText="true" disabled="true" />

Thanks!

 

I'm Trying to use the Rich Text field.  My intention is to replace an exising Long Text field.  The new field displays on my VF page, but when I enter data in it & use the standard controller !save, the information that I entered in the field is not saved.  The !save is not the problem as with the standard Long Text field things save just fine. 

 

Additionally, I have 3 events attached to the field that work fine with the standard Long Text field but does not with Rich Text version of the field.

 

Here is my VF Code:

 

 

<td ><apex:InputField id="AcademicAchievementRichText" value="{!I4__c.AcademicAchievementText__c}" style="width: 99%; height: 500px" onfocus="CharRemaining.style.visibility='visible';
                                      maxLngth = 3500;
                                      elmnt = '{!$Component.AcademicAchievementText}';
                                      charRemain(elmnt , maxLngth );"   
                             onblur="CharRemaining.style.visibility='hidden';"
                             onkeyup="charRemain(elmnt , maxLngth );">
                        </apex:InputField></td>

 Any help would be greatly appreciated.