• Amans
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 0
    Replies
hi ,
I m using getupdated call and getting error  ,

INVALID_REPLICATION_DATE: startDate cannot be more than 30 days ago

i m  giving date in this format

startdate = 12/01/2008 23:45:56 AM

enddate =  14/01/2008 21:23:56 PM

anyone can  help , it will be better if u help by giving an example

thx

aman

 

  • January 14, 2008
  • Like
  • 0
Hey guys
I m going through transaction control and savepoint feature of apex code and using global class and webservice keyword

webService Static Account[] roll_demo(String arg)
     {
          String[] ss = new String[]{arg};
          Account[] acc =  [select id,billingcity,name  from account where name='Aman'];
          insert acc;
          System.assertEquals(null,[select accountnumber  from  account  where id = :acc.Id].accountnumber);
      Savepoint sp = Database.setSavepoint();
          
          
          return acc ;
     }


so i get error , i m not sure of the cause but i had tried  by using public class also , but it didn't work

any one can suggest where  im commiting a mistake
thx
Aman Sehgal
  • December 12, 2007
  • Like
  • 0
Hey  guys ,
I m going through the DML statements  in Apex code  , while using merge call in my class i got stuck
Im executing through my S-control in this manner
S-Control
var name = "Aman";
 var name1="Acme";
var merge_demo = sforce.apex.execute("DML","Mer_demo",{arg:name},{arg1:name1});

Class
webService static Account[] Mer_demo(String arg,String arg1)
       {
            String[] ss = new String[]{arg};
            String[] yy = new String[]{arg1};
            Account[] masterAcc = [select id,name from account where name in :ss ];
            Account[] mergeAcc = [select id,name from account where name in : yy ];
         
           try{
                merge masterAcc mergeAcc ;
            }
            catch(System.DmlException e)
            {
                alert(e);
                // process exception
            }
           
            return masterAcc;
       }

when i  execute this i got error and it didn't execute ,
anyone can help me in this

plz suggest
thx
Aman Sehgal
  • December 10, 2007
  • Like
  • 0
hey Guys ,

just going through Apex code SOQL  queries and found some statements that confuse me a bit ,
u guys just have a look and help me out to reach any conclusion

statement 1

"It is important to note that SOQL queries only return data for SObject fields that are selected in the original query. Any fields that are not selected in the SOQL query (other than ID) are null when dereferenced in Apex Code, even if they contain values in the database."

Account a1 = [select id from accountwhere name = 'Acme'];
Double amt1 = 2 * a1.annualRevenue;
// The code above is incorrect: amt1 is now null, even if
// the account contains a value for annualRevenue in the
// database
Account a2 = [select id, annualRevenue from account
where name = 'Acme'];
Double amt2 = 2 * a2.annualRevenue;
48
Expressions
// The code above is correct: if the account contains a value
// for annualRevenue in the database, amt2 will not be null


statement 2
"Even if only one SObject field is selected, a SOQL query always returns a complete record. Consequently, you must dereference the field in order to access it.
"

Double rev = [select annualRevenue from account
where name = 'Acme'][0].annualRevenue;

*contradiction is  if I can access only those fields that are in the original query what is the need to dereference it ,
and if  query returns a complete record then i can derefernce any field without necessarly providing in query*

thx
  • November 22, 2007
  • Like
  • 1
1. how to open SFDC Attachments from a custom Application
2. How to maintain SessionId between two pages in custom Application

 

  • November 13, 2007
  • Like
  • 0
Hey Freinds ,
 
How can we call triggers  in Apex code from our S-Control
I have tried to figure out  by trying  for Apex class and my  javascript code
 
global class myClass {

webService static Id makeContact(String lastName, Account a) {

Contact c = new Contact(LastName = lastName, AccountId = a.Id);

return c.id;

}

}

Ajax code

var account = sforce.SObject("Account");

var id = sforce.apex.execute("myClass","makeContact",

{a:"Smith",

b:account});

But not able to get for triggers from S-control

Message Edited by Amans on 09-19-2007 05:46 AM

  • September 19, 2007
  • Like
  • 0
hey Guys ,

just going through Apex code SOQL  queries and found some statements that confuse me a bit ,
u guys just have a look and help me out to reach any conclusion

statement 1

"It is important to note that SOQL queries only return data for SObject fields that are selected in the original query. Any fields that are not selected in the SOQL query (other than ID) are null when dereferenced in Apex Code, even if they contain values in the database."

Account a1 = [select id from accountwhere name = 'Acme'];
Double amt1 = 2 * a1.annualRevenue;
// The code above is incorrect: amt1 is now null, even if
// the account contains a value for annualRevenue in the
// database
Account a2 = [select id, annualRevenue from account
where name = 'Acme'];
Double amt2 = 2 * a2.annualRevenue;
48
Expressions
// The code above is correct: if the account contains a value
// for annualRevenue in the database, amt2 will not be null


statement 2
"Even if only one SObject field is selected, a SOQL query always returns a complete record. Consequently, you must dereference the field in order to access it.
"

Double rev = [select annualRevenue from account
where name = 'Acme'][0].annualRevenue;

*contradiction is  if I can access only those fields that are in the original query what is the need to dereference it ,
and if  query returns a complete record then i can derefernce any field without necessarly providing in query*

thx
  • November 22, 2007
  • Like
  • 1