• sandersen
  • NEWBIE
  • 49 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 40
    Replies

Hello, I'm doing some intergartion work through the salesforce api and I recently got the following warning.

 

Operation: insert.npe03__Recurring_Donation__c

By user/organization: 00580000001snmg/00D80000000cnJ5

Caused the following Apex resource warnings:

npe03:Number of DML rows: 128 out of 200

 

I'm not really sure what this means as I know I'm not doing 128 inserts at once.

 

Does the 200 limit apply to a certain timespan?

 

Any help is appreciated. 

 

Thanks,

Phillip

  • September 09, 2009
  • Like
  • 0

Hi there,

 

we are a small charity which has been given the NonProfit Starter pack (Thanks Salesforce) which is the equivalent of the Enterprise Edition. We are very interested in making use of the Sites functionality but it is not accessable in our installation. 

 

My question is, how and when will we be able to make use of Sites. I'm very new to Salesforce so I may well be missing something very obvious.

 

Many thanks,

 

Liam

  • June 30, 2009
  • Like
  • 0

 

I have two problems with the following visualforce email template:
1. Outlook doesn't handle footers in tables, so the total floats to just below the header. Is there anyway around this?
2. The outputfield in the last column of the footer doesn't render at all. If I change it to a naked reference ({!relatedTo.New_Proposal_Amount__c}) it displays but doesn't format well
Any ideas?
<messaging:emailTemplate subject="test" recipientType="Contact" relatedToType="Proposal__c"> 
<messaging:htmlEmailBody > 
              <div>  
                 <apex:datatable width="600" border="1" var="pli" value="{!relatedTo.Proposal_Lines__r}"> 
                    <apex:column > 
                        <apex:facet name="header" ><strong>Product</strong></apex:facet> 
                        
                        <apex:facet name="footer"><strong>Total</strong></apex:facet> 
                        <apex:outputfield value="{!pli.Product_Name__c}"/> 
                     </apex:column> 
                    <apex:column >
                        <apex:facet name="header"><strong>Quantity</strong></apex:facet> 
                        
                        <apex:facet name="footer"></apex:facet> 
                        <apex:outputfield value="{!pli.Quantity__c}"/>
                    </apex:column> 
                    <apex:column > 
                        <apex:facet name="header"><strong>Amount</strong></apex:facet> 
                        
                        <apex:facet name="footer"><strong><apex:outputField value="{!relatedTo.New_Proposal_Amount__c}"</strong></apex:facet>
                        <apex:outputField value="{!pli.Proposal_Line_Total_Price__c}"/>
                    </apex:column> 
                </apex:datatable> 
</div>
</messaging:htmlEmailBody> 
</messaging:emailTemplate>

 

 

I have a managed package with Account and Opp queries in it. My tests work fine.

 

In one org the package installs and works fine in a recent sandbox, but in production it's getting this error:

 

System.UnexpectedException: Internal Salesforce.com Query Error

 

There is no line number associated with the error.

 

Any ideas?

 

 

Thanks,

 

Steve

 

When I put this line of code in a class, I get an invalid type error:

List<EntitySubscription> newSubscriptions = new List<EntitySubscription> ();

 

But when I have the same line in a Trigger, I don't get the error:
 

