You need to sign in to do that
Don't have an account?

Stuck on Module 2 Challenge - Create a process to update child record when the parent is updated.
You've been given a requirement to keep Contact addresses in sync with the Account they belong to. Use Process Builder to create a new process that updates all child Contact addresses when the address of the Account record is updated. This process:Can have any name.
Must be activated.
Must update Contact mailing address fields (Street, City, State, Post Code, Country) when the parent Account shipping address field values are updated.
I start with Accounts when records is created or edited.
Filter criteria where accounts shipping address (street, city, state, zip code) is changed (used "or" logic).
I am stuck on the next step "add action". I started with action type "Update Records".
On objects, I can't seem to change Accounts to Contacts. Why?

Using API's without authentication
i'm currently working on an native Android app for my company and ran into some problems with Salesforce lately.
I hope i can find some help here.
What i want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)
The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.
The problem i'm facing is that i can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login.
Which API is the best to use in this case?
It would be so awsome if anybody could help me with this problem.
What i tried so far:
- SalesforceMobileSDK: If i extend SalesForceApplication i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method "peekUnauthenticatedRestClient", but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practically for my Use-case.
- I feel like i read nearly all docs about salesforce api, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.
- would a salesforce-apex method which would select all records inside a set radius around the user's location be accessable without authentication?
Thanks for your help in advance!
Roman

1) Write a Restservice to expose your data.
@RestResource(urlMapping='/Account') global with sharing class MyRestResource { @HttpGet global static List<Account> doGet() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; List< Account> result = [SELECT Id, Name, Business,Location FROM Account ]; return result; } }
2) Create a Community and provide access to apex class and account object to the Guest user profile.
Samplecommunity url -> https://somedomain.cs16.force.com/communityname
3) Go to workbench and test your API using rest explorer
relative url -> /services/apexrest/Account
4) Your public url will now be https://somedomain.cs16.force.com/communityname/services/apexrest/Account
Mark as Best Answer if it helps.
Thanks,
Santosh

report formula help

update the formula custom sumary formula like below:
Formula: PREVGROUPVAL(Total:SUM, TYPE) - Total:SUM
Classic Report Screenshot:
Lightning Report Screenshot:
And Final Ouput will be like below:
Thanks,
Maharajan.C

Remotely logging off all users from a Field Service Mobile application
Is there a simple way how to do this, or do I have to revoke all users OAuth connections to the app?





Pushing source to scratch org fails: Illegal Request - You have sent us an Illegal URL or an improperly formatted request.
Have some code in VS Code, received from a scratch org with enabled Community(Digital Experiences). Want this to push to a new scratch org. "Push Source to Default Scratch Org" always fails with exit code 1
SfdxError:
<html> <body>
<table cellspacing=10><tr><td><span style="font-weight: bold; font-size: 12pt;">Illegal Request</span></td></tr>
<tr<td>You have sent us an Illegal URL or an improperly formatted request.</td></tr>
<tr><td></td></tr></table>
<!-- Body events -->
<script type="text/javascript">function bodyOnLoad(){if(window.PreferenceBits){window.PreferenceBits.prototype.csrfToken="null";};}function bodyOnBeforeUnload(){}function bodyOnFocus(){}function bodyOnUnload(){}</script></body></html>
Tried a lot, but still have no clue: minimal project-scratch-dev.json, CLI latest version (7.92) and also an older; Has someone an idea where to look for error reason? Any help would be greatly appreciated.

https://github.com/forcedotcom/cli/issues/860
As one the contributors commented, switching from REST to SOAP will help get past the issue -
sfdx config:set restDeploy=false
Else, you can also downgrade the plugin version to 50.13.3 (Works for me) -
sfdx plugins:install salesforcedx@50.13.3

