• nyhansa
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 13
    Replies

I am getting an error on one of the system assertEquals in my test class, however when I check the debug log the assert appears to have passed. I've included the code snippets from my controller class, test class, and the debug log.

 

Test Class Lines:

String testDebugSoqll = crc.debugSoqll;
System.assertEquals('select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false order by lastname asc limit 20', testDebugSoqll);

 

Controller Lines:

//some other code here

public String sortDirl {
get { if (sortDirl == null) { sortDirl = 'asc'; } return sortDirl; }
set;
}

// the current lead field to sort by - defaults to last name
public String sortFieldl {
get { if (sortFieldl == null) { sortFieldl = 'lastName'; } return sortFieldl; }
set;
}

public String debugSoqll {

get { return soqll + ' order by ' + sortFieldl + ' ' + sortDirl + ' limit 20'; }
set;
}

public CrossReferenceController() {
soqll = 'select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false';

//code continues

 

Debug Log Exception Details:

12:19:19.444 (6444732000)|EXCEPTION_THROWN|[56]|System.AssertException: Assertion Failed:

Expected: select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false order by lastname asc limit 20,
Actual: select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false order by lastName asc limit 20

 

I would greatly appreciate any help. I cannot figure out why the assertion is failing since from what I see, they seem to be exactly the same. Let me know if you need me to post the entire controller class, test class, and visualforce page.

 

Thank you!

 

Sam

Hello,

 

I'm having a huge problem with writing/editing Apex. Using the Force.com IDE, I am unable to create new projects, create new triggers or classes, or edit new triggers or classes. When I attempt to do so, I get the following error message:

Save error: Unable to perform save on all files: No match found

 

I then tried to use the Developer Console instead. While I was able to open and edit existing triggers and classes, I was never able to save the changes.

 

Can someone please help me out? I am completely unable to update any existing Apex code and to create new Apex code.

 

Thank you!

 

Sam

I'm creating a custom Visualforce page to override the standard page layout of a custom object, however I'm having an issue when it comes to adding a clone button to the Visualforce page. On the standard page layout for this custom object, I'm able to view and use the Clone button. For some reason, when I try to add the same Clone button to the Visualforce page, I get the following error:

 

Error: action="{!clone}": Unknown method 'O__cStandardController.clone()'

 

Am I doing something wrong? I checked the metadata for my custom object, and there is a clone action in the metadata. It seems silly to me that even though it's there on the standard page layout, I can't access it when creating a Visualforce page so I'm guessing I'm calling the action incorrectly.

 

I'd really appreciate any help! I have only the most basic knowledge of creating extensions, so I'd rather avoid doing so if I can.

 

Thank you!

I've had to create a Visualforce Edit page for all Accounts. The Visualforce page has fields that render according to record type (i.e. render if Account is Person Account), this works fine when the Account already exists in Salesforce. When I go to create a new Person Account, Business Account fields, not Person Account fields, render on the Create New Edit page. Is this because the record has not yet been created in Salesforce? Is there any way to work around this issue? I figured it would work since before creating the record, I've already chosen the record type I'd like to be created. Do I need to create yet another custom Edit page to create a new Account? If so, how do I get the fields to render properly so I don't have users wondering why unecessary fields appear on the Create New page? Please let me know if you need more information from me.

I have created a Visualforce page and added it to a section on our Person Account detail page. Even though I added the inlineEditSupport tags to the Visualforce page, I am not able to inline edit the standard detail or custom Visualforce sections of the page. Is the issue due to the way I'm using the Visualforce page? The page allows my users to select which address(es) they would like to view on the Person Account detail so I'd like to give my users the option to inline edit the field which controls the rendering of the fields, as well as allow them to continue to inline edit any of the fields they originally were able to inline edit. Any help would be much appreciated since having our users edit the entire detail just to view a different address is not very helpful to them, it just creates a lot more work. If inline editing is not possible in this case, is there a workaround? Please let me know if you need more information from me to answer my question. Thank you!

I am getting an error on one of the system assertEquals in my test class, however when I check the debug log the assert appears to have passed. I've included the code snippets from my controller class, test class, and the debug log.

 

Test Class Lines:

String testDebugSoqll = crc.debugSoqll;
System.assertEquals('select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false order by lastname asc limit 20', testDebugSoqll);

 

Controller Lines:

//some other code here

public String sortDirl {
get { if (sortDirl == null) { sortDirl = 'asc'; } return sortDirl; }
set;
}

// the current lead field to sort by - defaults to last name
public String sortFieldl {
get { if (sortFieldl == null) { sortFieldl = 'lastName'; } return sortFieldl; }
set;
}

public String debugSoqll {

get { return soqll + ' order by ' + sortFieldl + ' ' + sortDirl + ' limit 20'; }
set;
}

public CrossReferenceController() {
soqll = 'select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false';

//code continues

 

Debug Log Exception Details:

12:19:19.444 (6444732000)|EXCEPTION_THROWN|[56]|System.AssertException: Assertion Failed:

Expected: select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false order by lastname asc limit 20,
Actual: select firstname, lastname, employer__c, state, owner.name from lead where isconverted = false order by lastName asc limit 20

 

I would greatly appreciate any help. I cannot figure out why the assertion is failing since from what I see, they seem to be exactly the same. Let me know if you need me to post the entire controller class, test class, and visualforce page.

 

Thank you!

 

Sam

I'm creating a custom Visualforce page to override the standard page layout of a custom object, however I'm having an issue when it comes to adding a clone button to the Visualforce page. On the standard page layout for this custom object, I'm able to view and use the Clone button. For some reason, when I try to add the same Clone button to the Visualforce page, I get the following error:

 

Error: action="{!clone}": Unknown method 'O__cStandardController.clone()'

 

Am I doing something wrong? I checked the metadata for my custom object, and there is a clone action in the metadata. It seems silly to me that even though it's there on the standard page layout, I can't access it when creating a Visualforce page so I'm guessing I'm calling the action incorrectly.

 

I'd really appreciate any help! I have only the most basic knowledge of creating extensions, so I'd rather avoid doing so if I can.

 

Thank you!

I've had to create a Visualforce Edit page for all Accounts. The Visualforce page has fields that render according to record type (i.e. render if Account is Person Account), this works fine when the Account already exists in Salesforce. When I go to create a new Person Account, Business Account fields, not Person Account fields, render on the Create New Edit page. Is this because the record has not yet been created in Salesforce? Is there any way to work around this issue? I figured it would work since before creating the record, I've already chosen the record type I'd like to be created. Do I need to create yet another custom Edit page to create a new Account? If so, how do I get the fields to render properly so I don't have users wondering why unecessary fields appear on the Create New page? Please let me know if you need more information from me.

I have created a Visualforce page and added it to a section on our Person Account detail page. Even though I added the inlineEditSupport tags to the Visualforce page, I am not able to inline edit the standard detail or custom Visualforce sections of the page. Is the issue due to the way I'm using the Visualforce page? The page allows my users to select which address(es) they would like to view on the Person Account detail so I'd like to give my users the option to inline edit the field which controls the rendering of the fields, as well as allow them to continue to inline edit any of the fields they originally were able to inline edit. Any help would be much appreciated since having our users edit the entire detail just to view a different address is not very helpful to them, it just creates a lot more work. If inline editing is not possible in this case, is there a workaround? Please let me know if you need more information from me to answer my question. Thank you!

Hi All,

 

I'm a fairly confident Admin of my SFDC Org, with regards standard functionality, but completely new to coding, APEX and Visualforce (having made only a couple of very simple VF Pages, and no Custom Triggers).

 

However, I have recently put together a new Custom Object, which allows our users to create Deals (very much like the standard Opportunities object - but we needed a Custom version - don't ask...).

 

We need to tweak this slightly - so that it works a bit like this:

 

- User selects the "Deals" tab from within SFDC Org

 

- They press the standard "New" button, to create a new deal

 

- They then have to choose one of two Record Types ("Cameras" or "Other")

 

- If they choose Other - then it opens a standard Page Layout, with the Custom Fields created in relation to the Custom Object, which allows them to save a record using the standard "Save" button - all completely standard and generic, no problem.

 

- If they choose Cameras - then I need something a bit different to happen; firstly, I will still need a very similar standard Page Layout to the "Other" option as above, but with a few different fields, but instead of having the normal "Save" button at the bottom of the page, I want this page to be step 1 of 3, and there to be a button called "Next" at the bottom.

 

- Once they've hit "Next", it takes them to a booking form (another page layout), which allows the user to select from a range of DEMO equipment, which they wish to order. Once they've entered the details of the equipment they want, there is another "Next" button to get to step 3.  However, as this DEMO equipment is optional, I also want a button available which says "Skip This Step" - which takes them to Step 3 without completing a Booking Form.

 

- Step 3 will then just be a "Save" button to complete the process.

 

I am absolutely fine with doing everything up to the "Steps" process of the Cameras record type option - which is where I have no idea if that is possible.

 

Also - just to add ALL the information, if someone does choose Cameras and fills in a DEMO equipment booking form in Step 2 - I would like a Workflow to email the details of that record to another user - who will then process the DEMO equipment order.

 

Can anyone let me know if this is possible at all, and if so point me in the direction of where I can get help (and perhaps what the technical name for this process type thing I am trying to achieve is called, so I can do some more research) - I have tried a number of search terms, but have not yet found what I need...

 

Thank you very much indeed (and please let me know if I can provide any further details to help!).

 

Thanks again,

 

Andy

Hi everyone,

 

Sorry if this is a stupid question but here goes. I have a visualforce page that displays a custom table of child objects related to Opportunities and one of the columns is an outputLink to the child object page. The link is based on a lookup field. My page is imbedded in a section of a standard page layout. My problem is that when I click the link, the page I want to redirect to displays in the section in the Opportunity page instead of the full window. 

 

Here is my VF code (unnecessary stuff removed):

 

<apex:page standardController="Opportunity" extensions="AllocateBudgetextension" id="opportunity" showHeader="false" sidebar="false" standardStylesheets="true">
<apex:form >
<apex:pageBlock id="block" mode="maindetail">
<apex:pageBlockSection columns="1">
<apex:outputPanel id="table">

<apex:pageBlockTable value="{!CampaignListDummys}" var="dummy" rendered="{!(CampaignListDummys.size != 0)}" style="margin-bottom:5px">
<apex:column headerValue="Action" width="50px">
<apex:commandLink action="{!removeCampaign}" reRender="table">
<apex:param name="cid" value="{!dummy.budgets.Id}" assignTo="{!dcbid}"/>Remove
</apex:commandLink>
</apex:column>
<apex:column headerValue="Allocation" width="110px">
<apex:outputField value="{!dummy.budgets.Budget__c}" rendered="{!NOT(editmode)}"/>
<apex:inputField value="{!dummy.budgets.Budget__c}" rendered="{!editmode}" style="height:11px;margin:-1px;width:100px"/>
</apex:column>
<apex:column headerValue="Campaign" id="campaign">
<apex:outputField value="{!dummy.budgets.Advertiser_Campaign__c}" rendered="{!NOT(editmode)}"/>
<apex:selectList value="{!dummy.budgets.Advertiser_Campaign__c}" size="1" rendered="{!editmode}" style="font-size:8px;margin:-1px">
<apex:selectOptions value="{!CampaignOptions}"/>
</apex:selectList>
</apex:column>
<apex:column headerValue="Inventory Type" width="101px">
<apex:outputText value="{!dummy.campaigns.Inventory_Type__c}" rendered="true"/>
</apex:column>
</apex:pageBlockTable>
<apex:outputPanel>
<apex:commandLink value="Allocate" action="{!newCampaignBudget}" reRender="table"/>
</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

  

 

I hope this makes sense. Any ideas?

  • January 08, 2012
  • Like
  • 0

I have been tasked with creating a lead management system that will update the lead status at certain Last Activity Date intervals. While the workflow rule I created did allow me to update the lead status upon Last Activity Date changes, I am unable to manually change the lead status. Also, is there any way to get the rule or trigger to fire without manually updating each lead in our database? We would like this to run in the background to create less work for our sales reps and marketing team.

 

Ultimately, I need a workflow rule or trigger that will do the following:

 

If Last Activity Date is within the last 120 days, the status should be Active unless the salesperson has manually changed the status. The Last Activity Date should not include mass emails.

If Last Activity Date took place between 120 and 180 days, the status should be Paused unless the salesperson has manually changed the status. The Last Activity Date should not include mass emails.

If Last Activity Date is over 180 days ago, the status should be lapsed unless the salesperson has manually changed the status. The Last Activity Date should not include mass emails.

 

I've included my workflow rules below. Unfortunately they worked like a sledgehammer and I was unable to manually update the lead status. Also, I could not figure out how to exclude mass emails from the last activity date.

 

Workflow Rule 1: ActiveLeadStatusUpdate

Evaluate when a record is created, or when a record is edited and did not previously meet the rule criteria.

Rule Criteria: AND((( TODAY() - LastActivityDate ) <= 120), OR( ISPICKVAL( Status , "Not right now"), ISPICKVAL(Status, "Not in market")))

Field Update: Field to Update = Lead Status, New Field Value = Active

 

Workflow Rule 2: Reminder/PausedLeadStatusUpdate

Evaluate when a record is created, or when a record is edited and did not previously meet the rule criteria.

Rule Criteria: AND(OR(( TODAY() - LastActivityDate ) > 120,(TODAY()-LastActivityDate) < 180),OR( ISPICKVAL( Status , "Not right now"), ISPICKVAL(Status, "Not in market")))

Field Update: Field to Update = Lead Status, New Field Value = Reminder/Paused

 

Workflow Rule 3: LapsedLeadStatusUpdate

Evaluate when a record is created, or when a record is edited and did not previously meet the rule criteria.

Rule Criteria: AND((( TODAY() - LastActivityDate ) => 180), OR( ISPICKVAL( Status , "Not right now"), ISPICKVAL(Status, "Not in market")))

Field Update: Field to Update = Lead Status, New Field Value = Lapsed

 

As you can probably tell, I'm pretty new to workflow rules, apex triggers, and developing as a whole. Any guidance will be greatly appreciated.

 

Thank you!

 

I'm extremely new in attempting to use AJAX and Javascript and am having quite a bit of trouble creating a button that will allow for the conversion of a business account to a person account. I found some code on the developer board got an error after copying and pasting the original script. Since then, I have continued to modify the code but am still getting error messages that vary depending on the browser I'm using.

 

If I'm using Firefox and click the new button, I get the following error message:

 

"A problem with the OnClick JavaScript for this button or link was encountered:

Account is not defined"

 

However, if I'm using Internet Explorer, I get a different error message:

 

"A problem with the OnClick JavaScript for this button or link was encountered:

 

Syntax error"

 

I'm not sure why I'm getting a different error message from the different browsers and I cannot figure out where I went wrong in the code. If someone could please help me out I'd really appreciate it as I've been working on this for the past 3 days and have gotten nowhere. The script I am trying to use can be found below:

 

<script src="/soap/ajax/22.0/connection.js" type="text/javascript"></script>
var ready = true;
if(ready && confirm("Are you sure you want to convert this Account and Contact to a single Person Account? This is NOT reversible.")) {
var account = new sforce.SObject('Account');
Account.Id = "{!Account.Id}";
Account.RecordTypeId = "012A00000004E7C";
result = sforce.connection.update([Account]);
alert(result);
location.reload(true);
}

Summary: I've created a button that is displayed on a custom object. When clicked, I want this button to redirect the user to a Visualforce page with some parameters being passed from the current record. Here's the applicable section of code from the Button, VF Page, and Controller:

 

Button (This code is taking the value of the current records Week Start Date and Position and passing it into variables on the visualforce page):

 

 

/apex/scheduleview?BegDate={!Shift__c.Week_Start_Date__c}&Positions={!Shift__c.Position__c}

 

Visualforce Code:

Normally 'BegDate' and 'Positions' are generated from user input. BegDate is a text field (that receives dates: MM/DD/YYYY) and Positions is a drop down box that matches the position field on each Shift Object.

 

 

 

    <strong>Please enter the first day of the schedule you would like to see (mm/dd/yyyy):</strong> <apex:inputText value="{!BegDate}"/>
    <apex:selectList value="{!Positions}" Size="1">
        <apex:selectOptions value="{!items}"/>
        <apex:actionSupport event="onchange"></apex:actionSupport>
    </apex:selectList><p/>

 

 

Here is the controller code for handling this input:

 

 

    public String getPositions() {
        return Positions;
    }
    
    public void setPositions(String Positions) {
        this.Positions = Positions;
    }

    //Initializes and provides a get method for the user inputted date
    String BegDate;
    public String getBegDate (){
        return BegDate;
    }

     public void setBegDate (string BegDate) {
         this.BegDate = BegDate;
     }

 

 

Then of course these variables are used throughout the controller - but this is how they are brought in and initialized. What I'd like is for the current records values to be passed to the page when clicking the button - but I want the user to maintain the ability to also go to the visualforce page and enter their own input. This page is used to view and edit our schedule.

 

Any help would be greatly apprecaited - I read and attempted it quite a bit, but I've reset my code back to this default because it wasn't working.

 

 

 

 

 

 

 

Hi

Am very new Apex code development using IDE. Am able to save the files locally. But Unable to save the files to the server.  Showing an error: 

 

 

- File only saved locally, not to server
- Save error: Unable to perform save on all files: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be 
cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

- File only saved locally, not to server

- Save error: Unable to perform save on all files: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be  cast to com.sun.xml.bind.v2.runtime.reflect.Accessor

 

All the credentials i have entered are correct. 

 

Please help...

 

Thanks in advance,

VNath