Play Games

Search This Blog

Friday, August 31, 2018

Error: Compile Error: Comparison arguments must be compatible types: Datetime, String

This error generally arise when you are comparing datetime field value to string.
Example
DateTime dt = system.now();
if(dt != null && dt !='') { // This line gives error as '' is a string
}

Solution : Just remove the condition dt != '' .
DateTime dt = system.now();
if(dt != null) { // This line checks if datetime field is not null.

}

Error: Compile Error: Illegal assignment from Datetime to Date

This error generally arise when you are assigning datetime field value to Date.
Example :
Assume submitted_Date__c is a date field created on Account.

Account acc = new Account();
DateTime dt = system.Now();
acc.submitted_Date__c = dt;// This line gives error as dt is a datetime field assigning to Date field(submitted_Date__c)

Solution:Convert DateTime to Date and then assign it to other date field.

use date() to convert DateTime to date.
Account acc = new Account();
DateTime dt = system.Now();
acc.submitted_Date__c = dt.date();

Thursday, August 23, 2018

How to move to next line with in the cell in Excel

Problem: When we are entering data with in the cell in excel,if we want to display text in multiple lines,then unable to move to next line.

Solution: Use ALT+ Enter to move to next line

How to check the type of Sandbox in salesforce - Salesforce Globe For You

Problem: We are not able to know what type of sandbox are we using whether fullcopy,Partial sandbox or Developer pro etc as we don't have access to production.

Solution: If you want to know 'Sandbox ABC' type,then login in to that sandbox and go to Setup --> Deployment Settings --> Continue.


Under this,you will find 'This Organisation: Sandbox Type'.