• RRRize
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I have a checkbox that I want updated ONLY when the address is updated.  Below is the formula I use in my workflow rule, and it works well EXCEPT, it also checks the checkbox when the address fields are blank and new address is entered.  I just want the checkbox checked when an address is already there but is changed/updated.  Here is what I have in place - please help me fix this:

 

My evaluation criteria is EVERYTIME A RECORD IS CREATED OR EDITED

My ruule criteria is RUN THIS RULE IF THE FOLLOWING FORMULA EVALUATES TO TRUE:

 

OR(
ISCHANGED( Address__c ),
ISCHANGED( City__c ),
ISCHANGED( State__c ),
ISCHANGED( Zip_Code__c ))

 

 

Thanks for your help!

  • March 30, 2012
  • Like
  • 0

I have 4 address fields (Address / City / State / Zip Code) and a checkbox (which I would like to keep hidden).

 

Is it possible to create a validation rule that will check the checkbox if an address already exists but is edited/updated in any way?  If so, please help with the code.

 

Thanks in advance.

  • February 03, 2012
  • Like
  • 0

I've created a trigger that sends out an email.  The merge fields to the custom object are hard coded into the trigger.  I would like to include in the email a link to the record where it's pulling the data for the merge fields.  Can someone provide some insight as to how I can accomplish this?

Hi.  I have a trigger that sends an email.  I have the email and merge fields in the trigger.   One of the merge fields is Sales Rep. It is being pulled from a user lookup field.  But the Sales Rep ID is displayed instead of the name.  How can I display the actual user's name instead of the ID?  Here is the line I am using in the trigger:

 

'<tr><td>Sales Representative</td><td>' + request.Sales_Representative__c + '</td></tr>'

 

Thanks for any help.

In Opportunities, I have a required custom user lookup field called Sales Representative.  I currently have a bunch of cumbersome workflow rules set up to send email as the Sales Representative specified in that lookup field. (I created org-wide email addresses for the Sales Reps).  The sales assistant almost always creates the opportunities for the sales reps.  What makes the workflows so cumbersome is that each sales assistant has multiple sales people assigned to them so I have to ake multiple workflow rules for each sales assistant.

 

I would like to create a trigger that will simply send out an email as the sales rep who is specified in the Sales Representative lookup field.  Is this possible?  If so, please expound on how to go about it.  I've been working on it with a developer here, but we have not been able to figure out how to send email AS someone else if that someone else will be different every time.

 

Please help!  Thanks!

I am trying to create a test class for a trigger in my org called UpdateAccount and failing miserably.  I'm totally new to Apex (and coding in general) so any help would be appreciated.

Let me start with the error I am getting:

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAccount: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: [] Trigger.UpdateAccount: line 8, column 9: []


Here is the test class I wrote:

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@isTest
private with sharing class TestUpdateAccount {

    static testMethod void testAccountChange(){
    
        
        Opportunity oppty = new Opportunity(Sales_Representative__c = '00570000001FDA3',
        Name = 'iPad Mania', Brand__c = 'a0OS0000002TTo6', Account=[select Name from Account where Id = '001S000000QxQpJ'], Budget_High__c = 2000,
        Amount = 200, StageName = '10% - Proposed', CloseDate = date.today(), Phase__c = 'Proposal/RFP',
        Platforms_Included__c = 'Digital', Description = 'Digital opportunity', Estimated_Campaign_Start_Date__c = date.today(), Estimated_Campaign_End_Date__c = date.today());
       
       
        Test.startTest();
        
      insert oppty;
                
       List<Account> accounts = [select Id, dclk__Advertiser_ID__c from Account where Id = '001S000000QxQpJ'];
       if(accounts != null){
           for(Account account:accounts){
               System.assert(account.dclk__Advertiser_ID__c=='7777777');
         }
       }
    
        Test.stopTest();
        
        delete oppty;
           
    
    }

}

 

Here is the trigger (which works fine by the way):

 

1
2
3
4
5
6
7
8
9
10
trigger UpdateAccount on Opportunity (after insert) {
    Map<ID, Account> updateAccountMap = new Map<ID, Account>();
    for (Opportunity oppty : [select Id, AccountId, DART_Advertiser_ID__c from Opportunity where Id in :Trigger.new order by CreatedDate]) {
        updateAccountMap.put(oppty.AccountId, new Account(Id = oppty.AccountId, dclk__Advertiser_ID__c = oppty.DART_Advertiser_ID__c));
    }

    if (!updateAccountMap.isEmpty()) {
        update updateAccountMap.values();
    }
}

 

