You need to sign in to do that
Don't have an account?
Ivaylo Balabanov
Big Object apex error invalid Type
Hello,
I am trying to update a Big Object, but when I try to use it in method it gives me an error Invalid Type. When I use it in Batch class it is OK.
Just trying to figure out where I can use it and where I cannot.
Regards,
Ivo
I am trying to update a Big Object, but when I try to use it in method it gives me an error Invalid Type. When I use it in Batch class it is OK.
Just trying to figure out where I can use it and where I cannot.
Regards,
Ivo
Please follow below code:-
Here is an example of an insert operation in Apex that assumes a table in which the index consists of FirstName__c, LastName__c, and Address__c.
INSERT
UPDATE
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
Let me show you what i have in mind
Map<id,Account> accsMap=new Map<id,Account>([select id,MasterRecordId from Account where id in:oldMap.keyset() and masterrecordid<>null ALL ROWS]);
/*
List<ClientsMonthlyStatus__b> clMonthly=[Select id,account__c from ClientsMonthlyStatus__b where account__c in:accsMap.keyset()];
for(ClientsMonthlyStatus__b cm:clMonthly){
cm.account__c=accsMap.get(cm.account__c).MasterRecordId;
}
Database.insertImmediate(cliMonths);
*/
So when I uncoment this I got a message Invalid Type ClientsMonthlyStatus__b
But in this class
public Database.QueryLocator start(Database.BatchableContext BC){
return Database.getQueryLocator('Select id,Name,Account_Status__c,Date_of_1st_Live_Oppt__c,BillingCountry,Desk__c,Account_Preferred_Language__c from Account where Client__c=1');
}
public void execute(
Database.BatchableContext BC,
List<Account> scope){
List<ClientsMonthlyStatus__b> cliMonths=new List<ClientsMonthlyStatus__b>();
for(Account a:scope){
ClientsMonthlyStatus__b cm=new ClientsMonthlyStatus__b();
cm.Account__c=a.id;
cm.Account_Status__c=a.Account_Status__c;
cm.Live_Since__c=a.Date_of_1st_Live_Oppt__c;
cm.Desk__c=a.Desk__c;
cm.Language__c=a.Account_Preferred_Language__c;
cm.Billing_Country__c=a.BillingCountry;
cm.Client_Name__c=a.Name;
cm.Date__c=system.today();
cm.UniqueField__c=a.id+String.valueof(system.today().year())+String.valueof(system.today().month());
cliMonths.add(cm);
}
Database.insertImmediate(cliMonths);
}
public void finish(Database.BatchableContext BC){
}
It is recognized.
I have tried in other methods. For some it is allowed for some not.
Just trying to figure out what the rules are.
Regards,
Ivo