Questions tagged [oop]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
48 views

Is there any way to add Interfaces to SObjects?

I have a problem where we have two SObjects with similar fields and we often convert one to the other. On top of that we have two classes that represent each of the SObjects as a DTO and another DTO ...
0
votes
1answer
1k views

Override specified on a non-overriding method

I am trying to play around with creating a base Trigger handler class that each trigger type can extend. I wanted to pass the trigger types into the base class as a member variable and then be able to ...
0
votes
1answer
146 views

How to set attribute.Metadata field in .callServer with Javascript Var?

I tried to get the description of the title correct. If you think there might be a better one that describes better the scenario, please suggest! In lightning components, I have a cpq_Configure ...
18
votes
3answers
12k views

What's the difference between Abstract class and Virtual Class

Hi I'm just confused on how to to use Abstract class and Virtual. Can't seem to find any difference between them and what are some scenarios where in it's applicable to use abstract or virtual.
2
votes
0answers
68 views

Using Abstract and Interface Class - Building application in Salesforce

I have been intrigued by using design patterns, Object oriented concepts when programming. I do not have much hands on with using these concepts when programming salesforce. I do have a theoretical ...
6
votes
1answer
184 views

Dynamic Polymorphic Lightning Components

I have a Parent component rendering child components. I want this to happen dynamically, meaning that I can pass in a child component definition and fill it with data afterwards. <!--c:child--> ...
2
votes
1answer
297 views

Left, Right and Bottom border in Visualforce rendered as pdf

I have a vf page rendered as pdf. I have dynamic data table in this vf page. So at run time only I will get to know how many number of rows are there going to be. I want to show borders in this table ...
0
votes
1answer
84 views

Trailhead : Variable Scope Issue (Compiler Error)

This is my class global class ProjectCalloutService1 { String OppId; @InvocableMethod public static void postOpportunityToPMS(List<Id> oids) { OppId = oids[0]; } global class ...
1
vote
2answers
261 views

Can Apex properties take input- An encapsulation question?

Say I have a proprerty, and I want to pass in an input to it in the setter, can I do that? This snippet below is well encapsulated java code. but it's a bit verbose. private Decimal weight; public ...
13
votes
3answers
1k views

OOP best practices - use object fields dynamically

Let's say I am working with bicycles and I need to group them by different criterias. class Bicycle { String brand { get; set; } Date purchaseDate { get; set; } } class GroupedBicycles { ...