• MarinaMartin
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi all,

 

I'm receiving the below error on the same Account, constantly, using a "fake" roll-up summary trigger I have running on many clients' instances with no trouble. I understand this error means that something else may be attempting to edit this record with a future modified date -- could the Outlook connector be doing this? Any thoughts on why it would affect ONE account and only one, when all other accounts are also updated throughout the day?

 

Any light someone could shed would be much appreciated.

 

Thanks!
Marina 

 

Developer script exception from [redacted name of account] : CountContact : CountContact:
execution of AfterUpdate caused by: System.DmlException: Update failed.
First exception on row 0 with id 001XXXXXXXXXXX; first error:
ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, entity fa

Apex script unhandled trigger exception by user/organization:
005XXXXXXXXXXXXXXXXXXXXXX

CountContact: execution of AfterUpdate

caused by: System.DmlException: Update failed. First exception on row 0 with
id 001XXXXXXXXXXXXX; first error: ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE,
entity failed ifModifiedBefore test on update: []

Trigger.CountContact: line 39, column 1

Hi all,

 

Is there a way to selectively display a tab in the Customer Portal based on criteria (e.g. custom_boolean_field__c == true)? I've read through the documentation but I'm now under the impression my only option is to create a duplicate customer portal... which seems like overkill for this one use case. Any ideas?

 

Thanks in advance.


Marina

Hi,

 

I'm stumped on how to get my scheduled job to run every Monday and Thursday starting on the SECOND Monday in the months of March, June, September, and December.

 

I tried

 

String sch = '0 0 8 ? MAR,JUN,SEP,DEC 2#2,2#3,2#4,2#5,5#2,5#3,5#4,5#5';

 

Through trial and error, this works fine except for the day of the week section. It only seems to recognize the first 2#2, and not the rest of them. Is there a way to combine them properly? Or would I have to schedule this 8 separate times?

 

Thanks in advance for any insight.

Hello,

 

I'm stumped on this one. I set a SelectList ID in my Visualforce page, but when I view source, it's replaced with a much longer ID. This is causing a problem because this select list is a search box, so if the ID is wrong it's not passed to the search in the controller.

 

// Controller code that creates selectList options

public List<SelectOption> getTheAnalysts() {
List<SelectOption> analystoptions = new List<SelectOption>();
analystoptions.add(new selectOption('', ''));
for (User users : [SELECT Id, Name FROM User WHERE IsActive = true]) {
analystoptions.add(new selectOption(users.Id, users.Name));
}
return analystoptions;
}

 

// Visualforce display of selectList

<tr>
<td style="font-weight:bold;">Analyst<br/>
<apex:selectList id="analyst" size="1" value="{!theAnalyst}" onchange="doSearch();">
<apex:selectOptions value="{!theAnalysts}" />
</apex:selectList>
</td>
</tr>

 

// View source display of selectList

<tr>

<td style="font-weight:bold;">Analyst<br /><select id="j_id0:j_id27:mainresults:j_id59:analyst" name="j_id0:j_id27:mainresults:j_id59:analyst" size="1" onchange="doSearch();">

<option value="" selected="selected"></option>

<option value="XXXXX">User One</option>

<option value="XXXXX">User Two</option>

</select>

</td>

</tr>

 

Where is the start of that ID coming from? And how do I suppress it??

 

Thanks for any insight.

 

Marina

Hello,

 

I have a client asking to do something that I don't believe is possible. Can anyone confirm?

 

They want to be able to send a link to a website form to a client. The URL will contain only the Contact ID. Based only on that Contact ID, they want to pre-populate form fields such as name and email address from Salesforce.

 

I will happily be proven wrong. Thanks for reading!

 

Marina

There's been a change in the Salesforce API that causes emails to not be sent when there are spaces around the email address string.

 

(Debug log message shown below)

This string of email addresses resulted in Email not sent -- ccAddresses: [tsailing.test1@gmail.com,  tsailing.test2@gmail.com,  tsailing.test3@gmail.com]

This string of email addresses resulted in Email sent -- ccAddresses: [tsailing.test1@gmail.com,tsailing.test2@gmail.com,tsailing.test3@gmail.com]

 

The main issue is that there will be NO ERRORS RETURNED OR DISPLAYED to inform users that their emails were not sent. In fact, the system WILL RETURN A SUCCESS MESSAGE.

 

Here's the debug message received -- (Messaging.SendEmailResult[getErrors=();isSuccess=true;])

 

This is NOT an acceptable API behavior.

 

 

Sample code used --

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

    String toRecipients = 'tsailing.test1@gmail.com';
    String[] toAddresses = toRecipients.split(';', 0);
    email.setToAddresses( toAddresses );
    System.debug('------------------- 7/1/2012: toAddresses: '+toAddresses);

String ccRecipients = 'tsailing.test2@gmail.com,  tsailing.test3@gmail.com,  tsailing.test4@hotmail.com';
    String[] ccAddresses = ccRecipients.split(',', 0); //switched this to "ccRecipients.split(', ', 0)" resolved the issue.
    email.setCcAddresses(ccAddresses);
    System.debug('------------------- 7/1/2012: ccAddresses: '+ccAddresses);
