1

I am creating Big Object through workbench like Survey__b. I inserting record through developer console, in this time showing error:

Variable does not exist.

But i have all variables in the big object. When i highlight these fields(Question1__c, Answer1__c,WhatID__c,WhatObject__c) inserting WhatTime__c only and get ID. How to insert all fields? could anybody help on this.

Inserting data:

Account a = [ select id, name from account limit 1 ];  
Survey__b survey = new Survey__b();  
survey.WhatID__c = a.id;  
survey.WhatTime__c = System.today() + 1;  
survey.WhatObject__c = 'Account';  
survey.Question1__c = 'What is the rating';  
survey.Answer1__c = '1';  
Database.SaveResult saveResult = database.insertImmediate(survey);  
System.debug( ' success ' + saveResult.isSuccess() + ' ' + saveResult );
  • which "Variable does not exist." ? – Oleksandr Berehovskyi Jun 29 '18 at 10:36
  • @ Alexander Berehovskiy, These fields : WhatID__c , WhatObject__c , Question1__c ,Answer1__c – TESt ADG10 Jun 29 '18 at 10:39
  • I THINK you missed one variable.Please try it in anonymous window you will come to know.check debug log if you miss any required field – Annappa PH Jun 29 '18 at 10:39
  • @ Annappa PH, I am using these two fields, then successfully inserted. WhatTime__c = DateTime.newInstance(2018, 2, 5), WhatID__c = 'A100'; .. What is the problem of using other fields – TESt ADG10 Jun 29 '18 at 10:44
  • @Alexander Berehovskiy, you have any idea, please let me know – TESt ADG10 Jun 29 '18 at 12:19
0

Check the permission.

I have the same error and it is because of the permission.

Once, check all of the field permission, it works fine.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.