2

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 );
5
  • which "Variable does not exist." ? Commented Jun 29, 2018 at 10:36
  • @ Alexander Berehovskiy, These fields : WhatID__c , WhatObject__c , Question1__c ,Answer1__c
    – TESt ADG10
    Commented Jun 29, 2018 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
    Commented Jun 29, 2018 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
    Commented Jun 29, 2018 at 10:44
  • @Alexander Berehovskiy, you have any idea, please let me know
    – TESt ADG10
    Commented Jun 29, 2018 at 12:19

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .