Andrii Muzychuk
  • Member for 9 years, 3 months
  • Last seen this week
Formula field change doesn't cause trigger fire
Accepted answer
17 votes

Basically, formula doesn't store any value. Formula is executed only when you retrieve it - use show this field on VF page or use formula field for your calculations in Apex code. A formula is ...

View answer
Why is DML not allowed in Constructor?
6 votes

Using insert/update/delete in constructor is a bad practice in any language. Establishing connection to DB - OK. Constructor is used to create an object and initialize it's parameters; nothing more. ...

View answer
Apex: class naming conventions
Accepted answer
5 votes

Check this question What is a good set of naming conventions to use when developing on the Force.com platform? and Apex-Code-Convention on GitHub As for me, I prefer convention on GitHub.

View answer
Unknown constructor 'Name.Name(ApexPages.StandardSetController controller)' when removing RecordSetVar
Accepted answer
5 votes

According to Building a Controller Extension I think you should have a constructor with ApexPages.StandardController as a parameter: public with sharing class AddBasketGasQuoteFromMonitor{ ...

View answer
Interface with virtual keyword
4 votes

As it appeared, in example by AmatorVitae, interfaces are by default, wether you put virtual or not. Like private access modifier, wether you put it or not, it is private. Thanks for the question. I ...

View answer
Dev 401 Exam Preparation
3 votes

The main thing is Force.com Fundamentals. That is totally enough. It covers all basic aspects of Force.com platform. After that (or during breaks) you can explore dumps. Try to find dumps where an ...

View answer
"Too many SOQL queries: 101" - Apex error occurred while executing Site URL Rewriter
3 votes

First thing which popups in my mind is loop of a page which calls that code. First thing I would do is to remove/comment/whatever lines with SOQL to be sure that the problem is not in SOQL. I think ...

View answer
How to enable Einstein and configure it?
2 votes

Set Up Sales Cloud Einstein - to set up Sales Cloud Einstein, use the in-app Einstein Setup Assistant as a guide. You select who can use Einstein, enable Einstein features, and configure pages and ...

View answer
How can I insert data into an Account field from an opportunity trigger?
Accepted answer
2 votes

Your code for(Account a : [select id, (select id from opportunities) from account where id in: accountIds]) { noOfOpp = a.Opportunities.size(); if(noOfActiveOpp == noOfOpp) { a....

View answer
How can I create test class in Eclipse IDE?
2 votes

I suggest you to check An Introduction to Apex Code Test Methods, Add a Test Class and Testing Best Practices. In short. There is no special type Test Class. You just create a Class. One thing you ...

View answer
Do Salesforce developers use Git? How?
2 votes

As for me, I was trying to use Git plugin for Eclipse. I didn't like how it works. I ended up with separate folder where project is for Eclipse, and separate Git folder. After I finish implementation, ...

View answer
How to upload 6Mb attachment in a custom Apex Rest service (heap size issue)
2 votes

I assume my question was not very accurate. The problem was that we use custom REST API. And the problem was in Heap Size in our code. After I tried 'standard' Force.com REST API for Attachment ...

View answer
How to run Apex anonymous code from Visual Studio Code
1 votes

Create new file (Cmd + N). Select Anonymous Apex as language for the file. SFDX: Execute Anonymous Apex with Editor Contents (I made it as Hot Key (Cmd + Enter))

View answer
Round a Decimal to two decimal places
1 votes

Decimal toRound = 3.1445; Decimal rounded = toRound.setScale(2, RoundingMode.CEILING); system.debug(rounded); 3.15 toRound.setScale(2, RoundingMode.HALF_UP); will not return 3.15 from 3.1445.

View answer
How to restore permanently deleted records?
1 votes

Hm... It turned out that [SELECT Id FROM Account ALL ROWS] works just fine even if you Empty Recycle Bin. There might be a gap of 14 days, when this SOQL become ineffective. I have deleted records ...

View answer
Account ID for developer challenges
Accepted answer
1 votes

Go to Account tab and hit New button, fill in all required fields, Save and you are done.

View answer
I'm getting "List has no rows for assignment to SObject" error on a Visualforce component
1 votes

General rule - don't return result of SOQL to an object, but return it to a list of objects. After querying items, check the list. Don't do Account account01 = [SELECT id FROM Account LIMIT 1]; but ...

View answer
"List has no rows for assignment to Sobject" error, but works as SOQL query
1 votes

OMG, hardcoded ids!!! My eyes!!! :-) Don't do that. Create a record before using it's id. Make variable static. Create it. Use it in test method.

View answer
Discovering API Limits via Custom APEX Rest API
1 votes

I would create a static method which puts all needed information to header. RestContext.response.addHeader(REST_Manager.ERROR_MESSAGE_HEADER_NAME, errorMessage); In this way you can put all needed ...

View answer
Is Force.com IDE v.29 complaint with JRE 7?
1 votes

I have win7 64bit, java 7 update 51, kepler service release 1 and Force.com v.29. So far so good, except sometimes Home and End buttons stop working in Eclipse. That's it. Sorry, forgot to add about ...

View answer
EnhancedList view rendered Problem
1 votes

Interesting... It works for me if I don't have: <script> function f1() {} window.onload = f1(); </script> And if comment out window.onload = f1(); it appears in normal way....

View answer
Unknown property 'String.plancount' visual force
1 votes

The issue is that you don't have variable named r at all.

View answer
How to display Activity History in Created Date order in Lightning UI?
Accepted answer
0 votes

The Activities are showing correctly according to the documentation - https://help.salesforce.com/articleView?id=activity_timeline_customization_considerations_lex.htm&type=5 Items in the ...

View answer
Remove an Action from Workflow Rule using Change Set
Accepted answer
0 votes

In order to remove an Action from Workflow Rule through Change Set the Action which should be removed must be present in the Change Set. So you deploy Workflow Rule + Action you want to remove. Just ...

View answer
Auto assign Account Teams (without trigger)
0 votes

Process Builder can not insert Account Team Member record.

View answer
Testing logic where record's owner is inactive
Accepted answer
0 votes

I ended up separating creation of an Opportunity, which will then have inactive user and making user inactive and perform cloning of the Opportunity with inactive user. Creation is made in @testSetup, ...

View answer
Can apex:param pass null for Integers?
0 votes

I ended up with Boolean variable. On VF page: <apex:inputHidden value="{!isActualHoursBlank}" id="actualHoursInputHidden"/> <apex:actionSupport event="onclick" action="{!saveProduct}" ...

View answer
Is it possible to update managed package contents using Force.com Migration Tool (ANT Tool)
0 votes

Please, check my question. Here is what I use to manage this. package.xml: <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <...

View answer
Error in Test Class as :FIELD_INTEGRITY_EXCEPTION
0 votes

1) Create Price Book Entries in Apex Tests - the idea is to create a PricebookEntry with Pricebook2Id = Test.getStandardPricebookId() and only then you create PricebookEntry with your custom Pricebook....

View answer
Have dependent fields default to a value based on controlling field
Accepted answer
0 votes

It is not possible in standard layout or via any customization. The only thing we can do is keep voting for Enable Default Picklist Values on Dependent Picklists idea.

View answer