• Mike Lee PCL
  • NEWBIE
  • 55 Points
  • Member since 2016
  • Technical Analyst

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 4
    Replies
Hello,

I'm looking into building an Alexa skill that integrates with Salesforce and I'm currently reviewing the feasibility of such a solution. The question I have right now is how/if an Alexa integration supports the profile based security within Salesforce?

I would like users to ask Alexa questions but only get responses based on the records they have access to within Salesforce. 

My knowledge of Alexa development is pretty small right now and I'm not sure if Alexa skills can be based on users? I see Alexa used in more open settings where anyone in the room can ask Alexa a question. Great for asking what the temperature is but not so good for asking about Opportunities a person is working on.

Thanks,

Mike
Hello,

I have a custom object (cust_obj) that is the detail of a master-detail relationship. Opportunity is the master.

I created a List view button that opens a VF page. The purpose of the button is to allow a user to create a new cust_obj record.

The button is shown on cust_obj's related list as seen via the Opportunity record. What I'm not sure of is how to send/tell the VF page what the parent Opportunity ID is. Currently when I click on the button the VF page will appear but it has no idea what the Opportunity is.

Does anyone know how to accomplish this? What caveat is the users of this button will be all using Lightning so ithe solution must work in LEX.

Thanks,

Mike
Hello,

I'm new to developing for Lightning and wanted to find out if it's possible to hide a button/quick action in Lightning based on the profile of the user?

I've seen examples of how to do this using VF but can't find anything about this using Lightning.

Thanks,

Mike
Hello,

I was going through the Trailhead for Lightning Components and saw a couple of methods that deal with the response from a Callback. There were response.isValid() and response.getReturnValue().

Can anyone point me in the right direction as to where I can find more not only about these two methods but any others that are applicable to service side responses? I've looked around and I haven't seen much.

Thanks,

Mike
Hello,

I'm learning Lightning Components and am going through the Trailhead challenges. I'm stumped on how one piece of functionality is working.

Within a component I see the following two snippets:

<div class="{!v.expense.Reimbursed__c == true ?
                    'slds-theme--success': 'slds-theme--warning'}">

and

<p class="slds-truncate">Reimbursed?
                         <ui:inputCheckbox value="{!v.expense.Reimbursed__c}"
                                          click="{!c.clickReimbursed}"/>

Originally I thought the click event within the ui:inputCheckbox was causing the styling to change. But when I deleted the click event code the dynamic styling was still in effect.

It looks like toggling the checkbox causes the styling of the contents under the <div> to change regardless of whether you have a click event or not under ui:inputCheckbox. How is this possible?  If you're not looking for a click event how is the click event causing the style change?

Mike
Hello. 

I have a problem with a test class where the setting up of data to prepare for the test causes a Process Builder to fire (creates a new record in CustObjA) and causes the Trigger I want to test to fire as well (Trigger on CustObjA). 

The problem is when I perform an insert of a record of CustObjA a little lower in the test class the Trigger does not run a second time. 

Essentially the Process Builder created a record in CustObjA and I'm no longer able to test my Insert Trigger because I can't get it to fire again.

Unfortunatley the record created in the Process Builder isn't usuable for my tests so I need to create a second one tailored to my needs.

Anyone else encounter this sort of issue?

Thanks,

Mike
Hello,

I have a requirement where I need to email an Approver a couple of days after an Approval was sent to them. 

I got this working with a Workflow rule. However this option didn't end up working since a couple of the approval merge fields don't get populated when they're called from within a Workflow rule.

I was thinking of creating an Apex class and scheduling it. However the issue comes when I can potentially have more than 100 of these scheduled notices which are waiting to be emailed out.

Is there a best practice when it comes to scheduling Apex within Triggers? 

Thanks,

Mike
Hello,

I've written an Apex test which tests to see if a trigger is modifying a related object or not. The goal of the trigger is to update the related record so the LastModifiedDate is updated from the previous value.

The issue I'm having is due to LastModifiedDate not having millisecond precision the old and new lastmodifieddate are the exact same values after the trigger runs. Essentially the insert/update/delete is happening too quickly for any delta to be registered.

In reality there will be hours/days in-between record updates but during the Apex test run the test is completing in less than a second.

Is there a way to somehow delay in call the test method in the future (even a second or two) so I can see a time difference during the test run?

Thanks,

MIke
Hello,

I'm developing a few classes which ultimately will send summarized Contact information to users in my org on a daily basis.

The # of emails sent daily can range from 0 - 150 depending on the values stored in the Contact records. Since the emails are tailored to each user I'm using SingleEmailMessage and not using email templates.

I read here (https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_email.htm) that if I set the targetobjectID the emails sent out don't count towards our daily limit. However in order to send the message I need to specify the SettoAddress. The same document says that setting this value does count towards the limit.

Does anyone know how I can send up to 150 emails (all to internal org users) without bumping into the 100 email SingleEmailMessage limit?

Thanks,

Mike
Hello. I'm new to Apex and am looking for some advice regarding working with data and avoiding governor limits.

Here's what I'd like to accomplish:

1. Perform a SOQL query and grab some data from Contacts (roughly 500 records in total). The 500 records will be owned by 10 people.
2. With that data in hand further divide that data into groups sorted by ownerid. For example if 50 records are owned by ownerid = 'abc' I want to somehow be able to process those 50 records
3. In this scenario processing consists of emailing out a message to the email address associated with the ownerid
3. Once the email is sent move on to the next set of records owned by the next ownerid

