function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suneel.patchipulusu@gmail.comsuneel.patchipulusu@gmail.com 

Small Clarifications

1.  Id    =:   decAccount.id  

 

    Question: What '=:' represents?? what does it mean???

 

 

2. decAccount = [Select Id, Distributor__c FROM Account WHERE Id =:decAccount.id];

 

   Question : what will insert in to the decAccount ??

 

I understood llike we are selecting the id, custom object from account then..????

Best Answer chosen by Admin (Salesforce Developers) 
PremanathPremanath

'=:'  mean for just we are comparing here..

 

for inserting purpose we need to write like ,

 

insert var;

 

So your using the query for getting already existing records from object  , not inserting ok..

 

Send me your code i will explain about what you did.

 

 

 

prem

 

All Answers

PremanathPremanath

 

 

decAccount = [Select Id, Distributor__c FROM Account WHERE Id =:decAccount.id];

That is wrong code...  

 

The Right one is..

String str='001.........some id';

 

decAccount = [Select Id, Distributor__c FROM Account WHERE Id =:str];

 

like this we can write the code...

 

you understood llike we are selecting the id, custom object from account then

we are getting only one record who is having the  id(str='001.........some id')   from  all Account records.

 

 

Otherwise send me full code i will explain that...

 

Prem

 

suneel.patchipulusu@gmail.comsuneel.patchipulusu@gmail.com

But we inserted a record into "decAccount" Object

 

So, you will get an ID for the inserted record of the object

 

Here what I didnt understand is what does '=:' notation mean?? Is it like we comparing or inserting tthe decAccount.id into id or???

Select Id, Distributor__c FROM Account WHERE Id =:decAccount.id

PremanathPremanath

'=:'  mean for just we are comparing here..

 

for inserting purpose we need to write like ,

 

insert var;

 

So your using the query for getting already existing records from object  , not inserting ok..

 

Send me your code i will explain about what you did.

 

 

 

prem

 

This was selected as the best answer