• Susannah P
  • NEWBIE
  • 20 Points
  • Member since 2015
  • Senior Business Analyst - Salesforce.com
  • Boston Scientific


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    Replies
I'm trying to follow the following documentation to retrieve info about my batch job: https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_batches_get_info_all.htm

When I try to execute the GET request in the REST Explorer in workbench, I get the error "Unable to find session Id". What am I doing wrong?

User-added image
Hi! I'm stuck on a bit of code that I hope someone might be able to help me with. Here's the problem I'm trying to solve:
 
I want to fill in 3 lookup fields on my custom object called "Approver 1", "Approver 2", "Approver 3". These custom fields are a lookup to the user record. I've created a custom metadata definition to store the mapping of owner of the record, to these approvers. Since custom metadata does not support entity definitions to the user record, I used a text field to store the owner Full name, Approver 1 full name, etc.
 
I've created a trigger and trigger handler to fill in these fields whenever a record is created. I'm stuck though in figuring out how to match up my custom metadata with the records being inserted. Essentially, for every record that is being inserted I want to see if there is a reference to the owner name in my custom metadata. If there is a match, I want the approver 1 lookup field on my custom object to be filled with the user that corresponds to the full name I put in my custom metadata. Here's what I have so far.


User-added image
 
I've attached a screenshot, and here's the gist: https://gist.github.com/Sunnydalelow/87cd1d66e1ac1c68f8f15f3390309749#file-gistfile1-txt

Here's a sample of one of my custom metadata records:
User-added image
I'm trying to follow the following documentation to retrieve info about my batch job: https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_batches_get_info_all.htm

When I try to execute the GET request in the REST Explorer in workbench, I get the error "Unable to find session Id". What am I doing wrong?

User-added image
I got following error: 
The BoatReviews component doesn't have an event handler registered with aura:handler that reloads data from Apex any time the value of the component’s boat attribute is changed
Hi! I'm stuck on a bit of code that I hope someone might be able to help me with. Here's the problem I'm trying to solve:
 
I want to fill in 3 lookup fields on my custom object called "Approver 1", "Approver 2", "Approver 3". These custom fields are a lookup to the user record. I've created a custom metadata definition to store the mapping of owner of the record, to these approvers. Since custom metadata does not support entity definitions to the user record, I used a text field to store the owner Full name, Approver 1 full name, etc.
 
I've created a trigger and trigger handler to fill in these fields whenever a record is created. I'm stuck though in figuring out how to match up my custom metadata with the records being inserted. Essentially, for every record that is being inserted I want to see if there is a reference to the owner name in my custom metadata. If there is a match, I want the approver 1 lookup field on my custom object to be filled with the user that corresponds to the full name I put in my custom metadata. Here's what I have so far.


User-added image
 
I've attached a screenshot, and here's the gist: https://gist.github.com/Sunnydalelow/87cd1d66e1ac1c68f8f15f3390309749#file-gistfile1-txt

Here's a sample of one of my custom metadata records:
User-added image
Thanks to the Trailhead module regarding APEX Rest callout I know how to post "mighty moose" to an endpoint ;-)

I am wondering how I can create and send a JSON string based on Salesforce fields. For example I want to send a case to an external system via a REST Post method with the following field mapping:
Ticket Number = CaseNumber
Ticket Status = Status
Ticket Priority = Priority

How would I change the request.setBody('{"name":"mighty moose"}'); line to succesfully generate the required JSON code for the external system?
Hi All, 

Maybe I am missing something but I am going around in cirlces with the Contacts without Hobbies report. I have: 

1. Created a custom report type to get Contacts without hobbies 
2. Created an Account Value bucket field
3. Create a % Open Opps Formula 
4. Added First Name, Last Name, Total Opp Value, Open Opp Value, Phone, Email, %Open Opps to the report 
5. Summarised by Account Value then Account 

And im still getting an error: 

Challenge Not yet complete... here's what's wrong: The 'Contacts Without Hobbies' report is not configured correctly.

I have added screenshots of all the pieces - hoping someone else has hit this issue 

User-added image

User-added image

User-added image

User-added image
public class VerifyDate {
//method to handle potential checks against two dates
public static Date CheckDates(Date date1, Date date2) {
//if date2 is within the next 30 days of date1, use date2. Otherwise use the end of the month
if(DateWithin30Days(date1,date2)) {
return date2;
} else {
return SetEndOfMonthDate(date1);
}
}
//method to check if date2 is within the next 30 days of date1
private static Boolean DateWithin30Days(Date date1, Date date2) {
//check for date2 being in the past
if( date2 < date1) { return false; }
//check that date2 is within (>=) 30 days of date1
Date date30Days = date1.addDays(30); //create a date 30 days away from date1
if( date2 >= date30Days ) { return false; }
else { return true; }
}
//method to return the end of the month of a given date
private static Date SetEndOfMonthDate(Date date1) {
Integer totalDays = Date.daysInMonth(date1.year(), date1.month());
Date lastDay = Date.newInstance(date1.year(), date1.month(), totalDays);
return lastDay;
}
}

I need test class for this class.Please provide me
Choosing the profile picture in the developer community salesforce, the picture that we upload is uploading blurred.

I have tried uploading 2mb to 8mb, but still blurred.

Hi
I have developed a contact role functionality for custom object. I want to implement radio button functionality. I have used input type radio in my vf page and bind it with "primary___c" field which a custom checkbox field on custom contact role object.
Here

User-added image
User-added image

Here , I have selected Hartley Davidson as a "primary" contact in first screenshot and it should be checked as primary in the related list of contact role as highlighted in second screenshot.

Please provide assistance.

Thanks in advance.



 

I'm working through Expenses example in the Dev Guide and see "v." and "c." in several locations but they aren't things that are declare anywhere.

Are these well-known objects that have to be referenced via "v" and "c"?  Like mayb "v" is view and "c" is controller" or something like that?

I'm curious if the code could be altered and the "v." and "c." terms could be changed if they are declared somewhere or if I'm coding in this style, must I use objects referred to by the specific named "v" and "c".

I use the password flow to get the access token like this:

 

curl -k https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=[clientid]" -d "client_secret=[clientsecret]" -d "username=[myusername]" -d "password=[mypassword][mysecuritytoken]"

 

which returns

 

{"id":"https://login.salesforce.com/id/00Di0000000JgfhEAC/005i0000000dbdwAAA",
"issued_at":"1366942091291",
"instance_url":"https://na15.salesforce.com",
"signature":"yZsqE5VvYAZb+2dVw2zUNFsTllZxy9JjZBMFxYIGcAI=",
"access_token":"00D...vZ1"}

 

Then I do

 

curl -k https://na15.salesforce.com/services/data/v27.0/chatter/users/me -H 'Authorization: Bearer 00D...vZ1'

 

but I get this error response:

 

[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

curl: (6) Could not resolve host: Bearer
curl: (6) Could not resolve host: 00D...vZ1'

 

Any idea of what is wrong?

 

  • April 26, 2013
  • Like
  • 0