I'd like to schedule this to run once a day.

I was thinking I could use a map with the ownerid as the key and a Contact sObject List as the values. 

However not sure if this is something that can be scheduled???

Any help would be greatly appreciated!

Thanks,

Mike
Hello,

I'm new to using the force.com IDE for managing Salesforce metadata. I connected to my sandbox and got the following warning:

User-added image

Is there anyway to manage SharingRules metadata for example with the force.com IDE or will I need to use some sort of other tool? Mainly wanting to backup the SharingRules at this point.

Thanks,

Mike
Hello,

I'm learning Apex and one thing I've come across is storing multiple sobject types in a List. For example:

List<Contact> myList = [SELECT ID, AccountID, FirstName, LastName, Account.Name FROM Contact];

In the above ID, AccountID, FirstName, and LastName are all fields from Contact so if I system.debug myList I will see these 4 fields. I won't however see the Account.Name field. Makes sense since the Account Name is from the Account object.

Couple of questions:

1. Since myList is of type Contact I was assuming that it wouldn't be able to store any fields that aren't from Contact. How is it that Account.Name is able to be stored in a Contact List?
2. How do I extract the Account Name from each of the records stored in myList? When I perform a SOQL query in Query Editor I see the Account Names there. But I'm at a loss as to how to extract the Names via Apex.

Thanks,

Mike
Hello, I'm trying out various SOQL queries to help get me up to speed and am stumped.

I created the below query to:

1. Get 5 accounts (doesn't matter which ones)
2. For each of these Accounts bring back Opportunity id, name, and Account ID

SELECT id, Name, Account.id from Opportunity WHERE Account.id IN (SELECT Account.id FROM Account LIMIT 5)

When I execute the query I get back "Unknown Error parsing the query".

I found that hardcoding in some valid account ID's instead of using the sub select works. 

Any ideas why this wouldn't work?

Thanks,

Mike
Hello,

I was going through the Trailhead for Lightning Components and saw a couple of methods that deal with the response from a Callback. There were response.isValid() and response.getReturnValue().

Can anyone point me in the right direction as to where I can find more not only about these two methods but any others that are applicable to service side responses? I've looked around and I haven't seen much.

Thanks,

Mike
Hello,

I'm learning Lightning Components and am going through the Trailhead challenges. I'm stumped on how one piece of functionality is working.

Within a component I see the following two snippets:

<div class="{!v.expense.Reimbursed__c == true ?
                    'slds-theme--success': 'slds-theme--warning'}">

and

<p class="slds-truncate">Reimbursed?
                         <ui:inputCheckbox value="{!v.expense.Reimbursed__c}"
                                          click="{!c.clickReimbursed}"/>

Originally I thought the click event within the ui:inputCheckbox was causing the styling to change. But when I deleted the click event code the dynamic styling was still in effect.

It looks like toggling the checkbox causes the styling of the contents under the <div> to change regardless of whether you have a click event or not under ui:inputCheckbox. How is this possible?  If you're not looking for a click event how is the click event causing the style change?

Mike
Hello. I'm new to Apex and am looking for some advice regarding working with data and avoiding governor limits.

Here's what I'd like to accomplish:

1. Perform a SOQL query and grab some data from Contacts (roughly 500 records in total). The 500 records will be owned by 10 people.
2. With that data in hand further divide that data into groups sorted by ownerid. For example if 50 records are owned by ownerid = 'abc' I want to somehow be able to process those 50 records
3. In this scenario processing consists of emailing out a message to the email address associated with the ownerid
3. Once the email is sent move on to the next set of records owned by the next ownerid

I'd like to schedule this to run once a day.

I was thinking I could use a map with the ownerid as the key and a Contact sObject List as the values. 

However not sure if this is something that can be scheduled???

Any help would be greatly appreciated!

Thanks,

Mike
Hello,

I'm learning Apex and one thing I've come across is storing multiple sobject types in a List. For example:

List<Contact> myList = [SELECT ID, AccountID, FirstName, LastName, Account.Name FROM Contact];

In the above ID, AccountID, FirstName, and LastName are all fields from Contact so if I system.debug myList I will see these 4 fields. I won't however see the Account.Name field. Makes sense since the Account Name is from the Account object.

Couple of questions:

1. Since myList is of type Contact I was assuming that it wouldn't be able to store any fields that aren't from Contact. How is it that Account.Name is able to be stored in a Contact List?
2. How do I extract the Account Name from each of the records stored in myList? When I perform a SOQL query in Query Editor I see the Account Names there. But I'm at a loss as to how to extract the Names via Apex.

Thanks,

Mike
Hello, I'm trying out various SOQL queries to help get me up to speed and am stumped.

I created the below query to:

1. Get 5 accounts (doesn't matter which ones)
2. For each of these Accounts bring back Opportunity id, name, and Account ID

SELECT id, Name, Account.id from Opportunity WHERE Account.id IN (SELECT Account.id FROM Account LIMIT 5)

When I execute the query I get back "Unknown Error parsing the query".

I found that hardcoding in some valid account ID's instead of using the sub select works. 

Any ideas why this wouldn't work?

Thanks,

Mike