• Andrew Sturt
  • NEWBIE
  • 35 Points
  • Member since 2014
  • Data Architect
  • Compassion


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 12
    Replies
We're using Sesame RelationalJunction to replicated our Salesforce data into our warehouse. Unfortunately, we're seeing some rows from History tables (field history tracking tables that have the suffix "History" in their name) that have nulls in FIELD, OLDVALUE, and NEWVALUE. This only happens occasionally, and doesn't happen (as far as we can tell) with any other fields in these or any other tables. 

It seems like we're getting rows that have been created but are waiting to have the field name and old and new values entered. Is the populating of those fields a second action under the hood in Salesforce? With no LastModifiedDate field on the History, our replication tool is not going to repull the record unless we manually tell it to do so, which is our current (and unsatisfactory) fix. We're working on automating that process, but if we understood why this was happening, we might be able to avoid it in the first place.
I'm trying to get the values of certain attributes from a list into a map. The first bit of code below is not my actual code, I'm just trying to explain what I'm trying to do so I can find out if it's actually possible in APEX.

Assuming the list has more than one field in it (in my example below there are four: ID, Name, MyValue, and OwnerId ), is there a way to reference the ID and MyValue fields so I can insert them into a map rather than inserting the whole sObject? In the real code, my list is passed in from another class and I'd like to put it into a map with just the ID and one field.
List<MyObject__c> l = [SELECT ID, Name, MyValue, OwnerId FROM MyObject__c]; 

// I can do this...
Map<ID, MyObject__c> m = New Map<ID, MyObject__c>(l);  

// What I want to do is this...
Map<ID, String> m = New Map<ID, String>(l.ID, l.MyValue); 

As I know someone will ask for it, here's the actual code I'm trying to replace:
Map<ID, String> BenStatusMap = new Map<ID, String>();
        for(Commitment__c CurrRec: lstNewRecords) {
            BenStatusMap.put(CurrRec.Fund_Id__c, CurrRec.Status__c);
        }

First it creates the map, then it iterates through the list to populate the map. This seems very wasteful to me, and I can't help but think there must be a way to do this with less code. That's my goal, to do the same thing with less code.

Can anyone help me?
Please don't answer this question with code. I can find code online. What I need help with is more basic than that.

The "Implementing Global Actions with Visualforce Pages" challenge asks you to create a page with your user info on it, then add a field to enter an email address so that you can click a "Send" button to send the page to that email address.

Assuming I need to write APEX to send the actual email, what do you think I should send in the email? Is there actually a way to embed the page in the email, or do you think they're just asking for the same content (my user info)? Has anyone actually completed this challenge? It seems really vague to me.

 
I have a very simple page. Here's the code for that:
<apex:page>
   {!$user.firstname} {!$user.lastname} <br></br>
   {!$user.email} <br></br>
   {!$user.phone} <br></br>
   {!$user.title} 
</apex:page>
I need to add a button to send the page's content in an email.

How do I do that?
Hi, I could use some help on the "​Implementing Global Actions with Visualforce Pages" challenge.

I'm okay with every step but the last one: "The page should have an input field to enter an email address and a 'Send' button that allows users to quickly email their contact information to others. Implementing this requirement is optional for passing this challenge."

I have no idea how to send the page as an email. Is there some really simple way of doing this that I'm just missing, or do I need to write an APEX class and method to accomplish this part of the challenge?
I have a master-detail relationship with three records on the detail side. I can see the records in the related list, but my rollup summary never shows anything other than zero. I have tried checking the "Force a mass recalculation of this field" option, but I still get zero. I have "All records should be included in the calculation" selected, so there is no filter criteria. I'm logged in as the administrator, so I don't think it's a permissions issue.