Can anyone tell me what I'm doing wrong in the test class? Apologies for the sloppyness of it.  Thank you for any help you might bring my way! : )

I am attempting to deploy a custom object that I created in sandbox to production.  I created an outbound change set and uploaded it successfully.  I went into production and attempted to deploy the change set but it failed.  I got the following error message:

 

API Name: UpdateAccount

Problem: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required

 

UpdateAccount is a trigger, but is in no way associated with the object I am trying to move over into production.  Furthermore, there are no triggers at all associated with my object.  It's actually a pretty simple object with a few minor workflows.  Why am I getting the above error?

 

Thanks in advance.

  • April 28, 2011
  • Like
  • 0

I've created a custom object.  I'd like to enable the user to attach documents to the form before they save it.  The reason for this is that the user MUST submit this form to another department (by checking a checkbox which triggers the submission workflow).  As it stands right now, in order to attach a document to the form, the user has to do the following:

 

1. Fill out form

2. Save form

3. Attach document

4. Edit form

5. Check SUBMIT checkbox (to trigger submission of the form)

6 Save form again

 

Not very intuitive at all.  I would like for them to be able to do the following:

 

1. Fill out form

2. Attach document

3. Check Submit checkbox

4. Save

 

I was thinking that the best way to approach this would be to create a VF page that would provide the Notes & Atachments functionality.  They would launch that page from a button in the form. So...


I was wondering:

 

1. If this is even possible

2. Is this is a good solution?

3. Can you recommend a better solution?

4. If it is possible, and a good solution, can you describe what seps I should follow to achieve it?

 

Thanks in advance.

  • April 15, 2011
  • Like
  • 0

I currently have a date field that displays a date 3 days from the date the form is opened. Here is the formula I used: TODAY() + 3

 

I would like to modify the formula to show a value of 3 business days instead of 3 days.  Can someone help?


Thanks in advance.

  • March 16, 2011
  • Like
  • 0

Since it's not possible to edit the source code of standard pages, I would like to be able to see the source code of the Opportunity page so that I can copy it and paste it into a Visualforce page then add some other needed elements into it and ultimately replace the Opportunities page with it.

 

Is it possible for me to see the source code?  If so, how?


Thanks for your help.

 

 

  • March 02, 2011
  • Like
  • 0

Greetings.  I asked the Java developer in my org to create a Visualforce page that would contain a few lookup fields and a few custom fields.  The objective is to embed the page into the Opportunities page.  We managed to do this but have the following problems:

 

1. When a new Opportunity is created, the Visualforce page does not appear in the Opportunity until after the Opportunity is saved.

2. When the Visualforce appears (after the Opportunity is saved) it appears in edit mode while the Opportunity page is not in edit mode.

3. I cannot save any data in the Visualforce page.

 

We would like for the Visualforce page to appear in the Opportunity immediately as the Opportunity is created and be able to enter data in it while at the same time being able to enter data into the standard Opportunity fields.

 

Any hints or insight on what we need to do to make this happen will be hugely appreciated.  Thanks in advance!

  • March 01, 2011
  • Like
  • 0

Greetings.  I was wondering if it is possible to display fields from Opportunities in a custom object I created.  I posted here on DevForce because I'm not a developer but have a feeling formulas may be involved?  But not sure.  Any insight will be appreciated.

  • February 18, 2011
  • Like
  • 0

I already have DEVELOPMENT MODE and SHOW VIEW STATE IN DEVELOPMENT MODE checked in SETUP/PERSONAL INFORMATION.  But I am unable to see and/or edit the source code of Opportunity.  What am I missing?


Any help would be very much appreciated.

  • February 10, 2011
  • Like
  • 0

I have 4 address fields (Address / City / State / Zip Code) and a checkbox (which I would like to keep hidden).

 

Is it possible to create a validation rule that will check the checkbox if an address already exists but is edited/updated in any way?  If so, please help with the code.

 

Thanks in advance.

  • February 03, 2012
  • Like
  • 0

I've created a trigger that sends out an email.  The merge fields to the custom object are hard coded into the trigger.  I would like to include in the email a link to the record where it's pulling the data for the merge fields.  Can someone provide some insight as to how I can accomplish this?

In Opportunities, I have a required custom user lookup field called Sales Representative.  I currently have a bunch of cumbersome workflow rules set up to send email as the Sales Representative specified in that lookup field. (I created org-wide email addresses for the Sales Reps).  The sales assistant almost always creates the opportunities for the sales reps.  What makes the workflows so cumbersome is that each sales assistant has multiple sales people assigned to them so I have to ake multiple workflow rules for each sales assistant.

 