trigger chatterFollow on User (after insert) {

if( Trigger.isAfter && Trigger.isInsert ){

List<EntitySubscription> newSubscriptions = new List<EntitySubscription> ();

etc. 

 

Any ideas? 

 

I have a simple search box that runs a method and rerenders part of the page. I want the User to hit enter in this box and have the search happen correctly. My method is running when the User hits enter, but the search always turns up zero results. If the User hits the Search button, the search runs correctly.

 

 

<apex:form >

<apex:inputText value="{!searchText}" id="searchText"/>

<apex:commandButton action="{!search}" rerender="searchresults,selectedContacts,winnerpanel" value="Search" status="searchStatus"/>

<apex:actionStatus startText="(searching...)" id="searchStatus"/>

</apex:form>

 My controller code looks like this:

 

public String searchText { get { return searchText; } set { searchText = value; } }

 

public void search() {

if(searchText.length()>0){

//reset booleans that control display of results elements

displaySelected = false;

successfulMerge = false;

displaySearchResults = false;

mySOSL();

searchResults = wrapSOSLResults(searchList);

//if we got a result back, show the search results pane

if(searchResults.size()>0){

displaySearchResults = true;

}

}

}

 

 

The mySOSL method constructs a search string using the value in searchText. Any ideas why this would return no results when hitting enter on the form? It feels like the setter for searchText isn't running...but I'm not sure how to remedy that.

 

Thanks,

 

Steve 

 

 

I'm trying to send an outbound email to a developer when I handle an exception in Apex, but I am unsuccessful. I can send outbound emails, but if I try to addError() it seems that outbound emails are not sent out.

 

Here is my testing trigger:

 

 

trigger contactExceptionTest on Account (after insert) {

list<Account> myAccounts = new List<Account>();

try{

throw new MyException('this is bad');

} catch (MyException e){

trigger.new[0].addError('erroor!!');

} finally {

Messaging.SingleEmailMessage mail2= new Messaging.SingleEmailMessage();

String[] toAddresses2 = new String[] {'steve@gokubi.com'};

mail2.setToAddresses(toAddresses2);

mail2.setReplyTo('steve@gokubi.com');

// Specify the name used as the display name.

mail2.setSenderDisplayName('Salesforce Support');

// Specify the subject line for your email2 address.

mail2.setSubject('fake after');

// Set to True if you want to BCC yourself on the email2.

mail2.setBccSender(false);

// Optionally append the salesforce.com email2 signature to the email2.

// The email2 address of the user executing the Apex Code will be used.

 

mail2.setUseSignature(false);

// Specify the text content of the email2.

mail2.setPlainTextBody('fake email2');

mail2.setHtmlBody('fake email');

// Send the email you have created.

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail2 });

}

}

 

This adds the 'erroor!!' message to the screen but doesn't send the email. If I comment out the addError(), the email goes out as expected.

 

Does addError() stop all outbound emails from going out, or is it broader than that? Does addError() stop execution of my trigger code generally?

 

Thanks,

 

Steve 

 

I've got a VisualForce controller that uses SOSL to search for Contacts. I have tests of this controller that pass, and use the correct method for overriding SOSL results in the test:

 

Id[] fixedSearchResults=new Id[3];

fixedSearchResults[0]=con.Id;

fixedSearchResults[1]=con2.Id;

fixedSearchResults[2]=con3.Id;

 

Test.setFixedSearchResults(fixedSearchResults);

 

controller.search(); 

 

My actual SOSL call is in a method in a different class, and everything is hunky dory when I run that test. My class correctly handles the SOSL result, even when it's null, as that's a common occurrence when searching.

 

When I run All Tests, however, I get failures in an unrelated test class. After some hacking apart my controller test class, it appears that the SOSL call is what is causing the unrelated test class to fail.

 

By commenting out the SOSL, I can get the unrelated test to pass. If I uncomment the SOSL, the unrelated test will fail.

 

 

//build the SOSL query and execute

 

String searchquery = 'FIND \'' + searchText + '\' IN ALL FIELDS RETURNING Contact(' + fieldsForReturn +' ORDER BY LastName LIMIT ' + SOSL_LIMIT + ')';

 

//if I comment this out, the unrelated test will pass

 

List<List<SObject>> searchList = search.query(searchquery);

 

The SOSL field list is generated from a describe call, but I get the same problem if I used a fixed string for the field list. 

 

Any ideas how SOSL might cause another test in the test batch to fail? I suspected a governor limit problem, just because I couldn't think of any other reasons why this would happen. But I don't see how that could be the case, and commenting out my bulk tests hasn't helped.

 

Thanks,

Steve 

I've got a list of wrapper class items, each of which contains a contact. I'm displaying them in a pageBlock, which is working just fine.

 

I have Hover Details working off the Account lookup on the contact, but I can't get it to work for the contact record itself. Here is the page code:

 

