Can't push salesforce managed package - salesforce

I am salesforce developer, but not good with managed packages and need some help.
We have one managed package we push it to our customer. We need to delete a few unused classes from the managed package and reupload the new version.
When we try to push the package to our existing customer we get the error below.
you need the deleted class because it still refer in our old package which we already push to the client
Now the issue is we can't create the the unused class with same name, so we can't push to anyone with our new update.

Related

Salesforce Trigger not Saving (Data Integration Specialist Superbadge)

I am working on the Data Integration Specialist Superbadge. I can't get the call out trigger to save.
Challenge Not yet complete... here's what's wrong:
The ProjectTrigger does not appear to be calling 'BillingCalloutService.callBillingService()' and passing in the collection of old and new records.
The Trigger doesn't seem to be saving either on the Developer Console or the Apex Trigger in Setup. I have deleted the old workspace in workspace manager in the console as it could be corrupt.
Any ideas or recommendations?
Any recommendations to fix the trigger not saving?

Salesforce CI/CD Pipeline with Github Actions

Please help me with this UseCase. Thanks for any help in advance.
I am creating some Salesforce project in VS Code. I have cloned the repository and pushed it in Github. I have three branches in the repo named as Feature, Developer and Master. Feature is the base branch. Whenever I change or write a code, on deployment it is pushed to Feature.
Now I want that there should be Dev org attached to Developer branch as well and whenever a code after testing is pushed from Feature to Developer branch, or I pull the code to Developer from Feature, all the code shall be deployed to the attached org.
And similarly on pushing the code from Developer to Master.
I wrote the workflow rule and did it nearly.But On creating a pull req, the workflow was working but it was showing error while build and deploy and decryption was failing with error something like that- can't read the directory. Lastly, when I removed encrypt Decrypt keys, Authorization step is not passing and showing the same endless error- OAuth client secret of personal connected app?: sh: 1: read: Illegal option -s.
So the youtube video I followed confused me while encrypting server key. He got some hashkey and hash IV from somewhere and generated new hash key and hash IV to generate some server.key.enc
What tutorial(?) are you following? I don't recognise steps about decrypting keys, it might be some old or overcomplicated method.
There's cool blog post at https://tigerfacesystems.com/blog/sfdx-continuous-integration and/or you can look what SF does themselves in the LWC recipes repository (you know, the one to which most of LWC documentation points to): https://github.com/trailheadapps/lwc-recipes/blob/main/.github/workflows/ci.yml
You'd have to login with sfdx to all target orgs you need, use that "sfdx force:org:display" and "Sfdx Auth Url" trick, save each org's value as different Github variable and create similar scripts.

Adding a record on a crud application

So I have a crud applicatio here this is the link
https://crud-application-x.herokuapp.com/getstudents
my boss was telling me this
Add one record that I can see when I visit the url.
what does it mean by adding a record on a crud app. Does it mean adding new data
I think the issue here is not related to a misunderstanding, but that you're both looking at different things. You're probably testing it at your development environment only and everything works as expected. Your boss, on the other hand, is using the app through the URL you've provided and is unable to create a new student.
The issue here is that you are not using the right address to access your API in production, so the student is never created, take a look:
The address http://localhost:3200/... will only work on your development environment. Once axios can't reach the server, adding a new student throws an Error: Network Error.
In order to fix this, you'll have to start using the right URL for each environment. The easiest way to do so, in my opinion, is through environment variables.
How to set up an environment variable
As it looks like you're using create-react-app, this resource will help you set them up as needed. As a simple example, you can create the following two files at your app root directory:
.env.development
REACT_APP_API_PATH=http://localhost:3200
.env.production
REACT_APP_API_PATH=https://crud-application-x.herokuapp.com
Now you can easily use the right URL for each environment:
axios.post(`${process.env.REACT_APP_API_PATH}/students/addStudent`)

Liferay document checkin issue

I'm still new to Liferay and using Liferay 6.2
what i'm doing:
I am trying to add a document manually into my database using insert statement.
I inserted into dlfileentry, dlfileversion and AssertEntry.
Also, i created a folder with the valid name and file.
The issue:
upon entering the Documents and Media portlet, i can see the document name there but when i click on checkout, it will prompt a error saying that Documents and Media is temporarily unavailable. however i am still able to download the valid document.
Am i doing something wrong? Personally, i feel that i am missing one more table for the database but i'm not sure .
Thanks!
Yes, you're doing something wrong: You should never write to Liferay's database with SQL, as there might be more data required than what's directly visible to you. Obviously, you're running into exactly such an issue.
Liferay has an API which you can use locally, from within the same application server, or remotely as JSON or SOAP service. You should exclusively use this for write access to the database.
Alternatively, you might consider WebDAV access to your document repository as the way to add more documents to the document library.