Advance Apex Specialist Step 6 - Stuck on that challenge
I am getting proper response....and implemented trigger, Product2Helper and AnnouncementQueable class as per the trailhead
Follwoing is my code -
product2Trigger --->
trigger product2Trigger on Product2 (after update) {
Product2Helper.AfterUpdate((List<Product2>)trigger.new,(List<Product2>)trigger.old);
}
Product2Helper Class ---->
public class Product2Helper {
/**
* @name COLLABORATION_GROUP
* @description List of CollaborationGroup used in both business and test logic
**/
static List<CollaborationGroup> COLLABORATION_GROUP = [
SELECT Id
FROM CollaborationGroup
WHERE Name = :Constants.INVENTORY_ANNOUNCEMENTS
OR Name = :('TEST'+Constants.INVENTORY_ANNOUNCEMENTS)
LIMIT 1
];
/**
* @name afterUpdate
* @description called by product2 Trigger on After Update
* @param List<Product2> newList
* @param List<Product2> oldList
**/
public static void AfterUpdate(List<Product2> prodList, List<Product2> prodOldList){
//ToDo: Declare a List of Product2 records named needsAnnouncement
//ToDo: Declare a Map of Strings to Inventory_Setting__mdt records
//ToDo: Loop through a query of Inventory_Setting__mdt records and populate the Map with Name as the key
//ToDo: Loop through the Products in newList
// Use the corresponding Inventory Setting record to determine the correct Low Quantity Alert
// If the Product's Quantity Remaining has been changed to less than the Low Quantity Alert
// add it to the needsAnnouncement list
//ToDo: Pass records to the postAlerts method
List<Product2> needsAnnouncement = new List<Product2>();
Map<String,Inventory_Setting__mdt> mapInventory = new Map<String,Inventory_Setting__mdt>();
for(Inventory_Setting__mdt inv : [select id, DeveloperName, Low_Quantity_Alert__c from Inventory_Setting__mdt]){
mapInventory.put(inv.DeveloperName,inv);
}
for(integer i=0;i<prodList.size();i++)
{
if(mapInventory.get(prodList[i].Family).Low_Quantity_Alert__c > prodList[i].Quantity_Remaining__c &&
mapInventory.get(prodList[i].Family).Low_Quantity_Alert__c <= prodOldList[i].Quantity_Remaining__c)
{
needsAnnouncement.add(prodList[i]);
}
}
PostAlerts(needsAnnouncement);
}
/**
* @name postAlerts
* @description called by product2 Trigger on After Update
* @param List<Product2> productList
**/
public static void PostAlerts(List<Product2> productList){
List<ConnectApi.AnnouncementInput> toPost = new List<ConnectApi.AnnouncementInput>();
for ( Product2 p : productList ){
// ToDo: Construct a new AnnouncementInput for the Chatter Group so that it:
// expires in a day
// does not notify users via email.
// and has a text body that includes the name of the product followed by the INVENTORY_LEVEL_LOW constant
ConnectApi.MessageBodyInput msgBody = new ConnectApi.MessageBodyInput();
ConnectApi.AnnouncementInput tempPost = new ConnectApi.AnnouncementInput();
ConnectApi.TextSegmentInput textSegment = new ConnectApi.TextSegmentInput();
textSegment.text = p.Name +' '+ Constants.INVENTORY_LEVEL_LOW;
msgBody.messageSegments = new List<ConnectApi.MessageSegmentInput>();
msgBody.messageSegments.add(textSegment);
tempPost.body = msgBody;
tempPost.expirationDate = DateTime.Now().AddDays(1);
tempPost.parentId = COLLABORATION_GROUP[0].id;
tempPost.sendEmails = false;
toPost.add(tempPost);
}
// ToDo: Create and enqueue an instance of the announcementQueuable class with the list of Products
AnnouncementQueueable annQue = new AnnouncementQueueable(toPost);
//annQue.toPost = toPost;
system.enqueueJob(annQue);
}
}
AnnouncementQueueable Class ---->
/**
* @name AnnouncementQueueable
* @description This class posts Chatter Announcements
**/
public class AnnouncementQueueable implements Queueable{
public List<ConnectApi.AnnouncementInput> toPost;
public AnnouncementQueueable(List<ConnectApi.AnnouncementInput> annList)
{
toPost = annList;
}
//ToDo: Modify this class to implement the Queueable interface and call the postAnnouncements method
public void execute(System.QueueableContext context){
PostAnnouncements(toPost);
}
/**
* @name postAnnouncements
* @description This method is provided for you to facilitate the Super Badge
**/
public static void PostAnnouncements(List<ConnectApi.AnnouncementInput> announcements){
while ( announcements.size() > 0 ){
if ( Limits.getDMLStatements() < Limits.getLimitDMLStatements() && !test.isRunningTest() ){
ConnectApi.AnnouncementInput a = announcements.remove(0);
ConnectApi.Announcements.postAnnouncement('Internal', a);
} else {
break;
}
}
if ( announcements.size() > 0 && !test.isRunningTest() ){
AnnouncementQueueable q = new AnnouncementQueueable(announcements);
//q.toPost = announcements;
system.enqueueJob(q);
//ToDo: Enqueue the above instance of announcementQueueable
}
}
}
Any help would be really appreciated.




