• slipton
  • NEWBIE
  • 0 Points
  • Member since 2012

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

I'm trying to use a wide home page component to show a grid of images that I have stored in documents, as well as link them to files stored in files.  This has worked in the past correct with one central image and then a grid of 4 below.  I've been trying to add a 5th using the same format and it's completely screwing up.  Please keep in mind that my html knowledge is simple at best and I patched together this code from research I did.


Here's the code:

 

<div style="text-align: center;"><a href="https://na5.salesforce.com/06970000000GX0h" style="font-size: 10pt;"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLY&amp;oid=00D70000000McMs&amp;lastMod=1386022465000" alt="XXX Dashboard" align="center"></a></div><br><a href="https://na5.salesforce.com/06970000000GWzj"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLd&amp;oid=00D70000000McMs&amp;lastMod=1386022490000" alt="XXX Dashboard" align="left" width="49%"></a><a href="https://na5.salesforce.com/06970000000GX0X"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iM2&amp;oid=00D70000000McMs&amp;lastMod=1386022566000" alt="XXX Dashboard" align="right" width="49%"></a><br><br><br><br><br><a href="https://na5.salesforce.com/06970000000GWzt"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iM7&amp;oid=00D70000000McMs&amp;lastMod=1386022585000" alt="XXX Dashboard" align="left" width="49%"></a><a href="https://na5.salesforce.com/06970000000GX03"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLn&amp;oid=00D70000000McMs&amp;lastMod=1386022536000" alt="XXX Dashboard" align="right" width="49%"></a><a href="https://na5.salesforce.com/06970000000GX0N"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLi&amp;oid=00D70000000McMs&amp;lastMod=1386022517000" alt="XXX Dashboard" align="right" width="49%"></a>

 

 