try {
    email.setSubject('test');
    email.setPlainTextBody('test');
    email.setBccSender(true);
} catch (Exception e) {
System.debug('------------------- 7/1/2012: e: '+e);
}

Messaging.SendEmailResult [] r = 
Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
System.debug('------------------- 7/1/2012: r: '+r);

 

When creating a new Prospect record I cannot use a Workflow rule to default a State picklist field to the State from the User object, so I need to create a vsiualforce page or apex trigger to accomplish this. 

 

I'm new to this area, and appreciate any advice on how to do this!  Thank you!

 

Best regards,

Ar

 

Hi All,

 

I am working on the requirement of Parent-child Task hierarchical relationship.

Salesforce Activity Object does not support Lookup relationships to other object or addition of Self relationship.

Is there any way using custom field to implement multilevel parent-child activity relationship in SFDC.

 

Thank you Board.

Vijay

Hi All,

 

When trying to put together a roll up summary for the list price of all products on an opportunity it always returns a blank value.

 

I have checked and the list price is there, on the product record as well as showing as a summable field.

 

What have I missed.

 

R

Hello,

 

I have a client asking to do something that I don't believe is possible. Can anyone confirm?

 

They want to be able to send a link to a website form to a client. The URL will contain only the Contact ID. Based only on that Contact ID, they want to pre-populate form fields such as name and email address from Salesforce.

 

I will happily be proven wrong. Thanks for reading!

 

Marina

HI,

 

      I want to know if Facebook, Twitter and Linkedin can be enabled on custom apps developed on Force.com?

 

Thanks in advance!

  • December 23, 2011
  • Like
  • 0

I installed the Linkedin for Salesforce following the instructions of the video demonstration.  The sections I built in are showing up on the contact pages (where i installed them), but now there is no content showing.  Anyone have any idea if there is something I need to install in addition to the app itself to get the linkedin member content and company content to show up?  Thanks!!

