• Workhard
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 15
    Replies

I have a custom object which i have choosen open window using a visualforce page. in the Page i have javascript that should pop up a alert but it doesn't, What am i doing wrong, Thanks

I have a client who would like the ability to create one activity at the parent account level and copy it to all child accounts associated with that Parent.

 

For Instance:  The company brings on all Chic-fil-a's in Wachington DC metro) .  They want to create an activity to:  Call Manager and Discuss Marketing Plan and copy it across the Child Accounts which might be Chicfila - Chantilly, Chic-fil-a Reston, Chic-fila-Ashburn etc. 

 

I thought a custom button on the parent account page with some sort of apex trigger would work in this scenario...any ideas on how to make this work?  I'm an admin, not a developer.  I believe I have exhausted all of the native functionality option with no clear path forward.

Hi ,

 

I have created custom object accountnames and lookupfield on the accountnames object to the account object .

 

Name of the lookup field is Account__c which does a lookup to the related account and make changes to another custom field named upsellopporunity on acccount .It is not a complete trigger but while compiling I got the following error on the line in red

 

 Compile Error: Incompatible element type Id for collection of SOBJECT:AccountName__c at line 6 column 1

 

 

trigger AccountNames on AccountName__c (before insert) {
set<AccountName__c>lap=new set<AccountName__c>();
for(AccountName__c acc:trigger.new)

lap.add(acc.account__c);

}
map<id,account> must=new map<id,account>();

for(account l:[select id,name,upsellopportunity__c from account where id in:lap])
{
must.put(l.id,l);
}

for(accountname__c dry:trigger.new)
{

account asp=must.get(dry.accountname__c).upsellopportunity__c;

}
}

  • February 08, 2012
  • Like
  • 0

I have a client who would like to have three columns display in one section of their Account page layout, and I don't know the visualforce behind it! Is there simple code that would allow me to build a Visualforce page that I could use "inline" on the standard page layout?

 

Thank you!!

 

 

I'm trying to run a javascript function: box.hide(); after the "burns" records are saved. How can I use a PageReference to execute javascript, or is there another way?

 

public pageReference save(){
         insert burns;
         PageReference back = new PageReference(JAVASCRIPT GOES HERE);
         back.setRedirect(true);
         return null;
}

 

I am trying to validate a text field that should be a valid year - only numeric, only 4 digits, values from 1900 - current year.

My logic is:

OR(

IF (not(isblank(YEB__c)), Not(isnumber(YEB__c)), NULL),

IF (Len(YEB__c) <> 4, not(isblank(YEB__c)), NULL),

VALUE(YEB__c) < 1900,

VALUE(YEB__c) > year(today()) )

 

Values not between 1900 - current year is working. But Not(Isnumber(YEB__c)) or Len(YEB__c) <> 4 is not working

I tried to split things and tried these 2:

Not(Isnumber(YEB__c)) alone one time and

Len(YEB__c) < 4 alone another time.

Both compiles (allows me to save), but doesn't work in the sandbox. The simple Len(fieldname) checks shows error if left blank. But it passes even if I enter 1 digit.

Any Ideas?

  • January 24, 2012
  • Like
  • 0

Hi,

 

I have a Apex class written as below. I need help on how to write test method for the same:

 

public with sharing class Controller{

  
    
    public ApexPages.StandardController standardContactController;
        
    public Controller(ApexPages.StandardController cntrl) {
        
        standardContactController = cntrl;
      
    }
    public pageReference doSaveAll() 
    {
        
        pageReference p;
         
        try
        {
         Guest_Profile__c gp = (Guest_Profile__c)standardContactController.getRecord();
         
         standardContactController.save();
         
         
         p=new pageReference ( 'https://idsfortune-developer-edition.na12.force.com/apex/My_Profile_Edit?id='+gp.id+'&save=0');
          
        }
        catch(Exception e)
        {
        
        }
        return p;
    }
    
    
     public pageReference doEdit() 
    {
        
        pageReference p;
         
        try
        {
         Guest_Profile__c gp = (Guest_Profile__c)standardContactController.getRecord();
         
         standardContactController.edit();
         
         
         p=new pageReference ( 'https://idsfortune-developer-edition.na12.force.com/apex/My_Profile_Save?id='+gp.id+'');
          
        }
        catch(Exception e)
        {
        
        }
        return p;
    }
}

 

 

Hello,

 

I have a simple trigger on the Opportunity object that fires when an Opportunity is edited and forces an edit/save on the OpportunityLineItems associated with the Opportunity.  When I try to Data Load some bulk changes, I get the following error:

 

System.LimitException: Too many SOQL queries: 101

 

I'm fairly new to Apex code.  I believe the problem is that I am running SOQL inside a FOR loop, but I'm not quite sure how to resolve it.  My trigger is below.  Any help would be appreciated.  Thanks.

 

 

trigger UpdateDeliverables on Opportunity (after insert, after update) {
   // Forces Edit/Save on Deliverables in order to fire Workflow field Update to update quantity field with Q__c value    

FOR(Opportunity opp : Trigger.new)  {

    LIST<OpportunityLineItem> oppLine = [SELECT Id
    FROM OpportunityLineItem
    WHERE OpportunityId = :opp.Id
    AND Flat_Price__c != TRUE];
    
    IF(oppLine.size() > 0)
    update oppLine;
    }

}

I have a picklist field Send_Notification__c with two values, 'Generic', 'Individual'
Based on the picklist value selected I want a certain workflow rule to trigger.

 

I am thinking of two workflow rules one for 'Generic' and one for 'Individual'.and then have a rule criteria,

 

1st work flow rule: ISPICKVAL(Send_Notification__c,"Generic")

2nd work flow rule: ISPICKVAL(Send_Notification__c,"Individual")

 

Is there any other better approach?

I have two objects  'Building ' and 'Lease' .Lease is a child of building

 

 

I have an excel sheet with all information regrad to building and lease.

 

 

What i did is I inserted the information pertaining to 'Building' which is the Master object.All the records were inserted successfully ,Happy tilll here

 

Next when I tried to insert records for the child object 'Lease'    .I got error for all inserted records.

 

The error is like this 'Building: id value of incorrect type: XZ006'

 

 

Can anybody help me out of this cave

I'm trying to do the following in Salesforce Sites:

 

            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            String[] toAddresses = new String[] {opp.Owner.Email};
            mail.setToAddresses(toAddresses);
            mail.setOrgWideEmailAddressId('0S2B00000008OXA');

But whenever I use/set the setOrgWiseEmailAddressId Salesforce sites says that I need authorisation. I just want to change the from address in the email. Can you use organisational wide email addresses in Salesforce Sites?

  • January 17, 2012
  • Like
  • 0

What would it require to be able to add the "company" field to my various task lists?

  • January 17, 2012
  • Like
  • 0
I have developed a custom VF page for manipulating Opportunity Product sObject in addition to default page, which is also being used. I want to be able to fire after update trigger only if update to the record is originating from default page. I have created a custom field on the object that keeps track of the originating page but I'm not sure how to enforce setting field value when the update is originating from default page. Perhaps there is a better way for controlling the logic? Thanks
  • January 16, 2012
  • Like
  • 0