<apex:pageBlock title="Found Contacts"> <apex:pageBlockTable value="{!searchResults}" var="item"> //this is the working hover for the Account <apex:column value="{!item.con.AccountId}"/> //this displays the Contact Name as unlinked text with no hover <apex:column value="{!item.con.Name}"/> //this displays the Contact Id as unlinked text with no hover <apex:column value="{!item.con.Id}"/> //this displays the Contact Id as unlinked text with no hover <apex:column value="{!item.con}"/> //this displays the Name as a link, but no hover <apex:column headervalue="Name"> <apex:outputLink value="/{!item.con.Id}"> <apex:outputText >{!item.con.Name}</apex:outputText> </apex:outputLink> </apex:column> </apex:pageBlockTable> </apex:pageBlock>

 

 Is there any way for me to get the Name as a link to the detail of the contact and also get the detail hover to work?

 

Thanks!

 

Steve 

 

I have some before and after insert triggers on Contact. When a Contact is imported via the Account/Contact import wizard, the triggers don't behave as expected. All my tests are passing--one-offs and bulk.

 

My question is, how do I troubleshoot a problem like this? I can't write a test that uses the import wizard. Import wizard DMLs don't appear to be recorded in the debug log. I'm not sure where the dupe checking of the import wizard fits in the execution stack--it's not listed in the Apex docs that talk about execution order.

 

Is there any way for me to see what might be happening here?

 

Thanks,

Steve 

It's cool how when you include Custom Labels in a managed package, the installing User can override those labels with translations to their local language.

 

Why not let people do local overrides to English? If that were allowed, then the user could tweak the managed package a bit. The developer has control over what they expose as a Custom Label--anything they don't want the User to touch could be a Custom Setting, or a String in a class.

 

Since people using the translation workbench can override Custom Labels, let's all get that ability!

 

Thanks, 

Steve 

Hi

 

I have a visual force page called Survey,which is a related list with case standard object

<apex:page standardController="Survey__c" extensions="Survey" sidebar="false">
 <apex:form style="background-color:#FFFFFF;"> 
    <style type="text/css">
        body {font-family:Arial Unicode MS;font-size:12px;}
        P{background-color:#006400;HEIGHT:20PX;font-size:12px;font-weight:bold;color:#FFFFFF;}
    </style>

 <apex:pageBlock title="Survey Form">
 <apex:pageBlockSection title="Please enter the details" collapsible="true"  columns="2" showHeader="true" onmouseover="hover">
 <apex:panelGrid columns="4" width="900px">
 
 <apex:outputText value="Survey Name:" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.Name}"/>
 
 <apex:outputText value="How was the Case handling power:" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.How_was_the_Case_handling_power__c}"/>
 
 <apex:outputText value="How was the feedback:" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.How_was_the_feedback__c}"/>
  
  <apex:outputText value="Case" style="width:50px">
 </apex:outputText><apex:inputField value="{!Survey__c.Case__c}"/>
 
 </apex:panelGrid>
 </apex:pageBlockSection>
 <center><apex:commandButton value="Save" action="{!Survey}"/>
 <apex:commandButton value="Cancel" action="{!Cancel}"/> </center>
 </apex:pageBlock> 

 </apex:form> 
</apex:page>
               

 

.I have a scenario over here like when ever a case is closed an email is send to the contact telling that ur case has been closed and it gives the link for the Survey.When the user click the survey ,the survey visual force page opens where the user put the survey details and when he saves it, the challenge is that survey record should go and sit with the same case no.

 

 

Below is the visual for page.

 

The controller below is

 

public  class Survey {
  public Survey__c sur;
  public Case cs;
  public integer n;
  public Id cid;
  public ApexPages.StandardController a;

    public Survey(ApexPages.StandardController controller) {
       this.sur = (Survey__c)Controller.getRecord();
        System.debug('nasir:' +sur);
      
    }
     public PageReference Survey() {
        cs = new Case();
        sur = new  Survey__c();
        cs = [Select CaseNumber,id from Case Limit 1];
        System.debug('sana:' + cs);
        
        sur.Case__c = cs.CaseNumber;
      upsert sur;
        return null;
    }
}

 

