Monday 12 August 2019

Salesforce Standard Errors & Solutions

Error 1 :
Having an active trace flag triggers debug logging.You have 1,022 MB of the maximum 1,000 MB of debug logs.Before you can edit trace flags,delete some debug logs.
Now we retain debug logs for 7 days.Refer
So its important to clear the unwanted debug logs especially while working with larger teams.

Error 2 : Storage Limit Exceeded 
Best practice to monitor your storage limits,Clear unwanted data/files to fix the above mentioned issue.
Setup | Administration Setup |Data Management | Storage Usage.

Note : Data storage and file storage are calculated asynchronously,So after uploading the large file immediately it will not reflect in the result.

Error 3 : An invalid input parameter was specified for Apex action <Class Name>:<Variable Name>
Compare the called invocable method parameter name in process builder and apex class invocable method.
Ex1:Passing Contract Id's.In Apex class earlier its 'ids' and same selected in PB.Later due to some reason changed the parameter in Apex class to 'ContractIds' instead of Id's.Then its invalid and gets above mentioned error.

Error 4 : Single Sign-On Error :We can't log you in. Check for an invalid assertion in the SAML Assertion Validator (available in Single Sign-On Settings) or check the login history for failed logins.
Please verify your user id is active or not to in the org which you are trying to login through SSO.

Error 5 : UNKNOWN_EXCEPTION : Failed to run tests synchronously.: admin operation already in progress Salesforce.
Either you can give some time and try again ,Since its environment is in update progress,(Or)
Go To --> Developer Console --> Test [Tab] --> Select "Always Run Asynchronously"

Error 6 : INVALID_CROSS_REFERENCE_KEY: More than 1 package retrieved with single package flag.
This error received when trying to retrieve the package.xml from work bench,
Fix: Don't select the check box Single Package 

Error 7 :The file uploaded is not a valid ZIP file. Please try again.
This error received when trying to deploy package.xml from workbench.
Fix: Have complete metadata in zip file along with packge.xml & Then select and deploy.

Error 8 :An object <> of type Flow was named in package.xml, but was not found in zipped directory.
This error received when trying to deploy process builder ,

Fix: Remove the version number from the deployment package.xml

Error 9 :duplicate field selected: <Field Name> 
This error received when trying to select same field name in SOQL

Fix: Remove the duplicate field name in the query

Error 10 :System.CalloutException:Read time out 
--> By default the time out is 10 Sec & Max is 120 Sec & Min is 1 Sec ,
HttpRequest req = new HttpRequest();
req.setTimeout(20000); // Milli seconds

-->Network Issue :
White list the Salesforce IP addresses range.

Error 11 : Methods defined as TestMethod do not support Web Service Call Outs .  
Requires to implement "Mock" call out ,Instead of directly calling the actual web service call out.

Error 12 : .System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out  
Callouts aren’t allowed after DML operations in the same transaction.
1.If in Apex Class --> Perform call out in separate transaction like in future method.
2.If required to have in Apex Test Class --> Insert Test data + Call out between[test.start & test.stop]

Error 13 : An object 'XYZ-2' of type Flow was named in package.xml, but was not found in zipped directory.
My Workaround
1.Remove the version number from the package.xml of the type name "Flow"
2.Activate the PB after deployment