• Developer Base
  • NEWBIE
  • 160 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 46
    Questions
  • 13
    Replies
Users are able to show other users' calendars using Add Calendar in Other Calendars section. Events are then shown in the Calendar, but clicking on them does not open the detail of a Calendar Event. No error message either, just nothing happens.

User-added image

How to fix this?
Hi, Trailhead offers just a little bit of integrations. If I wanted to become a skilled person in integrations, what course should I buy and study? What worked for you?
My formula counts the number of months between two dates and by divides a currency field by that number to get an average/month result.

What works:

Currency field
Fee__c

Number of months between two dates
((YEAR(EndDate__c) - YEAR(StartDate__c ))*12) + (MONTH(EndDate__c) - MONTH(StartDate__c ))

What does not work and needs to work:

Currency field divided by number of months between two dates
(Fee__c / ((YEAR(EndDate__c) - YEAR(StartDate__c ))*12) + (MONTH(EndDate__c) - MONTH(StartDate__c )))

My last formula does not compute anything - the field remains blank. Why is that? How to solve that?
 
Hello,

I managed to import less than 50 000 records using Data Loader to my sandbox. Why is it so? Does the minimum of 50 000 apply only for production orgs?
Hello,

I am trying to display some more fields of records that are shown in a lookup. It works for me when I am editing a record, but when I am creating a record, it just shows only name of the record:

User-added image

I changed the search layout of the Stage record, but it did not help. Is it even possible?
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/api_rest_eol.htm

Hi, what happened after sun API retires? Let's say that I made a batch apex class 5 years ago and the API is 22.0. Then the API is about to expire. Do I have to change my code? What if I don't change it. Will it stop working? :) Does it mean that we all will have to update our code after some time, because the API will expire?
Hi, I am trying to mention a record in a Chatter via Process Builder.

So far I've tried:

@[RecordId]
@RecordId
/RecordId
/[RecordId]

DOes not work... how?
Hello,

I tried setting up an automatic Chatter notification from Approval Process as a Final Approval action.

 I only see Field Update, Task, Outbound Message and Email Alert options. Is it possible to send a Chatter notification (like a message with @mention) to a user?
Hello,

trigger always runs in system mode.

https://salesforce.stackexchange.com/questions/172060/types-of-execution-system-mode-or-user-mode

But what if the trigger calls a method from a class which has "with sharing" or "without sharing defined"?

I did my own tests and it seems that if the method is called from a trigger, even the method executes in system mode, so it does not matter if it is "with" or "without sharing", once it is called from a trigger, it always runs in system mode.

Yes or no?
Hello,

I have two record types: RT1 and RT2.

I have one field: Total__c, which is a currency field.

How do I make a formual field in a report that would take summary of Total__c for RT1 and substract it from summary of Total__c for RT2? Pseudocode:
 
Summary of RT2.Total__c  - Summary of RT1.Total__c

 
Hello, due to a major production udpate I need to remotely log off all users who are logged into 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? 
Hello,

my org has about 40 users that I need to log out from their applications. This means that I need to revoke all their OAuth connections:

User-added image
There are about 120 connections to revoke. I can not do that manually, it would take too much time. According to documentation, I can make a Post request to revoke an OAuth connection:

https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/oauth_revoking_tokens.htm

I managed to obtain all the OAuth ids, but how do I now make a POST callout according to the documentation to delete them all? Could anyone give me a sample code? This would really help. Thanks.
What does a company get for my certifications? Let's say I am a certified Admin and Sales Cloud Consultant. How do I find what does a company get for these certifications?

I am trying to communicate about this with my boss now but I don't know where is the proper documentation for this.
Hello,

I have a user with Partner Community license. My goal is to set up the navigation menu of the community in such way that through this menu users can access Service Appointment lists the same way a standard user can open the Service Appointment tab and choose any available record in the list view.

Problem is that the user does not see the list view after clicking on navigation menu item. It throws an error.

Admin preview:

User-added image

What Partner Community user sees:

User-added image

Profile settings of Partner Community user profile:

User-added image

Tabs are also enabled for all objects:

User-added image

What is the problem?
Why do we have API versions and when is API version of an org updated?
Hello,

is REST API used ONLY for external applications to connect to Salesforce database? Or are there any other use cases?

Do we use REST API for example when connecting to external apps to gather data, or do we rather use something else like Salesforce Connect?
Hello,