Anyone have any ideas why I am not getting the counts I want?
We're having errors when trying to access APIs. I've heard (although I can't find documentation about it) that one user account is limited to five concurrent sessions. Is that true? If so, we may be trying to make too many connections at one time.
I'm trying to get the values of certain attributes from a list into a map. The first bit of code below is not my actual code, I'm just trying to explain what I'm trying to do so I can find out if it's actually possible in APEX.

Assuming the list has more than one field in it (in my example below there are four: ID, Name, MyValue, and OwnerId ), is there a way to reference the ID and MyValue fields so I can insert them into a map rather than inserting the whole sObject? In the real code, my list is passed in from another class and I'd like to put it into a map with just the ID and one field.
List<MyObject__c> l = [SELECT ID, Name, MyValue, OwnerId FROM MyObject__c]; 

// I can do this...
Map<ID, MyObject__c> m = New Map<ID, MyObject__c>(l);  

// What I want to do is this...
Map<ID, String> m = New Map<ID, String>(l.ID, l.MyValue); 

As I know someone will ask for it, here's the actual code I'm trying to replace:
Map<ID, String> BenStatusMap = new Map<ID, String>();
        for(Commitment__c CurrRec: lstNewRecords) {
            BenStatusMap.put(CurrRec.Fund_Id__c, CurrRec.Status__c);
        }

First it creates the map, then it iterates through the list to populate the map. This seems very wasteful to me, and I can't help but think there must be a way to do this with less code. That's my goal, to do the same thing with less code.

Can anyone help me?
We're using Sesame RelationalJunction to replicated our Salesforce data into our warehouse. Unfortunately, we're seeing some rows from History tables (field history tracking tables that have the suffix "History" in their name) that have nulls in FIELD, OLDVALUE, and NEWVALUE. This only happens occasionally, and doesn't happen (as far as we can tell) with any other fields in these or any other tables. 

It seems like we're getting rows that have been created but are waiting to have the field name and old and new values entered. Is the populating of those fields a second action under the hood in Salesforce? With no LastModifiedDate field on the History, our replication tool is not going to repull the record unless we manually tell it to do so, which is our current (and unsatisfactory) fix. We're working on automating that process, but if we understood why this was happening, we might be able to avoid it in the first place.
I'm trying to get the values of certain attributes from a list into a map. The first bit of code below is not my actual code, I'm just trying to explain what I'm trying to do so I can find out if it's actually possible in APEX.

Assuming the list has more than one field in it (in my example below there are four: ID, Name, MyValue, and OwnerId ), is there a way to reference the ID and MyValue fields so I can insert them into a map rather than inserting the whole sObject? In the real code, my list is passed in from another class and I'd like to put it into a map with just the ID and one field.
List<MyObject__c> l = [SELECT ID, Name, MyValue, OwnerId FROM MyObject__c]; 

// I can do this...
Map<ID, MyObject__c> m = New Map<ID, MyObject__c>(l);  

// What I want to do is this...
Map<ID, String> m = New Map<ID, String>(l.ID, l.MyValue); 

As I know someone will ask for it, here's the actual code I'm trying to replace:
Map<ID, String> BenStatusMap = new Map<ID, String>();
        for(Commitment__c CurrRec: lstNewRecords) {
            BenStatusMap.put(CurrRec.Fund_Id__c, CurrRec.Status__c);
        }

First it creates the map, then it iterates through the list to populate the map. This seems very wasteful to me, and I can't help but think there must be a way to do this with less code. That's my goal, to do the same thing with less code.

Can anyone help me?
Please don't answer this question with code. I can find code online. What I need help with is more basic than that.

The "Implementing Global Actions with Visualforce Pages" challenge asks you to create a page with your user info on it, then add a field to enter an email address so that you can click a "Send" button to send the page to that email address.

Assuming I need to write APEX to send the actual email, what do you think I should send in the email? Is there actually a way to embed the page in the email, or do you think they're just asking for the same content (my user info)? Has anyone actually completed this challenge? It seems really vague to me.

 
Hi, I could use some help on the "​Implementing Global Actions with Visualforce Pages" challenge.

I'm okay with every step but the last one: "The page should have an input field to enter an email address and a 'Send' button that allows users to quickly email their contact information to others. Implementing this requirement is optional for passing this challenge."

I have no idea how to send the page as an email. Is there some really simple way of doing this that I'm just missing, or do I need to write an APEX class and method to accomplish this part of the challenge?
I'm getting an error when checking the Using Visualforce Pages in Page Layouts and Mobile Cards challenge. The error says that the page isn't evaluating the 'Prospecting' stage, yet the code works when I insert an Opportunity Id where the Stage = Prospecting.

The code:
<apex:page docType="html-5.0" standardController="Opportunity">
    <style>
    </style>
    
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Opportunity" fields="Id,StageName" />
    </apex:remoteObjects>
    
    <div class="myPage">
        <h2>Tip for when you're in the {!Opportunity.StageName} Stage:</h2>
        <p id="stageTip" />
    </div>
    
    <script>
        var opportunityStage = "{!Opportunity.StageName}";
        document.getElementById("stageTip").innerHTML = createStageTip();
        
        function createStageTip() {
            if(opportunityStage){
                switch(opportunityStage){
                    case "Prospecting":
                        return "You need to ask really good questions"
                        break;
                    case "Needs Analysis":
                        return "Determine the needs by asking really good questions"
                        break;
                    case "Proposal/Price Quote":
                        return "Make sure the price doesn't exceed the budget"
                        break;
                    case "Negotiation/Review":
                        return "Maybe go down, but don't go down too much"
                        break;
                    default:
                        return "Use your best judgement";
                }
            }
        }
    </script>
</apex:page>
If you have any ideas as to why this isn't working, I'd love to hear them.

Cheers,
Justin
 
  • December 07, 2015
  • Like
  • 1
I have a master-detail relationship with three records on the detail side. I can see the records in the related list, but my rollup summary never shows anything other than zero. I have tried checking the "Force a mass recalculation of this field" option, but I still get zero. I have "All records should be included in the calculation" selected, so there is no filter criteria. I'm logged in as the administrator, so I don't think it's a permissions issue.

Anyone have any ideas why I am not getting the counts I want?
We're having errors when trying to access APIs. I've heard (although I can't find documentation about it) that one user account is limited to five concurrent sessions. Is that true? If so, we may be trying to make too many connections at one time.
Is there any tool available through which we can review Apex code?