I am new to test writing test methods and was hoping I could figure this one out on my own, but at some point I have to give in! I am getting 48% coverage on this controller. It is based on the dynamic search page provided by Jeff Douglas (http://blog.jeffdouglas.com/2010/07/13/building-a-dynamic-search-page-in-visualforce/). For now I have  place the test method in the controller. Here is the controller with test method:

 

 

public with sharing class ProductSearchController {
 
  // the soql without the order and limit
  private String soql {get;set;}
  // the collection of products to display
  public List<NRProducts__c> products {get;set;}
 
  // the current sort direction. defaults to asc
  public String sortDir {
    get  { if (sortDir == null) {  sortDir = 'asc'; } return sortDir;  }
    set;
  }
 
  // the current field to sort by. defaults to NRCode
  public String sortField {
    get  { if (sortField == null) {sortField = 'name'; } return sortField;  }
    set;
  }
 
  // format the soql for display on the visualforce page
  public String debugSoql {
    get { return soql + ' order by ' + sortField + ' ' + sortDir + ' limit 200'; }
    set;
  }
 
  // init the controller and display some sample data when the page loads
  public ProductSearchController() {
    soql = 'select Name, FBA_Total_Value__c, Total_Qty_Purchased__c,  Create_PO__c, isFBA__c, Vendors__c, VendorID__c, Total_Sold__c, FBA_Inventory__c, Open_Qty__c, Total_Qty__c, Inventory_Burn__c, FBA_Turn__c,   Reorder_Point__c, Reorder__c, Reorder_Amount__c, Reorder_Cost__c  from NRProducts__c where isFBA__c = True';
    runQuery();
  }
 
  // toggles the sorting of query from asc<-->desc
  public void toggleSort() {
    // simply toggle the direction
    sortDir = sortDir.equals('asc') ? 'desc' : 'asc';
    // run the query again
    runQuery();
  }
 
  // runs the actual query
  public void runQuery() {
 
    try {
      products = Database.query(soql + ' order by ' + sortField + ' ' + sortDir + ' limit 200');
    } catch (Exception e) {
      ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Ooops!'));
    }
 
  }
 
  // runs the search with parameters passed via Javascript
  public PageReference runSearch() {
    

    String name = Apexpages.currentPage().getParameters().get('name');
    String lastSold = Apexpages.currentPage().getParameters().get('lastSold');
    String vendors_id = Apexpages.currentPage().getParameters().get('vendors_id');
    String fbaInventory = Apexpages.currentPage().getParameters().get('fbaInventory');
    String openQty = Apexpages.currentPage().getParameters().get('openQty');
    String totalQty = Apexpages.currentPage().getParameters().get('totalQty');
    String inventoryBurn = Apexpages.currentPage().getParameters().get('inventoryBurn');
    String fbaTurn = Apexpages.currentPage().getParameters().get('fbaTurn');
    String reorderPoint = Apexpages.currentPage().getParameters().get('reorderPoint');
    String reorder = Apexpages.currentPage().getParameters().get('reorder');
    String reorderAmount = Apexpages.currentPage().getParameters().get('reorderAmount');
    String reorderCost = Apexpages.currentPage().getParameters().get('reorderCost');    
                      

 
    soql = 'select Name, isFBA__c, Total_Qty_Purchased__c, FBA_Total_Value__c, Create_PO__c, Vendors__c, VendorID__c, Total_Sold__c, FBA_Inventory__c, Open_Qty__c, Total_Qty__c, Inventory_Burn__c, FBA_Turn__c,   Reorder_Point__c, Reorder__c, Reorder_Amount__c, Reorder_Cost__c  from NRProducts__c where isFBA__c = True';

    if (!name.equals(''))
      soql += ' and name LIKE \''+String.escapeSingleQuotes(name)+'%\'';
    if (!vendors_id.equals(''))
          soql += ' and VendorID__c LIKE \''+String.escapeSingleQuotes(vendors_id)+'%\'';
   if (!lastSold.equals(''))
      soql += ' and Total_Sold__c >= '+lastSold+'';
         if (!fbaInventory.equals(''))
      soql += ' and FBA_Inventory__c >= '+fbaInventory+'';
         if (!openQty.equals(''))
      soql += ' and Open_Qty__c >= '+openQty+'';     
         if (!totalQty.equals(''))
      soql += ' and Total_Qty__c >= '+totalQty+'';     
         if (!inventoryBurn.equals(''))
      soql += ' and Inventory_Burn__c >= '+inventoryBurn+'';      
         if (!fbaTurn.equals(''))
      soql += ' and FBA_Turn__c >= '+fbaTurn+'';      
         if (!reorderPoint.equals(''))
      soql += ' and Reorder_Point__c >= '+reorderPoint+'';      
          if (!reorder.equals(''))
          soql += ' and Reorder__c LIKE \''+String.escapeSingleQuotes(reorder)+'%\'';       
         if (!reorderAmount.equals(''))
      soql += ' and Reorder_Amount__c >= '+reorderAmount+'';      
          if (!reorderCost.equals(''))
      soql += ' and Reorder_Cost__c >= '+reorderCost+'';
    // run the query again
    runQuery();
 
    return null;

}

    ///////////////////////////////////////////////
    // 
    // Unit Tests
    //
    ///////////////////////////////////////////////
    
    public static testMethod void testController()
    {

        
        // instantiate the controller
        ProductSearchController ctrl=new ProductSearchController();

       // instantiate the controller
        //ctrl.runSearch();
        System.assert(ctrl.runSearch() == null);

    }
}

 I have color coded based on what the testing shows. Blue = coverage, Red = no coverage.

 

Thank you for your help!

 

 

 

 

  • May 24, 2011
  • Like
  • 0

Hello,

 

I've created a junction object  'Invitation' to support a many-to-many relationship between 'contacts' and 'courses'.

One contact can be invited to many courses.

One course can have many contacts as guests.

 

But I don't seem to be able to import 'invitations'.

Our organization is sending out many invitations, so creating them manually is not an option.

 

Can anyone point me in the direction of;

1) how to import junction objects? or

2) is there another solutiond?

 

Thanking in advance for your help!

  • December 01, 2010
  • Like
  • 0

Hi Everyone,

 

We're using custom address fields in Contacts and Accounts.  I've got a button to drag the address from the account through to contact page (which can then be edited).  This button called "Create Contact"  is on the account page (in contact related list) and used when users are creating a new contact for the account.  The trouble is while it works fine for me/system admin it keeps logging users out of Salesforce and then they can't get back in - their passwords are then not recognised.  Here is the button: 

 

https://cs2.salesforce.com/003/e?{!Contact.Contact_Address_Line_1__c}&00NR0000000WQS7={!Account.Address_Line_1__c}&00NR0000000WQJj&{!Contact.Contact_Address_Line_2__c}&00NR0000000WQT0={!Account.Address_Line_2__c}&00NR0000000WQJt&{!Contact.Contact_Address_Line_3__c}&00NR0000000WQT5={!Account.Address_Line_3__c}& 00NR0000000WQJu&{!Contact.Contact_Postal_City__c}&00NR0000000WQTF={!Account.Postal_City__c}&00NR0000000WQJp&{!Contact.Contact_Postal_State__c}&00NR0000000WQT6={!Account.Postal_State_Province__c}&00NR0000000WQJy&{!Contact.Contact_Postal_Zip_Code__c}&00NR0000000WQTP={!Account.Postal_ZIP_Code__c}&00NR0000000WQK3&{!Contact.Contact_Postal_Country__c}&00NR0000000WYcz={!Account.Postal_Country__c}&00NR0000000WYmP&{!Contact.Contact_Region__c}&00NR0000000WYnm={!Account.Region_1__c}&{!Contact.Phone}&con10={!Account.Phone}&acc10&{!Contact.Fax}&con11
={!Account.Fax}&acc11

 

I'm fairly new to this and have scanned through old posts and tried some of the suggestions but its nothing is working.  Does anyone know how to resolve this?

 

Thanks

 

Jodie