how can i achieve this..plz give some input thanks

 

  • April 13, 2011
  • Like
  • 0

Can someone help writing Apex Trigger for Cross object updates. The objects are Lead and Task (Related list) which is associated with the respective Lead. Here are a couple of cases for which am looking for -

 

1. When we email the lead, an acitivity gets created within Activity History Section. In each activity record, "Due Date" is the field gives the date of the completion of that activity. In this way list of activities listed in Activity History. I want to pull the last email date (from Due Date) for that lead and update a custom lead field (Last_Emailed_Date_c).

 

2. Similar to above while we send email and email ID gets bounce, an activity gets created with Subject having "bounced" word. When this activity recored created with bounced in Subjecline I want the respective Lead_Status_c (Picklist) getting updated to Disqualified.

 

I am not a programmer but can undertand the code at high level. It would be of great help if someone can share code for these two scenarios. Thanks a lot!!

 

  • April 13, 2011
  • Like
  • 0

Hello,

 

I wrote the trigger to mapping the custom field 'Payment_Terms__c' (it's a picklist) between Accounts and Quote, but it show the error info when I save the trigger,

 

trigger test3 on Account (after insert, after update) {
    Map<String, String> SetupFormMap = new Map<String, String>();
    for (Account acc : System.Trigger.new){
        if (acc.Payment_Terms__c != null){
                SetupFormMap.put(acc.ID, acc.Payment_Terms__c);
        }


list<Quote> recordsforupdates = new List <Quote>();

For (Quote aacc :[Select OpportunityId, Payment_Terms__c from Quote where Payment_Terms__c IN : SetupFormMap.keySet()] )
 
{

if (SetupFormMap.containsKey(aacc.Payment_Terms__c)) {
           String actName = SetupFormMap.get(Payment_Terms__c);
            recordsforupdates.add (new recordsforupdates (Id = aacc.Id, Payment_Terms__c = actName));
               }
        }
}
update recordsforupdates;
        }

 

Anyone can help the me? Great Thanks.

Hi.

 

I have a solution that can be resolved using two SOQL queries instead of one. though I think It can be done with one. if you are open to the challange, please continue...

 

I think I possibly found a bug in Apex. or is this by design? would be happy to be told I'm wrong and have a solution to my problem :smileyhappy:. If I am correct, the Bug is in my 5th attempted solution.

 

My object "Timesheet__c" is a detail object of Contact (which is master). Each contact has a field called "Employee_Reference__c" Which is a Formula(Number, Roll-up Summery from a 3rd object called "Payroll Record").

 

I am attempting to generate a table that would show some aggregate values from "Timesheet__c" along with the employee's reference.

This will give me a table with the following Columns [Employee Reference, Sum1, Sum2, Sum3] etc.

The problem is that Employee_Reference__c is not a groupable field, and thus a SOQL group by statement does not allow this field to be used.

 

I've attempted different solutions and failed:

 

  1. query from the parent (Contact), doesn't work since salesforce doesn't support Aggregate functions in the sub query, Agg. Functions are only  in the parent query)

  2. Query the field from the master object via the child table. I was hoping the grouping would work as the grouped field implies a unique order. No success.
Select Worker__r.Employee_Reference__c from Timesheet__c Group by Worker__c

 3. Using a formula field in the child  (Which looks up the parent Employee_Reference__c value) object and querying that. Failed miserably.

4. Copying the formula field to a non-formula field. Fails as it would need cross object workflow rule (the field update would need to be done for the parent object), which is not supported.

 

5. I've decided to disguise the Employee_Reference__c as an aggregate object. this Looks at the parent object and takes the MAX(). I hoped this would work as there is only one value to per line, MAX() should always return the value I want.

The query complies and runs, and looks good on the Eclipse Schema Editoer query window. However, when attempting to address this field after the query, I get the error "Save error: Invalid field MAX_Employee_Reference for SObject AggregateResult" .

 

