How can I rename my Apex Class name in Salesforce - salesforce

How can i rename my Apex class?
For example if I want to change the name of my apex class from ABC to ABC123, how can I do that?

If you wanted to do it through a metadata deployment, your only option would be to delete the old class and create a new one.
In the ui (Setup > Develop > Apex Classes), you can change the class name, but it won't change any of the references, so if you don't manually change all references to the class, you might start getting errors that say:
Dependent class is invalid and needs recompilation
Renaming a class in the ui will associate a different name with the same salesforce id for the class, so there is a subtle difference between that and deleting and creating a new class.

there are 3 ways to rename Apex Classes
Using Force.com, follow this link
https://developer.salesforce.com/page/Miscellaneous
or
Force.com IDE didn't reflect my changes?
Using mavenmate
https://salesforce.stackexchange.com/questions/61405/how-to-rename-class-in-mavensmate
Salesforce CLI
In VS code login using Salesforce CLI and rename the apex class and its reference by find & replace class Name. and
Rename the class in apex class folder to new name and deploy to org
after that you can see 2 classes old class and new Class with same content delete the old class

Related

ApplicationModule definition class code is blank in ADF

When i select Generate Application Module class and click OK, The AMImpl.java class is generated without any code. what might be the reason for this?
It's because all the code is in the base class.
What do you expect to be in the class?
When you define to create the class, you can choose what will be created (all based on the time you create the class).
Then all methods you write will end up in this class and can be exposed to the client.
Use is described here.
Per the docs:
The base classes of the ADF Business Components framework may be
extended to incorporate custom code with all types of components in
the framework and to extend the ADF Business Components framework
behavior.
When used without customization, your business component is completely defined by its XML document and it will be fully functional
without custom Java code or even a Java class file for the component.
If you have no need to extend the built-in functionality of a
component in ADF Business Components, and no need to write any custom
code to handle its built-in events, you can use the component in this
XML-only fashion. However, when you do extend base classes of the ADF
Business Components framework, you can still work with XML documents
in JDeveloper.
Once you have created framework extension classes, any new business component you create can be based on your customized
framework class instead of the base one. And, you can always update
the definitions of existing components to use the new framework
extension class as well.
Best practice is to create your own set of custom framework extension classes so you have hook points for creating common code for your custom ADF BC EOs and VOs

Inheritance model Laravel 5

I have a problem with laravel. I need to create two class like that :
Class Users {}
Class Companies extends Users {}
It's an inheritance relationship. And this is my database :
And I don't know how to create the model User and Companies in Laravel. And how to use them.
Can you help me ?
Thank you by advance !!
If you are using artisan then things would be as simple a typing the following command in your terminal, giving that your pwd is your project directory:
php artisan make:model User
This will create a User.php file that is a class named User, and inherits from Model.php, eloquent's model class.
If you want to create a model and also create a table in the database with certain columns, you can use the --migration argument with the previous command, for instance:
php artisan make:model User --migration
After running this command, you'll have to open database/migrations and modify the file created as you wish to create your table.
If you do not use artisan -then you should be- you can just create the model manually by creating a new class in a file that extends from eloquent's model.
For instance:
use Illuminate\Database\Eloquent\Model;
class User extends Model
{
}
And that should be it.
For further reading, consult Laravel's documentation, it contains all your basic questions such as the one you have just asked.
For the link to the documentation about Models, clikc here

Entity Namespace does not appear in Silverlight project

I have a Silverlight web project where I apply the MVVM pattern. In my entire solution I have 4 projects.
Project "A3", which contains all of my Views and ViewModels.
Project "A3.Web", which contains my main html files, images, sound files, etc.
Project "A3Lib", which contains my XAML binding converters and other helpful classes that I created.
Project "A3Lib.Web", which contains the Data Models and Domain Logic.
All of my entity models are inside my DataModels folder and all of my Domain Service server side code is inside the DomainLogic folder. I created a new folder inside the DataModels folder named "Common".
So when I want to add the data model to my VM, I tried "using A3Lib.Web.DataModels.Common;" and that did not find the namespace.
Issue: when I add a new folder and a new entity model to the DataModels folder, I do not see the namespace in my View or ViewModel in the "A3" project.
However, I already have existing code there (was added by someone else) and the models he added show perfectly fine (when doing using ...... in the View or VM).
I checked web.config to make sure the connection string is there and it's correct. I also tried to add a brand new context to the base class of the project (where other contexts are) and that did not help. My project simply cannot resolve or see the data model namespace that I create.
Thanks
Yura
The Silverlight app sees the models and namespaces from the server-side project through the generated code - you should see it in the Generated_Code folder of your A3Lib project. If it is not there, then the proxy classes are not being generated on build. A couple things to check:
class is not private (hey - sometimes it's the simple things)
if using Domain Services, the service needs to have at least 1 method that returns an IQueryable or IEnumerable (even if method returns null) in order to see the class in the Silverlight-side domaincontext
if the class is just a utility class that you want to share with the client, save the file as classname.shared.cs, and the proxy will pick it up.
make sure the project references are to the projects and not (possibly older) .dlls in another location.
That's all I've got based on the info provided.

Add class to c++ firemonkey project

I have written a small firemonkey mobile app in C++ XE6 using several forms/units which all attempt to read data from a json feed.
I would like to keep the user details in a separate class to pass in the REST request rather than pass them from form to form.
What is the syntax for creating a static class and, other than including a reference to myclass.h, how does one access it's properties please?

How can I modify edmx and reflect changes in the domainservice automatically?

I have a silverlight business application created with vs2010 and it is RIA service enabled, I added new table in the database and updated the edmx using (update model from database option), but I want to update the domain service class as well to include the new tables, how can I do that?
I haven't found a way to do this automatically, but this blog seems helpful.
EDIT: If you use partial classes as suggested, then you can delete the DomainService1.cs class and use add new item to add the class again. Then using the built in wizard, re-check the entities you want to expose. The partial classes will hold your custom logic.
Unfortunately I have not found nothing better than:
Add new DomainService that will work with new table;
Copy generated code into existing(main) service (Get*, Insert, Update, Delete etc.);
Copy metadata;
Delete "new" DomainService and "new" metadata files;
After these steps you'll get access to your table.
NOTE:
*-without Get- method client will not recognize any changes;

Resources