I would like to create a trigger that will simply send out an email as the sales rep who is specified in the Sales Representative lookup field.  Is this possible?  If so, please expound on how to go about it.  I've been working on it with a developer here, but we have not been able to figure out how to send email AS someone else if that someone else will be different every time.

 

Please help!  Thanks!

I am trying to create a test class for a trigger in my org called UpdateAccount and failing miserably.  I'm totally new to Apex (and coding in general) so any help would be appreciated.

Let me start with the error I am getting:

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAccount: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: [] Trigger.UpdateAccount: line 8, column 9: []


Here is the test class I wrote:

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@isTest
private with sharing class TestUpdateAccount {

    static testMethod void testAccountChange(){
    
        
        Opportunity oppty = new Opportunity(Sales_Representative__c = '00570000001FDA3',
        Name = 'iPad Mania', Brand__c = 'a0OS0000002TTo6', Account=[select Name from Account where Id = '001S000000QxQpJ'], Budget_High__c = 2000,
        Amount = 200, StageName = '10% - Proposed', CloseDate = date.today(), Phase__c = 'Proposal/RFP',
        Platforms_Included__c = 'Digital', Description = 'Digital opportunity', Estimated_Campaign_Start_Date__c = date.today(), Estimated_Campaign_End_Date__c = date.today());
       
       
        Test.startTest();
        
      insert oppty;
                
       List<Account> accounts = [select Id, dclk__Advertiser_ID__c from Account where Id = '001S000000QxQpJ'];
       if(accounts != null){
           for(Account account:accounts){
               System.assert(account.dclk__Advertiser_ID__c=='7777777');
         }
       }
    
        Test.stopTest();
        
        delete oppty;
           
    
    }

}

 

Here is the trigger (which works fine by the way):

 

1
2
3
4
5
6
7
8
9
10
trigger UpdateAccount on Opportunity (after insert) {
    Map<ID, Account> updateAccountMap = new Map<ID, Account>();
    for (Opportunity oppty : [select Id, AccountId, DART_Advertiser_ID__c from Opportunity where Id in :Trigger.new order by CreatedDate]) {
        updateAccountMap.put(oppty.AccountId, new Account(Id = oppty.AccountId, dclk__Advertiser_ID__c = oppty.DART_Advertiser_ID__c));
    }

    if (!updateAccountMap.isEmpty()) {
        update updateAccountMap.values();
    }
}

 

Can anyone tell me what I'm doing wrong in the test class? Apologies for the sloppyness of it.  Thank you for any help you might bring my way! : )

I currently have a date field that displays a date 3 days from the date the form is opened. Here is the formula I used: TODAY() + 3

 

I would like to modify the formula to show a value of 3 business days instead of 3 days.  Can someone help?


Thanks in advance.

  • March 16, 2011
  • Like
  • 0

Since it's not possible to edit the source code of standard pages, I would like to be able to see the source code of the Opportunity page so that I can copy it and paste it into a Visualforce page then add some other needed elements into it and ultimately replace the Opportunities page with it.

 

Is it possible for me to see the source code?  If so, how?


Thanks for your help.

 

 

  • March 02, 2011
  • Like
  • 0

Greetings.  I asked the Java developer in my org to create a Visualforce page that would contain a few lookup fields and a few custom fields.  The objective is to embed the page into the Opportunities page.  We managed to do this but have the following problems:

 

1. When a new Opportunity is created, the Visualforce page does not appear in the Opportunity until after the Opportunity is saved.

2. When the Visualforce appears (after the Opportunity is saved) it appears in edit mode while the Opportunity page is not in edit mode.

3. I cannot save any data in the Visualforce page.

 

We would like for the Visualforce page to appear in the Opportunity immediately as the Opportunity is created and be able to enter data in it while at the same time being able to enter data into the standard Opportunity fields.

 

Any hints or insight on what we need to do to make this happen will be hugely appreciated.  Thanks in advance!

  • March 01, 2011
  • Like
  • 0

Greetings.  I was wondering if it is possible to display fields from Opportunities in a custom object I created.  I posted here on DevForce because I'm not a developer but have a feeling formulas may be involved?  But not sure.  Any insight will be appreciated.

  • February 18, 2011
  • Like
  • 0

I already have DEVELOPMENT MODE and SHOW VIEW STATE IN DEVELOPMENT MODE checked in SETUP/PERSONAL INFORMATION.  But I am unable to see and/or edit the source code of Opportunity.  What am I missing?


Any help would be very much appreciated.

  • February 10, 2011
  • Like
  • 0