Here is the SOQL Query: 

select Worker__c Worker, SUM(Standard_Pay_Taxed__c) SUM_Standard_Pay_Taxed,    														MAX(Worker__r.Employee_Reference__c) MAX_Employee_Reference,    														SUM(Holiday_Pay__c) SUM_Holiday_Pay,  															SUM(Taxed_Expenses__c ) SUM_Taxed_Expenses,     														SUM(Taxed_Deductions__c) SUM_Taxed_Deductions,															SUM(Non_Taxed_Expenses__c ) SUM_Non_Taxed_Expenses,     														SUM(Non_Taxed_Deductions__c) SUM_Non_Taxed_Deductions    														from timesheet__c where Week__r.Week_Ending__c = LAST_N_DAYS:7
Group by Worker__c

6. My solution will be to use a second SOQL, and to then use a map to align the Employee_Reference__c values. I don't like it though...

 

Thank you for your time.

Hi,

 

How can i add salesforce EnterPrise Wsdl to the Jitter bit?

 

Thanks,

Ramya

Hi,

How can i use Jitter Bit to Query the Salesforce Records?

 

Regards,

Ramya

Hi

 

I have a custom object A which includes a reference via Lookup Relationship to a related custom object B.

I want to calculate and update the 'Grand Total' field on B which is the sum of all 'Price' fields on all related As.

How do I do it?

 

Thanks

Hello,

 

I have recently got the nonprofit starter pack and am having trouble understanding how to change/add fields on the donation page. I need to have a field for type of fund and one for a tracking number (direct mail solicitations). I can't find anything on how to do this either through vidoes or on the board. Can someone help on this? If I have posted in the wrong board, I apologize.

 

Thanks,

 

kayne

kkarnbach@pwcleancouncil.org

I have a simple search box that runs a method and rerenders part of the page. I want the User to hit enter in this box and have the search happen correctly. My method is running when the User hits enter, but the search always turns up zero results. If the User hits the Search button, the search runs correctly.

 

 

<apex:form >

<apex:inputText value="{!searchText}" id="searchText"/>

<apex:commandButton action="{!search}" rerender="searchresults,selectedContacts,winnerpanel" value="Search" status="searchStatus"/>

<apex:actionStatus startText="(searching...)" id="searchStatus"/>

</apex:form>

 My controller code looks like this:

 

public String searchText { get { return searchText; } set { searchText = value; } }

 

public void search() {

if(searchText.length()>0){

//reset booleans that control display of results elements

displaySelected = false;

successfulMerge = false;

displaySearchResults = false;

mySOSL();

searchResults = wrapSOSLResults(searchList);

//if we got a result back, show the search results pane

if(searchResults.size()>0){

displaySearchResults = true;

}

}

}

 

 

The mySOSL method constructs a search string using the value in searchText. Any ideas why this would return no results when hitting enter on the form? It feels like the setter for searchText isn't running...but I'm not sure how to remedy that.

 

Thanks,

 

Steve 

 

 

I am stuck with this query that is supposed to pull a count of related objects with every object.

 

My data model is that I have an "Assignment" object that has a lookup field that points to a "Resource" object.  The Resource object doesn't have any fields pointing to Assignments.  

 

From the documentation, it seems like my query should look like this:

 

resources = [ SELECT Name,
              Primary_Discipline__c,
              Project_Manager__c,
              Account_Executive__c,
              Foreign_Languages__c,
              (SELECT count() FROM SFDC_Assignment__r)
             FROM SFDC_Resource__c
          ];

 

The error message I get is:

 

Error: Compile Error: Didn't understand relationship 'SFDC_Assignment__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 6 column 23

 

Any ideas?

 

Thanks,

 

Seth

Hello, I am trying to clone a Campaign along with CampaignMemberStatus.

 

In the following code segment, there are two approaches (one commented out) both of which fail with the error: Required fields are missing: [Label]: [Label]

 