could anyone explain what are those so called Application Programming Interfaces? And why do we have so many of them? We have Streaming API, SOAP API, Metadata API and so many more.

Are APIs some sort of collections of classes and methods that can be used for a certain purpose?

And why is there so many of them when only one would be enough, containing all the methods?
Hey, I am studying for developer II cert and I ran into a peculiar thing.

my test class does NOT trigger mixed DML error, although I am inserting setup and non-setup objects. Why not? My code:
 
@isTest
public class UpdateAccountNameTest {
    @isTest
    public static void test1(){
        Profile prfl = [Select Id, Name from Profile where name ='System Administrator'];
        
        Account acc = new Account();
        acc.Name = 'test';
        insert acc;
        
        Custom_Object1__c a = new Custom_Object1__c();
        a.Name = 'testAccount';
        insert a;
        
        User usr2 = new User();
        usr2.LastName = 'setup1';
        usr2.Username = 'test1@test123.net';
        usr2.Email = 'tes1t@test123.net';
        usr2.Alias = 'Test1';
        usr2.CommunityNickname = 'Test1';
        usr2.TimeZoneSidKey = 'Europe/Prague';
        usr2.LocaleSidKey = 'cs_CZ';
        usr2.EmailEncodingKey = 'UTF-8';
        usr2.ProfileId = prfl.Id;
        usr2.LanguageLocaleKey = 'en_US';
        usr2.IsActive = true;
        insert usr2;     
    }
}

 
Why is this hapenning?

For example I am typing <apex:page>

before I type it, I get a list of possible tags to choose from. I choose the apex:page tag and push ENTER and the tag becomes this:

=""

more in the images below:

User-added image

User-added image
Hello,

I am trying to display some more fields of records that are shown in a lookup. It works for me when I am editing a record, but when I am creating a record, it just shows only name of the record:

User-added image

I changed the search layout of the Stage record, but it did not help. Is it even possible?
Hello,

trigger always runs in system mode.

https://salesforce.stackexchange.com/questions/172060/types-of-execution-system-mode-or-user-mode

But what if the trigger calls a method from a class which has "with sharing" or "without sharing defined"?

I did my own tests and it seems that if the method is called from a trigger, even the method executes in system mode, so it does not matter if it is "with" or "without sharing", once it is called from a trigger, it always runs in system mode.

Yes or no?
Hello, due to a major production udpate I need to remotely log off all users who are logged into 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? 
Hello,

my org has about 40 users that I need to log out from their applications. This means that I need to revoke all their OAuth connections:

User-added image
There are about 120 connections to revoke. I can not do that manually, it would take too much time. According to documentation, I can make a Post request to revoke an OAuth connection:

https://developer.salesforce.com/docs/atlas.en-us.mobile_sdk.meta/mobile_sdk/oauth_revoking_tokens.htm

I managed to obtain all the OAuth ids, but how do I now make a POST callout according to the documentation to delete them all? Could anyone give me a sample code? This would really help. Thanks.
Hello,

I have a user with Partner Community license. My goal is to set up the navigation menu of the community in such way that through this menu users can access Service Appointment lists the same way a standard user can open the Service Appointment tab and choose any available record in the list view.

Problem is that the user does not see the list view after clicking on navigation menu item. It throws an error.

Admin preview:

User-added image

What Partner Community user sees:

User-added image

Profile settings of Partner Community user profile:

User-added image

Tabs are also enabled for all objects:

User-added image

What is the problem?
Hey, I am studying for developer II cert and I ran into a peculiar thing.

my test class does NOT trigger mixed DML error, although I am inserting setup and non-setup objects. Why not? My code:
 
