• Legend
  • NEWBIE
  • 99 Points
  • Member since 2012

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 27
    Replies

Hello

 

I've searched the boards for an answer to this and couldn't find one.  I'm new to apex and programming in general so apologies if this is very basic...

 

I have the following test method in an apex class:

    public static testMethod void dateSetTest(){
        
        Lead prospect = new Lead(LastName = 'Test');
        Database.insert(prospect);
        
        Account acct = new Account(Name = 'Test');
        acct.recordTypeId = [SELECT Id FROM RecordType WHERE Na​me = 'Person Accounts'].Id;
        Database.insert(acct);
        
        Case c = new Case(AccountId = acct.Id,
                          Subject = 'Test',
                          Origin = 'Inbound Call',
                          Reason = 'Customer Inquiries',
                          Primary_Type__c = 'Test',
                          Primary_Subtype__c = 'Test',
                          Survey_Email_Sent__c = false);
        Database.insert(c);
        c.Survey_Email_Sent__c = true;
        Database.update(c);
        
        Account acctToCheck = [SELECT Id, Last_Survey_Sent__c FROM Account WHERE Id = :acct.Id];
        System.assert(acctToCheck.Last_Survey_Sent__c != null);
    }

 

I'm getting the following error which makes no sense at all:

 

Error: Compile Error: No such column 'Na​me' on entity 'RecordType'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

I am authoring this from a System Administrator profile so I don't believe it's a FLS issue.  Any thoughts or help would be appreciated.

 

Is there a way to rename Quotes to Order Forms & Invoices?

 

Thanks,

thsis i smy controller and i am unable to cover the if condition pz help me resolve the issue

 

 

public class timesheetmanagement 
{    
public String weekselection{get; set;}
public String incselection{get; set;}
Public List<Timesheet_Entry__c> tentries;
Public List<Timesheet_Entry__c> otherentries;
Public Date SelectedWeek;