Any help appreciated.  Thanks

 

    public PageReference Duplicate() {
        if (selection == '0') {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL, 'Please select a template to use before clicking New.'));
            return null;
        }
        Campaign template = [SELECT Name FROM Campaign WHERE id = :selection];
        Campaign clone = template.clone(false);    // Create a clone without the id.
        clone.Template__c = false;
        clone.IsActive = true;
        clone.Name = 'New Campaign';
        insert clone;
        // Now that the Campaign has been inserted, we need to insert the CampaignMemberStatus list
        // BOTH OF THE FOLLOWING Approaches to insert the cloned list cause the following error:
        // Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Label]: [Label]
        List<CampaignMemberStatus> statuslist = [SELECT Id from CampaignMemberStatus WHERE CampaignId = :selection];
        List<CampaignMemberStatus> clonelist = statuslist.deepClone(false);
        for (CampaignMemberStatus status : clonelist) {
            status.CampaignId = clone.Id;
        }
        // List<CampaignMemberStatus> clonelist = new List<CampaignMemberStatus>();
        // for (CampaignMemberStatus status : statuslist) {
        //     CampaignMemberStatus sclone = status.clone(false);
        //     sclone.CampaignId = clone.Id;    // Point this CampaignMemberStatus to the inserted Campaign
        //     clonelist.add(sclone);
        // }
        insert clonelist;
        PageReference editPage = new ApexPages.StandardController(clone).edit();
        editPage.setRedirect(true); // ???  Do I need to do this?
        return editPage;
    }
 

  • October 22, 2009
  • Like
  • 0

Hello, I'm doing some intergartion work through the salesforce api and I recently got the following warning.

 

Operation: insert.npe03__Recurring_Donation__c

By user/organization: 00580000001snmg/00D80000000cnJ5

Caused the following Apex resource warnings:

npe03:Number of DML rows: 128 out of 200

 

I'm not really sure what this means as I know I'm not doing 128 inserts at once.

 

Does the 200 limit apply to a certain timespan?

 

Any help is appreciated. 

 

Thanks,

Phillip

  • September 09, 2009
  • Like
  • 0

Hi all,

 

    I have a trigger to do a field update on another object(salesforecast) when opportunity owner is changed. It turns out it works only when the opportunity owner is changed manually. When the owner is changed due to the account transfer,  the trigger won't be triggered.

 

    Although the owner change will always show up in the I couldn't create trigger upon the OpportunityFieldHistory.

 

    Any work around for this? 

 

Thanks,

Dawn

  • September 08, 2009
  • Like
  • 0

I have set up a Developer edition account to have an arena for making mods prior to deploying them to our Nonprofit Salesforce account. 

 

However, I now need to create a trigger that evaluates the value in the Contact "System Account Processor" (which is a contact field in the nonprofit starter pack).  

 

Do I  need to install the NP starter pack in my Developer account?

 

Thanks!

  

  • August 31, 2009
  • Like
  • 0

I have some before and after insert triggers on Contact. When a Contact is imported via the Account/Contact import wizard, the triggers don't behave as expected. All my tests are passing--one-offs and bulk.

 

My question is, how do I troubleshoot a problem like this? I can't write a test that uses the import wizard. Import wizard DMLs don't appear to be recorded in the debug log. I'm not sure where the dupe checking of the import wizard fits in the execution stack--it's not listed in the Apex docs that talk about execution order.

 

Is there any way for me to see what might be happening here?

 

Thanks,

Steve 

Hi all:

  I was wondering if anyone knew how to format a number in VF so that it has a comma and decimal...

for example

40000 would be 40,000.00

So far I have this:

 

<apex:outputText value="{0}.{1}"> <apex:param value="{!SUBSTITUTE(TEXT(FLOOR(item.Unit_Price__c)), ',', '.' )}"/> <apex:param value="{!RIGHT(TEXT(ROUND((item.Unit_Price__c * 100), 2)),2)}"/> </apex:outputText>

 The second one gets the digits after the decimal. but the number shows up as 40000.00

How do I get the comma in there now...

Someone pleaseeee help with any ideas...