New answers tagged

0 votes

Trying to fetch Name of profile Using Map

My Understanding is We need to restrict the deletion of Account for System Administrator Here we need to check that the logged-in (who are deleting account) user's profile is System Administrator or ...
user avatar
2 votes

Trying to fetch Name of profile Using Map

Welcome to Salesforce Stack Exchange (SFSE)! Caspar answered the question that needed to be answered, but to answer the question you asked - about not getting inside your if block: Mlist is a map ...
user avatar
  • 2,159
2 votes

Trying to fetch Name of profile Using Map

I'm not 100% sure what you are trying to do, but try this: Profile p = [SELECT Id, Name FROM Profile WHERE Id = :UserInfo.getProfileId() LIMIT 1]; Boolean isSysAdmin = (p.Name == 'System Administrator'...
user avatar
1 vote

Workflow rule to update contact field. Syntax error missing ")"

So the calc would be something like this (using a case statement): CASE(1, IF(ISPICKVAL​ (Type_of_pet__c, "Dog"),​ 1, 0), "Dog",​​ IF(ISPICKVAL​ (Type_of_pet__c, "Cat&...
user avatar
0 votes

Can not create Scratch org

I have faced the same issue, if you check your SFDX-Cli installation folder at: /Users/yourName/.sf/sf.json /Users/yourName/.sfdx/sfdx-config.json one of those json files are corrupted, in my case it ...
user avatar
  • 1
0 votes
Accepted

DML currently not allowed - trying to log exception in a custom object inside the constructor

There are a couple of approaches to solve this Use a page action method to do the Http callout. However, the VF manual recommends against doing this: The action method invoked when this page is ...
user avatar
  • 62.4k
1 vote

Trigger error- System.StringException: Starting position out of bounds:

You should check that the contents of the variable StageName has length 8 if you want to take the substring from 6-7. Otherwise you cannot guarantee you'll reach out of bounds and get this exception. ...
user avatar
0 votes

Can not create Scratch org

Could it be that there's an issue in one of your project CLI config files? I suggest trying the following: check config/enterprise-scratch-def.json file for parsing errors delete the .sf and .sfdx ...
user avatar
  • 4,026

Top 50 recent answers are included