You need to sign in to do that
Don't have an account?

Getting Error : Expression cannot be assigned at line -1 column -1
Could any suggest that why i am getting this error :
Expression cannot be assigned at line -1 column -1
After saving this method
public static void TempAcc()
{
if( Account.RecordTypeId ='ParticularId')
{
// system.debug('Account category needs to be blank when parent account is selected');
}
}
Expression cannot be assigned at line -1 column -1
After saving this method
public static void TempAcc()
{
if( Account.RecordTypeId ='ParticularId')
{
// system.debug('Account category needs to be blank when parent account is selected');
}
}
let us know if this will help you
In you code you have used if( Account.RecordTypeId =='ParticularId') whic is wrong as in if condition you need to compare two value using == (Equality) operator. whihc will return boolena value true or false. if condition is true then it will execute the code inside the of condition.
Use the below code and let me know if it works for you.
Thanks,
Debasis
First i have used == operator too but on that time its giving error like this :
Compile Error: Comparison arguments must be compatible types: Schema.SObjectField, String.
here you are comparing recordtype id with a string value.
please change this below code as per your objcet name and record type name.'
Here instead of Account.RecordTypeI, please referc to a particular account record's recordtype.
in this below line
id RecTypeId= schema.SobjectType.YourObjectName.getRecordTypeInfosByName().get('Your reordtypename').getrecordtypeId();
replace your object name and record type name to get the id of that record type to check in if condition
It will be more helpful if you can share your complete code to help you out.
Thanks,
Debasis
Comparison arguments must be compatible types: Schema.SObjectField, Id at line 170 column 12
Code : Because of security reasons i cant share the code but this is the only method which i am going to create which is giving error.
Thanks
AMit Chaudhary
please update your method defination to pass the account record and try this below code.
Thanks,
Debasis