I would suggest you refer below link for similar discussion.
https://developer.salesforce.com/forums/?id=9060G0000005O9cQAE
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya

Error in screen flow : "This page has an error. You might just need to refresh it. [Event fired] Failing descriptor: {markup://flowruntime:flowRuntimeV2}"



Authentication error in postman ?
{
"error": "invalid_grant",
"error_description": "authentication failure"
}
I have also created the connected app.
I have fill the body data as form-data given below-:
1. end point url -: 'https://login.salesforce.com/services/oauth2/token'.
2. client_id - 'my clent id'.
3. client_secret -'my client secret'
4. grant_type - 'password'.
5.password- 'my salesforce org password'.
please see where i am wrong??

You have to use your salesforce password + security token in your password field. Please ensure that no space is allowed in between them.
steps to get your security token:-
1. Go to salesforce org.
2. click setting (At the top right corner under your name displayed).
3. click the "Reset my security token" options display on the left menu.
4. then click on the reset security token button. Your token will receive in your email.
if you having a problem then Ask me
Please mark Best Answer If Your Problem Is Solved
thanks, Regards,
Malika Pathak
Superbadge APEX Error
Challenge Not yet complete... here's what's wrong:
Inserting a new Maintenance Request of type 'Routine Maintenance' and then closing it did not create of a new Maintenance Request based upon the original record correctly. The challenge is expecting to find the closed Maintenance Request plus an 'New' Maintenance Request of type 'Routine Maintenance' with the same Vehicle as the closed one.
(Also, the challenge didn't specifically mention that the Case and Product2 objects should be relabeled)


Trailhead Recommendations?
I registered with trailhead.
I’m an SDR looking to expand my Salesforce skill set. Let’s pretend I have none. Particularly looking for the basics around reporting, and any other trails that may be beneficial to spend some time with.
My goal is to have a competent understanding of SF to build my sales as I enter a closing role and the relevant tools in SF that will help me gain an advantage.
Thanks in advance!

Below are few trailhead links, hope it helps:)
https://trailhead.salesforce.com/en/content/learn/modules/sales_admin_sales_reports_for_lex
https://trailhead.salesforce.com/en/content/learn/modules/sales-activity-analysis
Step1: steup > Create > Workflows&Approvals > Process Builder >New > Name your Process
Step2: Choose Object and Specify When to Start the Process > Account & Start the process > when a record is created or edited
Step3: Define Criteria for this Action Group > Criteria Name > Is Billing Address Changed & Criteria for Executing Actions > (Select)Filter conditions are met. Next Set Filter Conditions as shown in screenshot
Step4: IMMEDIATE ACTIONS > update Records > Action Name > Update Billing Address > Object (SELECT==> [Account].Contacts) as shown in screen shot & Set Object Variables (Field mapping)
Step5: Acitvate the Process