Error: Salesforce sandbox deployment - salesforce

I tried deploying the sandbox into Salesforce production but getting some errors. Also is it possible to make changes to the production code without the sandbox? Can someone also explain the code coverage? I tried changing that error field for the insert several times in the sandbox, But when I try to deploy it again, it still throws the same errors. enter image description here

The error clearly states that your test class is trying to insert an opportunity record without filling mandatory field Close Date. Please check your code again. If you need any help please share the snippet of the code.
And yes you can make changes to Production directly, I wouldn't recommend that. Moving changes from sandbox to production after necessary testing is an ideal way of deploying new/existing changes. It's part of SDLC practice.

Related

Error messages from Salesforce managed package when uploading change set validating running all tests

We recently refreshed our SF development org and I am trying to upload some new work (unrelated to Agile Accelerator managed package) to the org. I am running all tests on validation and getting a number of error messages on a number of ADM classes from the managed package for Agile Accelerator.
Here are a few of the error messages:
When looking at the object I can't find any field called ProfileId, or any reference to a ProfileId for a User. Obviously since the package is managed I can't get inside the code to determine where the issue lies.
Any help? Any idea of where to start?
You haven't pasted any errors... When you validate, which option you select?
Running all local tests should be enough. don't bother running all tests including managed package ones, it's almost guaranteed they'll fail (when package inserts new account it'll have no idea about your custom fields, your required, your validation rules...)
If you have run local tests and got errors - well, maybe there are few fields package added that now you have to populate to successfully insert? Generally see what successfully saves in UI and try to replicate that in test?

Problem with tests for deploy an apex class, probably bad configuration

When I try to deploy a new apex class from a sandbox, I get the follow problems:
SFDCAccessControllerTest testAccessControl_runAs System.AssertException: Assertion Failed: Should not succeed as Survey__c is not accessible to standard user
Stack Trace: Class.SFDCAccessControllerTest.testAccessControl_runAs: line 58, column 1
Utilities_Test getInstance System.AssertException: Assertion Failed: Expected: , Actual: xxxx.
Stack Trace: Class.Utilities_Test.getInstance: line 18, column 1
I suppose it's only a bad configuration, but I'm relative new with salesforce and don't know where I can disabled both test or change permissions for Survey__c and fix the problem with the instance name withouth affect the production eviroment.
I looked for similar cases and could not find it, please can anyone guide me.
Hard to say anything without the test's source code. Do they create a dummy user with "Standard User" profile or try to query existing user? From what I remember you can't edit standard profiles, you have to clone them so I don't know how would you or colleague manage to add Read permission... But check the profile mentioned in the test -> object permissions -> Survey -> read right.
It is also possible to deploy to production without running all tests. It's bit tricky, you need to specify the classes you want to run, you could skip that unit test. But everything you pick need to pass the rules (75% coverage minimum etc). If you need to deploy to prod ASAP it could help but well, you need to eventually bite the bullet and check what exactly is wrong with the test.

BigQuery UI - Datasets missing

I have a weird issue with my BigQuery UI (going on https://bigquery.cloud.google.com/queries/my-project-name). I don't know why, but I see no datasets for my projects, when I'm fully aware they exist. My code can still hit these datasets and their tables. There is just no way for me to see them.
In the UI itself, I can still query them if I type the whole query by hand, but being able to see my structure for my schema could be helpful.
When I check my network tab in the developer tools on chrome, I notice that I receive "Failed to load ressource: net::ERR_CACHE_MISS". I then decided to do everything I could to reset my own cache. I cleared my cookies, went incognito, I tried other browsers, even other computers. NOTHING brings back my datasets.
Anyone encountered this and has any ideas how to force my cache to hit?
I had the same problem a while back. When I got the error, I struggled with it and I ended up finding a way to reset this. Seems like it's something cached server-side that makes this incorrect cache-hit. The way to reset the server-side cache is to hit a URL with a project that doesn't exist, so something like https://bigquery.cloud.google.com/queries/bogus-nonexistant-project should reset it all
Did you recently assign a new string ID to your project that previously only had a numeric ID? If so, this is a known issue that has been reported recently, and I'm still working to resolve.
The issue is that the frontend cache gets stuck with the old numeric ID for the project and our frontend JS has a bug where it errors out instead of updating the cache to contain the new string ID. LiY's workaround of going to a bogus, uncacheable URL is the suggested workaround to unstick the cache until this bug is resolved.
(And if you didn't recently assign a new string ID to your project, then I'd love to hear more details about what might have caused this issue so it won't happen to anyone else!)

How to overcome the random failing of my selenium webdriver-java script?

Currently, i am running my selenium webdriver - java scripts, there is a strange issue which is cropping up these days. My scripts run absoulutely fine and when I re-run them.. sometimes my scripts enter the values via sendkeys() in some other fields as a result of which my entire script fails.
I dont know the real reason behind it, I know the scripts what i am running are pretty simple and straight flows.. Is this because of my application response issue? Because I have given wait commands also to tackle the same.But when I have re-run the same scripts again it enters the values in some irrelevant fields..
Note: I dont change any of my codes while rerunning it... Its more frustrating
Is this normal when you run Selenium webdriver-java scripts??
Please advise me how to tackle this issue because I am not aware to deal with this issue
You might need to figure out if your elements locators are changing dynamically each time you run and then look at your code locators to be more appropriately handling the change. Other than that I see no reason why the elements being interacted with, change randomly.

Sudden error accessing custom settings in SalesForce

We use custom settings in a SalesForce app. We access it like so:
MySettings__c settings = MySettings__c.getOrgDefaults();
This was working fine, but today the app completely crashed. By that I mean the page doesn't load at all, I just get a white screen telling me an internal error occurred. We traced it down to this line of code - when it is commented out the page loads as well as it can without those settings (but at least it loads).
Running that single line of code in the System Log (using the Execute functionality) also causes a report of Internal System Error. The only thing the system log reports is "FATAL_ERROR Internal Salesforce.com Error." The Apex code modal reports "Internal System Error: 1018505045-332 (-920440070)"
The setting has values for the organization - we've also tried deleting the settings and recreating them to no affect. So far SalesForce has been no help beyond telling us to ask on their website.
This is very frustrating as it was working fine on Friday and today it was broken before anyone touched anything.
What you have there is a platform error. Whenever you get those you should report them to SFDC support and they will be able to see further internal logging to sort it out.
Nothing anyone out here can do to help I am afraid.
Paul
try setting the apiVersion of the affected code back to version 21.0. We had the same issue and making this change has provided an effective workaround.
This was a bug in Salesforce's infrastructure, which has been reported resolved. If you're still seeing this error with API version 22.0, you should create a case with salesforce support.

Resources