And here is how the grid of images turns out.  I can't for the life of me explain what's going on in the middle there.  (I've removed some sensitive information)

 

Screenshot

Hi,


I've used roll up fields, formula fields and workflow rules to come up with a solution to the below requirement yet it seems to only work on some accounts and I can't work out why!

 

Requirement:  Show the Renewal Date (a custom date field on opportunity) on the account object for the opportunity that has the largest amount.


What I've done to solve it so far:

 

- A roll-up summary on the account for the max opportunity amount.

- A formula field ("Largest Amount Indicator") on the opportunity that checks the account max opportunity amount and compares it to the opportunity amount.  If they are equal, it's set to 1.  If not, 0.  This works on some opps but not others for some reason.

- I then have a roll-up summary on the account object for the min date where the opportunity "Largest Amount Indicator" equals 1.

- I also have a workflow rule updating a text field on the opportunity with the same value as the "Largest Amount Indicator" formula field as the roll-up summaries don't let me reference formula fields.  This update is happening everytime an opportunity is edited/created and its created date is not equal to NULL.

- As a note, I have multi currency on but not Advanced Currency management.

 

As I said above, the Key Renewal Date on account is sometimes working but other times it's not.  The Max Opportunity amount always works and I can see that on each account.  When I go into the corresponding opportunity to check that the Largest Amount Indicator is showing a 1, it shows zero, even though the amount is equal to the Max Opportunity amount on the account.

 

I'm stumped.  I hope what I've written makes sense.  My solution seems sound to me and it's verified by it working on some accounts but I can't for the life of me work out why others aren't working.  An extra brain is surely appreciated here.

I'm brand new to triggers and apex so I'm tending to borrow code snippets from blogs and websites and trying to appropriate them for my org.  I found two classes that help me easily add lookup roll up summary fields to objects.  The classes are listed here:  https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries/tree/master/classes

 

I then used the example on that site to create a lookup roll up summary field trigger in my sandbox which worked perfectly.  The problem is I'm unable to deploy it to my production environment as I keep receiving 17 or so instances of the below error:

 

"Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OppRollup: 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.OppRollup:..."

 

The OppRollup Trigger is as follows:

 

"trigger OppRollup on Opportunity (after insert, after update, 
                                        after delete, after undelete) {
      // modified objects whose parent records should be updated
     Opportunity[] objects = null;   

     if (Trigger.isDelete) {
         objects = Trigger.old;
     } else {
        /*
            Handle any filtering required, specially on Trigger.isUpdate event. If the rolled up fields
            are not changed, then please make sure you skip the rollup operation.
            We are not adding that for sake of similicity of this illustration.
        */
        objects = Trigger.new;
     }

     /*
      First step is to create a context for LREngine, by specifying parent and child objects and
      lookup relationship field name
     */
     LREngine.Context ctx = new LREngine.Context(Contact.SobjectType, // parent object
                                            Opportunity.SobjectType,  // child object
                                            Schema.SObjectType.Opportunity.fields.key_broker_contact__c // relationship field name
                                            );     
     /*
      Next, one can add multiple rollup fields on the above relationship. 
      Here specify 
       1. The field to aggregate in child object
       2. The field to which aggregated value will be saved in master/parent object
       3. The aggregate operation to be done i.e. SUM, AVG, COUNT, MIN/MAX
     */
     ctx.add(
            new LREngine.RollupSummaryField(
                                            Schema.SObjectType.Contact.fields.OppCount__c,
                                            Schema.SObjectType.Opportunity.fields.Amount,
                                            LREngine.RollupOperation.Count 
                                         ));                                       

     /* 
      Calling rollup method returns in memory master objects with aggregated values in them. 
      Please note these master records are not persisted back, so that client gets a chance 
      to post process them after rollup
      */ 
     Sobject[] masters = LREngine.rollUp(ctx, objects);    

     // Persiste the changes in master
     update masters;"

 

As I said I'm brand new to Apex although I do have some education in Java and C++.  Any ideas?  I think I have to put something in the first ELSE statement although I've no idea where to start.  Hopefully a solution here will help me fix many of my deployment issues as I've seen this error message a lot.

 

Thanks in advance!

I feel like I'm going crazy here.  The first two validation rules below work fine when used individually:

 

AND(
$Profile.Name != 'Profile 1',
ISCHANGED( RecordTypeId ))

 

--

 

AND(
$Profile.Name != 'System Administrator',
ISCHANGED( RecordTypeId ))

 

Yet the below throws the error, either when logged in as System Administrator or as Profile 1.  

 

AND(
OR(
$Profile.Name != 'System Administrator',
$Profile.Name != 'Profile 1'),
ISCHANGED( RecordTypeId ))

 

I can't seem to work it out yet I get the feeling it's going to be a simple solution.  Thanks in advance for the help.

I'm trying to use a wide home page component to show a grid of images that I have stored in documents, as well as link them to files stored in files.  This has worked in the past correct with one central image and then a grid of 4 below.  I've been trying to add a 5th using the same format and it's completely screwing up.  Please keep in mind that my html knowledge is simple at best and I patched together this code from research I did.


Here's the code:

 

<div style="text-align: center;"><a href="https://na5.salesforce.com/06970000000GX0h" style="font-size: 10pt;"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLY&amp;oid=00D70000000McMs&amp;lastMod=1386022465000" alt="XXX Dashboard" align="center"></a></div><br><a href="https://na5.salesforce.com/06970000000GWzj"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLd&amp;oid=00D70000000McMs&amp;lastMod=1386022490000" alt="XXX Dashboard" align="left" width="49%"></a><a href="https://na5.salesforce.com/06970000000GX0X"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iM2&amp;oid=00D70000000McMs&amp;lastMod=1386022566000" alt="XXX Dashboard" align="right" width="49%"></a><br><br><br><br><br><a href="https://na5.salesforce.com/06970000000GWzt"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iM7&amp;oid=00D70000000McMs&amp;lastMod=1386022585000" alt="XXX Dashboard" align="left" width="49%"></a><a href="https://na5.salesforce.com/06970000000GX03"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLn&amp;oid=00D70000000McMs&amp;lastMod=1386022536000" alt="XXX Dashboard" align="right" width="49%"></a><a href="https://na5.salesforce.com/06970000000GX0N"><img src="https://c.na5.content.force.com/servlet/servlet.ImageServer?id=015700000024iLi&amp;oid=00D70000000McMs&amp;lastMod=1386022517000" alt="XXX Dashboard" align="right" width="49%"></a>

 

 

And here is how the grid of images turns out.  I can't for the life of me explain what's going on in the middle there.  (I've removed some sensitive information)

 

Screenshot

Hi,


I've used roll up fields, formula fields and workflow rules to come up with a solution to the below requirement yet it seems to only work on some accounts and I can't work out why!

 

Requirement:  Show the Renewal Date (a custom date field on opportunity) on the account object for the opportunity that has the largest amount.


What I've done to solve it so far:

 

- A roll-up summary on the account for the max opportunity amount.

- A formula field ("Largest Amount Indicator") on the opportunity that checks the account max opportunity amount and compares it to the opportunity amount.  If they are equal, it's set to 1.  If not, 0.  This works on some opps but not others for some reason.

- I then have a roll-up summary on the account object for the min date where the opportunity "Largest Amount Indicator" equals 1.

- I also have a workflow rule updating a text field on the opportunity with the same value as the "Largest Amount Indicator" formula field as the roll-up summaries don't let me reference formula fields.  This update is happening everytime an opportunity is edited/created and its created date is not equal to NULL.

- As a note, I have multi currency on but not Advanced Currency management.

 

As I said above, the Key Renewal Date on account is sometimes working but other times it's not.  The Max Opportunity amount always works and I can see that on each account.  When I go into the corresponding opportunity to check that the Largest Amount Indicator is showing a 1, it shows zero, even though the amount is equal to the Max Opportunity amount on the account.

 

I'm stumped.  I hope what I've written makes sense.  My solution seems sound to me and it's verified by it working on some accounts but I can't for the life of me work out why others aren't working.  An extra brain is surely appreciated here.

we have one standard object Account and custom object territory mapping. In territory mapping object contains two fields postcode and territory. In Account object i have postcode. Account postcode is key.By using this key i have to display territory value in territory formula field in Account.Depend upon Account object postcode the territory formula field should be populated. The territory formula field value should be matched the territory field in territory mapping object.Please help this issue.

I'm brand new to triggers and apex so I'm tending to borrow code snippets from blogs and websites and trying to appropriate them for my org.  I found two classes that help me easily add lookup roll up summary fields to objects.  The classes are listed here:  https://github.com/abhinavguptas/Salesforce-Lookup-Rollup-Summaries/tree/master/classes

 

I then used the example on that site to create a lookup roll up summary field trigger in my sandbox which worked perfectly.  The problem is I'm unable to deploy it to my production environment as I keep receiving 17 or so instances of the below error:

 

"Failure Message: "System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, OppRollup: 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.OppRollup:..."

 

The OppRollup Trigger is as follows:

 

"trigger OppRollup on Opportunity (after insert, after update, 
                                        after delete, after undelete) {
      // modified objects whose parent records should be updated
     Opportunity[] objects = null;   

     if (Trigger.isDelete) {
         objects = Trigger.old;
     } else {
        /*
            Handle any filtering required, specially on Trigger.isUpdate event. If the rolled up fields
            are not changed, then please make sure you skip the rollup operation.
            We are not adding that for sake of similicity of this illustration.
        */
        objects = Trigger.new;
     }

     /*
      First step is to create a context for LREngine, by specifying parent and child objects and
      lookup relationship field name
     */
     LREngine.Context ctx = new LREngine.Context(Contact.SobjectType, // parent object
                                            Opportunity.SobjectType,  // child object
                                            Schema.SObjectType.Opportunity.fields.key_broker_contact__c // relationship field name
                                            );     
     /*
      Next, one can add multiple rollup fields on the above relationship. 
      Here specify 
       1. The field to aggregate in child object
       2. The field to which aggregated value will be saved in master/parent object
       3. The aggregate operation to be done i.e. SUM, AVG, COUNT, MIN/MAX
     */
     ctx.add(
            new LREngine.RollupSummaryField(
                                            Schema.SObjectType.Contact.fields.OppCount__c,
                                            Schema.SObjectType.Opportunity.fields.Amount,
                                            LREngine.RollupOperation.Count 
                                         ));                                       

     /* 
      Calling rollup method returns in memory master objects with aggregated values in them. 
      Please note these master records are not persisted back, so that client gets a chance 
      to post process them after rollup
      */ 
     Sobject[] masters = LREngine.rollUp(ctx, objects);    

     // Persiste the changes in master
     update masters;"

 

As I said I'm brand new to Apex although I do have some education in Java and C++.  Any ideas?  I think I have to put something in the first ELSE statement although I've no idea where to start.  Hopefully a solution here will help me fix many of my deployment issues as I've seen this error message a lot.

 

Thanks in advance!

I feel like I'm going crazy here.  The first two validation rules below work fine when used individually:

 

AND(
$Profile.Name != 'Profile 1',
ISCHANGED( RecordTypeId ))

 

--

 

AND(
$Profile.Name != 'System Administrator',
ISCHANGED( RecordTypeId ))

 

Yet the below throws the error, either when logged in as System Administrator or as Profile 1.  

 

AND(
OR(
$Profile.Name != 'System Administrator',
$Profile.Name != 'Profile 1'),
ISCHANGED( RecordTypeId ))

 

I can't seem to work it out yet I get the feeling it's going to be a simple solution.  Thanks in advance for the help.