@isTest
public class UpdateAccountNameTest {
    @isTest
    public static void test1(){
        Profile prfl = [Select Id, Name from Profile where name ='System Administrator'];
        
        Account acc = new Account();
        acc.Name = 'test';
        insert acc;
        
        Custom_Object1__c a = new Custom_Object1__c();
        a.Name = 'testAccount';
        insert a;
        
        User usr2 = new User();
        usr2.LastName = 'setup1';
        usr2.Username = 'test1@test123.net';
        usr2.Email = 'tes1t@test123.net';
        usr2.Alias = 'Test1';
        usr2.CommunityNickname = 'Test1';
        usr2.TimeZoneSidKey = 'Europe/Prague';
        usr2.LocaleSidKey = 'cs_CZ';
        usr2.EmailEncodingKey = 'UTF-8';
        usr2.ProfileId = prfl.Id;
        usr2.LanguageLocaleKey = 'en_US';
        usr2.IsActive = true;
        insert usr2;     
    }
}

 
Trying to create data with a custom LastModifiedDate value for testing purpose. So far these things I've tried don't work:
  1. Using Test.loadData - although Salesforce provided us with information about setting custom value of LastModifiedDate, this does not seem to work even when following the tutorial. Link: https://help.salesforce.com/articleView?id=000332070&type=1&mode=1 (https://help.salesforce.com/articleView?id=000332070&type=1&mode=1)
  2. Using JSON.deserialize - also does not work - copied the sample code and tried the same method, it shows errors. Link: https://help.salesforce.com/articleView?id=000332070&type=1&mode=1 (https://help.salesforce.com/articleView?id=000332070&type=1&mode=1)
  3. Setting CratedDate through Test.setCreatedDate(recordId, createdDatetime) method - I hoped the LastModifiedBy field would have changed with it, it does not.

Is there any other WORKING way how to set LastModifiedDate of a record? 
Hey whatsup,

what does this mean?
 
Product2 pro;
            if ((pro = (Product2)Tools.findRecordByValue(pros, 'Id', rec.Product2Id)) != null) {
... some code here
}

Tools is a class I have a method called findRecordByValue, but WHAT IS THIS????
 
(Product2)Tools.findRecordByValue
Why is (Product2) before the Tools method???

Can someone give me a link to explanation about what this is? It seems like a java fundamental thing.

 
Hello, I have two record types: X1 and X2

Controling picklist: Type has values 1, 2, 3, 4, 5
Dependent picklist: Subtype has A, B, C, D, E

For record type X1 I need the Subtype value to equal A if Type equals value 1.
For record type X2 I need the Subtype alue to equal B if Type equals value 1.

Is this possible in any way or do I have to create twice as much values in Type field availible only for some record types?
Hello,

I have sharing settings for Accounts/Contracts set to Read/View,
Contacts are set to Inherits from Parent,
User has CRED on Profile for Account and Contact.

Yet he can not see a Contact, where is the problem?
Hello, I have a code. I created fields on Account for trigger.old and trigger.new. They are always identical. How come?

The trigger works as a roll-up summary, but the values are not up-to-date when retrieving them via query.
 
trigger AggregateOrderAmount on Order (after insert, before update, after delete, after undelete) {
    Set<ID> setID = new Set<ID>();
    List<Account> lstAcc = new List<Account>();
    double val;
    for(integer i = 0; i<Trigger.New.Size(); i++){
        val = (trigger.new[i].TotalAmount - trigger.old[i].TotalAmount);
    }
    
    if(trigger.isinsert || trigger.isundelete){
        for(order o : trigger.new){
            setID.add(o.AccountId);
        }
    }
    else if(trigger.isDelete){
        for(order o : trigger.old){
            setID.add(o.AccountId);
        }
    }
    
    else if(trigger.isUpdate){
         for(order o : trigger.new){
            if(o.AccountId != null){
                if(trigger.oldmap.get(o.id).AccountId != o.AccountId){
                    setID.add(o.AccountId);     
                }
            } 
            setID.add(trigger.oldmap.get(o.id).AccountId);
         }
    }
    if(setid.size() > 0){
        lstAcc = [Select id,Order_Sum__c, val1__c, val2__c,(Select id,TotalAmount from Orders) from Account where id IN : setID];
    }
    for(Account acc : lstAcc){
        for(Order ord : acc.Orders){
            val += ord.TotalAmount;
                       
             for(integer i = 0; i<Trigger.New.Size(); i++){
            acc.val1__c = trigger.new[i].TotalAmount;
            acc.val2__c = trigger.old[i].TotalAmount;
    }                                        
        }
        acc.Order_Sum__c = val;
    }
    update lstAcc;
}

 
Hey guys, I installed VSCode, authorized my developer sandbox and retrieved all metadata including objects and fields. Yet those field names do not autopopulate as you can see on the screenshot. Is there a way to fix this? Thank you alot. If your answer fixes my problem I will mark it as the best answer.
User-added image