How do I delete an Apex class in Salesforce Enterprise Edition using Eclipse?

How do I delete an Apex class and trigger in Salesforce Enterprise Edition using Eclipse?
In order to delete a trigger from a production org using eclipse you will need to use the following steps(assuming you have a sandbox org):
Through the web interface in your sandbox org, inactivate the trigger
Refresh your sandbox project in eclipse and deploy the inactive trigger to production
Refresh your production project in eclipse, right click on the trigger and select delete
Accept the option to delete from server
I believe the above steps will work, however I have only ever removed components from a production org using destructive changes & the Ant Migration Toolkit.
To use the Ant Migration Toolkit for a destructive change you would need to setup the destructivechange.xml file to look similar to this:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>MyTrigger</members>
<name>ApexTrigger</name>
</types>
<version>21.0</version>
</Package>
There are full instructions on how to propogate destructive changes on developerforce.
I had a near-duplicate question and landed here. I want to delete a class with just the Force.com IDE (Eclipse) from my production org. Inediger described how to deploy the destructive change set using the Ant Migration Toolkit and guessed at how to do it in the Force.com IDE. In my attempts with Force.com IDE version 20.0, Inediger's steps 3 and 4 will prevent you from deleting the class/trigger in your production org.
Here's the natural attempt to delete a class in the Force.com IDE:
Click the class. Press delete.
"Are you sure you want to delete file 'myClass.cls'?" ... OK
"The requested operation will only delete the resource locally. Would you also like the resource to be deleted from the server?" ... Yes
At this point the file is deleted from your project and your dev org, but it remains in your production org (and the admin web interface won't let you delete it there) so you continue with:
Deploy to Server.
Enter production org credentials.
Next. Next.
Look for your class in the Deployment Candidates list--but it's not there!
Unfortunately, your class won't be listed with the Deployment Candidates because the Force.com IDE has already lost track of that file (because you deleted it--if you're in this boat recreate the class in your dev org and follow my instructions below).
We need to delete in production before we delete the file locally (I think we're walking the Force.com IDE through constructing one of those destructive change sets and deploying it for us):
Edit the class's matching *-meta.xml file (from the Force.com IDE).
Set the status to Deleted: <status>Deleted</status>. Save.
Right click your class, Force.com | Deploy to Server.
Enter your production org's credentials.
You should see your class as the only deployment candidate!
Check the box for "Apply Action?" to Overwrite your class.
Next your way through the rest of the wizard.
If you're following along in the Salesforce admin web pages you'll notice that the class disappears from your dev org after saving in step 2. It disappears from your production org when you get the green check mark after step 7.
Finally, I delete the class from the Force.com IDE as I normally would. When it asks me if I want to delete the file from the server I say no because we've already taken care of it. I also Add/Remove metadata components and uncheck the class name to get rid of the warning message.
The easiest way to do this is to delete the file from your project in Eclipse (not removing from the server because that doesn't work) and then you right click on the FOLDER (i.e. Triggers / Classes) and choose Deploy To Server.
When the dialog which shows want you want to deploy appears, the class/trigger in question will be highlighted as a red row, meaning you can check it for deletion from the production org.
The easiest way to do this from Eclipse is to edit the -meta.xml file for the class you want to delete. All you need to do is change the 'Status' field from 'Active' to 'Deleted'.
When you save the -meta.xml file the the corresponding class will immediately be deleted from your production org. The class & .xml files will still be in your local Eclipse folder - but then you just can delete them locally.
One of the ways I have tried was to:
1) Go into the meta XML file for the trigger [in Force.com IDE] and set the status value to "Delete".
2) Then after saving that .xml file, I deploy the trigger to production.
I kow for a fact that should delete the file. I have done it with a class file as well but unfortunately this was a test class file and I forgot to delete the other associated files that the test file provided test coverage for and so I lost significant overall cumulative Test coverage due to this mistake. Fortunately I saved the file before i deleted it and was able to re-deploy the modified test class back to production and all was OK again.

Resources