• Anudeep B
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 11
    Replies
I am trying to complete the one Lightning task i am getting below CSS error, plz help me on this.

User-added image

Thanks
Ihave this JSON :  

public  class Exinteg {
public string result{get;set;}
public Exinteg()
{
    
    JSONGenerator jg = JSON.CreateGenerator(true);
    jg.writestartObject();
    jg.writestringfield('Name','Sathish');
    jg.writeNumberField('age',30);
    jg.writeFieldName('Account');
    list<account> acc= [select name,industry from account limit 2];  
    jg.writeObject(acc);
  // What processing internally at this line 
    jg.writeFieldName('myarray');
    jg.writestartArray();
    jg.writenumber(10);
    jg.writenumber(20);
    jg.writeEndArray();
    jg.writeEndObject();
    result=jg.getAsString();
    
}
}



{ "Name" : "Sathish", "age" : 30, "Account" : [ { "attributes" : { "type" : "Account", "url" : "/services/data/v33.0/sobjects/Account/0019000001Epo6BAAR" }, "Name" : "Sunkeert", "Id" : "0019000001Epo6BAAR", "Industry" : "Chemical" }, { "attributes" : { "type" : "Account", "url" : "/services/data/v33.0/sobjects/Account/0019000001Epo6CAAR" }, "Name" : "Samba", "Id" : "0019000001Epo6CAAR", "Industry" : "Chemical" } ], "myarray" : [ 10, 20 ] }



i was fetching only name and industry fields from account but why the other coming to JSON? which i didn't use in SOQL Query (in bold above).
I messedup with different answers of batch apex help me on this.


Please correct me below if i go wrong any where.!

/* All in case of batch apex*/
* querylocator ---- will fetch 50 million records.
* one soql query -- will fetch 50000 records.
* getquerylocator-- will fetch 10000 records.
===========================================

Please give me clarification for below.

* How many SOQL queries we can write in a single Batc Apex Class.?
* If we can use more than one SOQLs, can we write on different Objects in the same Batch Apex class.?
* Can SOQL query write in all the methods.(start(), execute(), finish()).?

 Give me clarification on this points, i am confused on these things, even shortly or with explanation.

Thanks.
i am trying to execute below code. where updating a site field in account object.


global class Accbtchstate implements database.batchable<sobject>
{
global database.querylocator start(database.batchablecontext bc)
{
string state = 'select id,name from account';
return database.getquerylocator(state);
}
global void execute(database.batchablecontext bc, list<account> scope)
{
list<account> acc = new list<account>();
for(account a:acc)
{
 a.Site = 'No nedd';
 acc.add(a);
 }
update acc;
}
    
global void finish(database.batchablecontext bc)
{
   
}
}

executing using this:  
1)  Accbtchstate BC = new Accbtchstate();
Database.executeBatch(BC,1000);

please identify problem and guide me how to exactly execute a batch apex.
* i tried all the source to execute.
I just want to know what is exactly mean by Alerts & Notifications and what is the difference between them?

Thanks,
Yogi
I created a custom Object "Location" , all are 3 picklists and each other dependent picklists hirarchely.  

User-added image

I am getting Duplication entries from these fields.
when i select HeadQuarter there can be multiple Areas should be enter but once i select one Area in one HeadQuarter,
the selected Area should not save again in the record .

To avoid this which criteria should i follow,

Workflow
Validation Rule
Trigger

Which one is suitable and how.

Is there any other Good Apporach .


 

I made a batch class which fetched and updates objects information, and now I'm wondering should I make a trigger to run the batch class or should I make a scheduler class ? Could you give me an example of a trigger that calls a batch and how to create a scheduler class ? I have been reading about them , but I'm not sure what to do and where to start.

 

Thanks!

Laaral