 public Id oppId {get; set;}

Public void deltsheet()
{
    String rownumber = System.currentPagereference().getParameters().get('rownumber');
    Decimal rownumb = Decimal.Valueof(rownumber);
    Integer rowno = rownumb.IntValue();
    String tentryid = System.currentPagereference().getParameters().get('tentryid');
    system.debug('tentries tentryid'+tentryid);
  
    if (rownumber != '')
        tentries.remove(rowno);
       
}

public void onloadfunction()
{
    if ( weekselection != null)
    {
        SelectedWeek = date.valueOf(weekselection);  
        system.debug('The Selected Week is'+SelectedWeek);
        tentries = [select Id,Project__c,Displayfields__c,Tasks_for_Project__c,Effort__c,Week_Start_Date__c,Mon__c,Tue__c,Wed__c,Thu__c,Fri__c,Sat__c,Sun__c,Project_Task__c from Timesheet_Entry__c where Week_Start_Date__c=:SelectedWeek and Project__c!=NULL and OwnerId=:Userinfo.getUserId()];
        otherentries = [select Comments__c,Displayfields__c,Tasks_Other__c,Effort__c,Week_Start_Date__c,Mon__c,Tue__c,Wed__c,Thu__c,Fri__c,Sat__c,Sun__c,Project_Task__c from Timesheet_Entry__c where Week_Start_Date__c=:SelectedWeek and Project__c=NULL and OwnerId=:Userinfo.getUserId()];
        
    } 

Hello,

In Contacts tab, i would like to create a new custom field.  Can you show me the proper syntax.

 

I want to create a field titled "OpptyStage". i suppose it will be a text field.

 

I want the value of "OpptyStage" to equal the field titled "Stage" within the Opportunity Tab.  It's also known as StageName.

 

Please show me how to create this field.

 

Ultimately whart i am trying to accomplish is filter my 1,000 contacts to list only those that are associated with an active Opportunity. To do this, my thinking is to pull in the Opportunity Stage and use that for filtering the contacts.  This will yield something like 50 contacts for me.  If you have any other suggestions of how to get this view, I am all ears.

 

Thanks for your help

Gappman

Plz I need apex batch class for below requirement

'fetched query results can we put directly into .xls'

 

 

Thank you for your time!

 

Sincerely

sri

  • April 15, 2012
  • Like
  • 0

Hi

 

I had created a force.com project using Eclipse ide.

Because of security reasons i want to log out from that particular project after completion of my work.

Is it Possible.

Hello,

 

Is there any way (a supported way or a tricky workaround) to make Salesforce not to rollback changes done in the trigger eventhough the insertion failed?

 

Sometimes I want to fail the insertion (addError on the sObject) but I want other changes done in the trigger to still happen.

 

For example:

trigger triggerName on Contact (before insert) {
    Contact newContact = Trigger.new[0];
    Contact existingContact = [Select FirstName From Contact Where Id = 'someId'];
    existingContact.FirstName = newContact.FirstName;
    update existingContact;
    insert new Account(Name='newAccount');
    newContact.addError('errorName');
}

In this case, when adding a contact, the update of exisitingContact and the insertion of newAccount will be rolled back...

I do want those changes to occur, eventhough I want the newContact not to be inserted.

 

Playning with opt_allOrNone didn't seem to have any effect.

 

Thanks in advance!

Itay

  • March 21, 2012
  • Like
  • 0

When creating a new opportunities, I would like to automatically update the Close Date field based on the Stage field.  Ideally, it would work the same way the Probability (%) field is automatically updated when the Stage is selected?  The close date should be set to Today () + the number of days as defined below for each stage:  

 

Stage 1 - 360 days

Stage 2 - 180 days

Stage 3 - 90 days

Stage 4 - 30 days

 

Thanks for the help!

Hello

 

I've searched the boards for an answer to this and couldn't find one.  I'm new to apex and programming in general so apologies if this is very basic...

 

I have the following test method in an apex class:

    public static testMethod void dateSetTest(){
        
        Lead prospect = new Lead(LastName = 'Test');
        Database.insert(prospect);
        
        Account acct = new Account(Name = 'Test');
        acct.recordTypeId = [SELECT Id FROM RecordType WHERE Na​me = 'Person Accounts'].Id;
        Database.insert(acct);
        
        Case c = new Case(AccountId = acct.Id,
                          Subject = 'Test',
                          Origin = 'Inbound Call',
                          Reason = 'Customer Inquiries',
                          Primary_Type__c = 'Test',
                          Primary_Subtype__c = 'Test',
                          Survey_Email_Sent__c = false);
        Database.insert(c);
        c.Survey_Email_Sent__c = true;
        Database.update(c);
        
        Account acctToCheck = [SELECT Id, Last_Survey_Sent__c FROM Account WHERE Id = :acct.Id];
        System.assert(acctToCheck.Last_Survey_Sent__c != null);
    }

 

I'm getting the following error which makes no sense at all:

 

Error: Compile Error: No such column 'Na​me' on entity 'RecordType'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

I am authoring this from a System Administrator profile so I don't believe it's a FLS issue.  Any thoughts or help would be appreciated.

 

Is there a way to rename Quotes to Order Forms & Invoices?

 

Thanks,

The page that comes up when you click the Opportunity tab is .../006/o and has the New button.  I want to add a custom button on that page to launch a VF page.  I don't think there's a way to do that though.  I wanted to confirm that as there are so many obscure features in SF I want to make sure I didn't miss it.

 

Anyone know if there's a way to put a button there?

 

 

Hi good people,

I have a custom object Unresolvedemails__C which holds emails whose email addresses are not associated with any record in salesforce.I would therefore like a user to have the option of creating a new contact from these unresolved emails by selecting a record under unresolved emails list view.Once the record has been created,the unresolved email record should move from the unresolved emails object and be logged inside the Activity History object of the newly created contact record.

Here is a link with a screenshot of what i need for better understanding.

http://imagebin.org/204380

I want to deploy "name" field of a custom object from one sandbox to other sandbox. The object is already in both sandboxes. I tried using ANT tool.

 

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>COB__c.Name</members>
 <name>CustomField</name>
</types>
<version>24.0</version>
</Package>

 

I got the below error : 

 

Error: package.xml(COB__c.Name):An object 'COB__c.Name' of type CustomField was named in package.xml, but was not found in zipped directory

 

 

I have tried extracting the complete object but ANT is not extracting the "Name" filed.

<types>
<members>COB__C.Name</members>
 <name>CustomObject</name>
</types>

 

 

Please suggest how to do this

thsis i smy controller and i am unable to cover the if condition pz help me resolve the issue

 

 

public class timesheetmanagement 
{    
public String weekselection{get; set;}
public String incselection{get; set;}
Public List<Timesheet_Entry__c> tentries;
Public List<Timesheet_Entry__c> otherentries;
Public Date SelectedWeek;

 public Id oppId {get; set;}

Public void deltsheet()
{
    String rownumber = System.currentPagereference().getParameters().get('rownumber');
    Decimal rownumb = Decimal.Valueof(rownumber);
    Integer rowno = rownumb.IntValue();
    String tentryid = System.currentPagereference().getParameters().get('tentryid');
    system.debug('tentries tentryid'+tentryid);
  
    if (rownumber != '')
        tentries.remove(rowno);
       
}

public void onloadfunction()
{
    if ( weekselection != null)
    {
        SelectedWeek = date.valueOf(weekselection);  
        system.debug('The Selected Week is'+SelectedWeek);
        tentries = [select Id,Project__c,Displayfields__c,Tasks_for_Project__c,Effort__c,Week_Start_Date__c,Mon__c,Tue__c,Wed__c,Thu__c,Fri__c,Sat__c,Sun__c,Project_Task__c from Timesheet_Entry__c where Week_Start_Date__c=:SelectedWeek and Project__c!=NULL and OwnerId=:Userinfo.getUserId()];
        otherentries = [select Comments__c,Displayfields__c,Tasks_Other__c,Effort__c,Week_Start_Date__c,Mon__c,Tue__c,Wed__c,Thu__c,Fri__c,Sat__c,Sun__c,Project_Task__c from Timesheet_Entry__c where Week_Start_Date__c=:SelectedWeek and Project__c=NULL and OwnerId=:Userinfo.getUserId()];
        
    } 

Hi all!

 

I have EE and I'm trying to figure out a way to make a date/time field that updates once a record is created.  

 

I can make the date field no problem, but adding the time in is beyond me.

 

Any help is appreciated!

 

Thank you!

Hello,

In Contacts tab, i would like to create a new custom field.  Can you show me the proper syntax.

 

I want to create a field titled "OpptyStage". i suppose it will be a text field.

 

I want the value of "OpptyStage" to equal the field titled "Stage" within the Opportunity Tab.  It's also known as StageName.

 

Please show me how to create this field.

 

Ultimately whart i am trying to accomplish is filter my 1,000 contacts to list only those that are associated with an active Opportunity. To do this, my thinking is to pull in the Opportunity Stage and use that for filtering the contacts.  This will yield something like 50 contacts for me.  If you have any other suggestions of how to get this view, I am all ears.

 

Thanks for your help

Gappman

Hi All,

    I am a salesforce consultant with SFDC administrative exposure of 5 years, currently working as an SFDC administrator in a technology company based in India, supporting US Operations.

 

I have expertise in salesforceimplementation, integration,  customization and designing workflows. Out of the box thinking is my forte.

I do freelancing during evenings and weekends.

Also available to work part-time, full-time, on-site, off-site, per-project or on a time & materials basis.


Thanks & Best Regards,


Message Edited by Amitabhleo on 09-24-2007 11:29 PM

Message Edited by Amitabhleo on 07-16-2009 11:41 PM