• Riyaj
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 18
    Replies

Hi

I m used to development edtion for develop some application and apex classes, afte that i used to free Enter prise Ediiton to migrate the data from Developer edtion to Enter prise edition. Using this i used one web application using Asp.net C#. Now its working fine.

Now i want to buy a fresh edtiion from salesforce. before i going to buy i nee to know something.

1. Is it New Edition allowed a previous free edtion datas?
2. Is it allow to a previous apex class and create a new Apex class?
3. If all is allowed, how do i migrate from free edtion to payable edition..

 

Thanks

  • June 04, 2012
  • Like
  • 0

Hi Guys,

 

Can any body tell me how to write the test class for the below class.

 

global class getAttendance{

WebService static Attendance__c getAttendanceFromClassname(string classname){

List<Attendance__c> r =[SELECT id,attendance_Date__c,attendance_Roll__c,class_name__c,Remarks__c,student_Name__c FROM Attendance__c WHERE class_name__c = :classname];
Attendance__c r1;
if(r.size()>0)
{
r1=new Attendance__c(student_Name__c=r[0].student_Name__c,attendance_Roll__c=r[0].attendance_Roll__c,id=r[0].id,Remarks__c=r[0].Remarks__c);
return r[0];
}
else
return new Attendance__c();

}

}

  • May 24, 2012
  • Like
  • 0

Hi.

I am using now sample Development Account name "AdminSample".. I already done all the Apex classes in this Account. I m also use another Developer Account the name of  "AdminOrginal".. Now I wanna to Copy and paste the All the Apex Classes from AdminSample to AdminOrginal... how to transfer the Apex Classes one to another? pls anyone give me brief step by step process??/

 

Regd

Riyaj

  • May 23, 2012
  • Like
  • 0

Hi

My Apex Code:

global class InsertOneAttendanceDate{

WebService static void InsertOneDateAttendance(string studentname,string classname,string dtattendance){

Datetime getDt=DateTime.valueOf(dtattendance);

Attendance__c i=new Attendance__c(student_Name__c= studentname,class_Name__c= classname,attendance_Date__c= getDt);

Insert i;

}

}

My Aspx Code (C#)

String UserId=” 0039000000CYPcOAAX”;

String ClassNameId=” a0390000002vWW9AAM”;

String dtAttendance=” 2012-05-22 12:00 AM”;

InsertAttendanceObj.InsertOneDateAttendance(UserId, ClassNameID, dtAttendance);

 

When I m executing the above query.. the Data is Inserted into Attendance Table in salesforce sucessfully..

But when I m saw in attendance List I cant found that record… when I m bounded in the records in data grid in my asp.net application i can found..... but i cant found in salesforce Table...

 

 Same scenario when I m trying in debugging method the Data is Inserted into Attendance and I can found in the Data field.. Why I cant found the recorded data in saledforce??

 






  • May 22, 2012
  • Like
  • 0


When I am executing the following apex code.. I cannot get records from table. rather then got following error...

Datetime myDate = dateTime.valueOf('2012-5-23 11:00:00 AM');
List<Attendance__c> attnList=[SELECT id,attendance_Date__c,attendance_Roll__c,class_name__c,Remarks__c,student_Name__c FROM Attendance__c WHERE class_Name__c = 'a0390000002xz12AAA' AND attendance_Date__c= :myDate];
List<Attendance__c> l1 = new List<Attendance__c>();
if(attnList.size()>0)
{
for(Attendance__c c : attnList){
Attendance__c l=new Attendance__c(id=c.id,student_Name__c =c.student_Name__c,attendance_Roll__c=c.attendance_Roll__c,Remarks__c=c.Remarks__c,attendance_Date__c=c.attendance_Date__c);
l1.add(l);
}
}
else
{
Attendance__c l=new Attendance__c();
l1.add(l);
}
return l1;

Debug Area

11:10:26:042 SOQL_EXECUTE_BEGIN [3]|Aggregations:0|select id, attendance_Date__c, attendance_Roll__c, class_name__c, Remarks__c, student_Name__c from Attendance__c where (class_Name__c = 'a0390000002xz12AAA' and attendance_Date__c = :tmpVar1)

|myDate|1337796000000

My table record
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Case Number Class Name Student NameAttendance Roll Attendance Date
----------------------------------------------------------------------------------------------------------------------------------------------------------------
0000000238 NRM-2013-WED-1100-1300-JULIANA Martinus KosasihPresent 5/16/2012 11:00 AM
0000000239NRM-2013-WED-1100-1300-JULIANAMartinusKosasihPresent5/23/2012 11:00 AM


  • May 22, 2012
  • Like
  • 0

 

When I am going to insert a record using following apex code, but it is not working. In my table in two fields are i m using lookup table. one is studentname, class name..

 

APEX CODE

global class InsertOneAttendanceDate{
WebService static void InsertOneDateAttendance(string studentname,string classname,datetime dtattendance){
Attendance__c i=new Attendance__c(student_Name__r.Name= studentname,class_Name__r.Name= classname,attendance_Date__c= dtattendance);
Insert i;
}
}

 Error: Compile Error: Invalid field initializer: student_Name__r.Name at line 3 column 35

 

 

 

global class InsertOneAttendanceDate{
WebService static void InsertOneDateAttendance(string studentname,string classname,datetime dtattendance){
Attendance__c i=new Attendance__c(student_Name__r.Name= studentname,class_Name__r.Name= classname,attendance_Date__c= dtattendance);
Insert i;
}
}

  • May 22, 2012
  • Like
  • 0

Hi.

In my webapplication i wanna to bind the data's from salesforce to Grid View. When binding data should follow the one condition. that mean data have one date field,  that date field binded in drop down list in Asp.Net page. User click which date data'a to want to display i grid...  So When I reterive the date is not match into Apex Date..

 

Can Any one solve the Problem?

 

APEX CODE

 

global class getAttendanceGrid{
WebService static List<Attendance__c> getAttendanceForGrid(string classname,String dateString){
DateTime dtAttendance= datetime.valueof(dateString);
List<Attendance__c> attnList=[SELECT id,attendance_Date__c,attendance_Roll__c,class_name__c,Remarks__c,student_Name__c FROM Attendance__c WHERE class_Name__c = :classname AND attendance_Date__c= :dtAttendance];
List<Attendance__c> l1 = new List<Attendance__c>();
if(attnList.size()>0)
{
for(Attendance__c c : attnList){
Attendance__c l=new Attendance__c(id=c.id,student_Name__c =c.student_Name__c,attendance_Roll__c=c.attendance_Roll__c,Remarks__c=c.Remarks__c,attendance_Date__c=c.attendance_Date__c);
l1.add(l);
}
}
return l1;
}}

 

ASPX CODE

 

DateSelect = '5/23/2012 6:00:00 PM';

 getAttendanceGrid.Attendance__c[] getAttendanceGridResponse = getAttendanceGridObj.getAttendanceForGrid(sClassID, DateSelect);

 

above dateselect is the user select date, but  it does not match the apex code, but it return the error.......

 

how do i convert date format ??


 

  • May 22, 2012
  • Like
  • 0

string studentname='0039000000CYPcOAAX';

string classname='a0390000002vWW9AAM';
Datetime dtAttendan='2012-05-22 12:00:00 AM';
InsertOneDateAttendance(studentname,classname,dtAttendan);
attendance__c i = new Attendance__c(student_Name__c= studentname,class_Name__c= classname,attendance_Date__c=dtAttendan);
Insert i;

 

Error: line 3, column 1: Illegal assignment from String to Datetime


  • May 21, 2012
  • Like
  • 0
 


Hi,

 

 

Now I m developing Asp. WEbapplication using salesforce..

 

In sales froce I have object name 'Class' and 'Attendance' . In Attendance have a following fileds
Attendance Date, StudentName, ClassName, Roll.. When I want update the Field Roll wheather using Present/Absent, I need a Attendance record. So I passing parameter passing from aspx page like StudentName, ClassName, and Attendance Date. Here I want to date parameter format correctly... So Is my first question when I am passing the parameter from outside to apex code which date format i am following?

 

Another one when creating the Attendance record from asp.net. i need same above fields. So same I need Date Parameter from c# area..normally the date return '05/12/2011 12:00:00 AM' it is not support the Apex class..

 

 

1. how do I update the Attendance record from using c# parameter?
2.how do i insert the new record from Attendacne record from using c# parameter?

 

Update Apex Class Is


global class UpdateAttendanceList{
WebService static void UpdateAttendanceFromClassname(string id,string classname,string studentname,string attendance){
List<Attendance__c> Alist=[Select student_Name__c,attendance_Roll__c from Attendance__c where id = :id AND class_Name__r.Name= :classname AND student_Name__r.Name= :studentname];
if(Alist.size()>0)
{
Attendance__c conts=Alist.get(0);
conts.attendance_Roll__c= attendance;
update conts;
}

}}


Update Aspx Code:


updateAttendanceObj.UpdateAttendanceFromClassname(Id,sClassName, sStudentname, attendanceText);
//Values
updateAttendanceObj.UpdateAttendanceFromClassname(a0590000002LTetAAG,a0390000002vWW9AAM,0039000000CYPcOAAX,Present);


Insert Apex Class Is

global class InsertOneAttendanceDate{
WebService static void InsertOneDateAttendance(string studentname,string classname,date dtattendance){
Attendance__c i=new Attendance__c(student_Name__c= studentname,class_Name__c= classname,attendance_Date__c= dtattendance);
Insert i;
}
}


Insert Aspx Code:

InsertAttendanceObj.InsertOneDateAttendance(UserId, ClassNameID, firstweekday.Date);

//Values

InsertAttendanceObj.InsertOneDateAttendance(0039000000CYPcOAAX,a0390000002vWW9AAM,05/22/2012 12:00:00 AM)

  • May 21, 2012
  • Like
  • 0

Hi
When executing  the follwing aspx code.. Record does not update...... Why?


Apex Code 

global class UpdateAttendanceList{
WebService static void UpdateAttendanceFromClassname(string classname,string studentname,string attendance){

List<Attendance__c> lstConts = new List<Attendance__c>();

lstConts=[Select student_Name__c,attendance_Roll__c from Attendance__c where class_Name__r.Name= :classname AND student_Name__r.Name= :studentname LIMIT 1];

if(lstConts.size() > 0)

{

Attendance__c conts = new Attendance__c();

conts = lstConts[0];

conts.attendance_Roll__c= attendance;
update conts;

}
}

 

Aspx Code

 

updateAttendanceObj.SessionHeaderValue = new UpdateAttendanceList.SessionHeader();

updateAttendanceObj.SessionHeaderValue.sessionId = sessionId;
updateAttendanceObj.UpdateAttendanceFromClassname(sClassName, sStudentname, attendanceText);

System.QueryException: List has no rows for assignment to SObject

  • May 17, 2012
  • Like
  • 0

Hi
When executing  the follwing aspx code it display the error....

 

Apex Code 

global class UpdateAttendanceList{
WebService static void UpdateAttendanceFromClassname(string classname,string studentname,string attendance){
Attendance__c conts=[Select student_Name__c,attendance_Roll__c from Attendance__c where class_Name__r.Name= :classname AND student_Name__r.Name= :studentname];
conts.attendance_Roll__c= attendance;
update conts;
}
}

 

Aspx Code

 

updateAttendanceObj.SessionHeaderValue = new UpdateAttendanceList.SessionHeader();

updateAttendanceObj.SessionHeaderValue.sessionId = sessionId;
updateAttendanceObj.UpdateAttendanceFromClassname(sClassName, sStudentname, attendanceText);

System.QueryException: List has no rows for assignment to SObject

  • May 17, 2012
  • Like
  • 0

Hi

I m using following Apex Class code...

---------------------------------------------------------------------------------------------------------
List<Attendance__c> r=[SELECT Id,attendance_Date__c,attendance_Roll__c,Remarks__c,student_Name__c FROM Attendance__c WHERE classname__c='Learn Corn' AND attendance_Date__c=2012-05-12];
Attendance__c r1;
if(r.size()>0)
{
r1=new Attendance__c(Id=r[0].Id);
return r[0];
}
else
return new Attendance__c();
---------------------------------------------------------------------------------------------------------
My table records
---------------------------------------------------------------------------------------------------------
Id : a0590000002LE9sAAG
ClassName : Learn Corn -- From Look up
Attendance Date : 5/12/2012
Attendance Roll : Present
Remarks : Hello
Student Name : Gio -- From Look up
---------------------------------------------------------------------------------------------------------
but when i debug it is not working, rather than return values are like
---------------------------------------------------------------------------------------------------------
Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : Gio
Class Name : Learn Corn
---------------------------------------------------------------------------------------------------------
How do i get Date field original Date when executing in Apex Query....????

  • May 17, 2012
  • Like
  • 0

How do I solve the error

REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded.

 

Riyaj

  • May 17, 2012
  • Like
  • 1

Hi

 

I m using following Apex Class code...

 

---------------------------------------------------------------------------------------------------------
List<Attendance__c> r=[SELECT Id,attendance_Date__c,attendance_Roll__c,Remarks__c,student_Name__c FROM Attendance__c WHERE classname__c='Learn Corn' AND attendance_Date__c=2012-05-12];

Attendance__c r1;
if(r.size()>0)
{
r1=new Attendance__c(Id=r[0].Id);
return r[0];
}
else
return new Attendance__c();

---------------------------------------------------------------------------------------------------------

My table records
---------------------------------------------------------------------------------------------------------

Id : a0590000002LE9sAAG
ClassName : Learn Corn -- From Look up
Attendance Date : 5/12/2012
Attendance Roll : Present
Remarks : Hello
Student Name : Gio -- From Look up

---------------------------------------------------------------------------------------------------------

but when i debug it is not working, rather than return values are like

---------------------------------------------------------------------------------------------------------

Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : 0039000000CYP14AAH
Class Name : a0390000002vWW9AAM
---------------------------------------------------------------------------------------------------------

How do i get original text when executing in Apex Query....????

 

  • May 16, 2012
  • Like
  • 0

hi I m using follwing c# coding.. In runtime i got error  "INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session"...

 


getClassId.getClassIdService getClassIdObj = new getClassId.getClassIdService();
getClassIdObj.SessionHeaderValue = new getClassId.SessionHeader();
getClassIdObj.SessionHeaderValue.sessionId = sessionId;


if (ddlClassname.SelectedIndex != 0)
{
string name = ddlClassname.SelectedItem.Text.ToString();

getClassId.Class__c getClassIdResponse = getClassIdObj.getClassIdFromClassname(ddlClassname.SelectedItem.Text.ToString());
Session["ClassName"] = getClassIdResponse.Name;
Session["ClassId"] = getClassIdResponse.Id;
Session["ClassDay"] = getClassIdResponse.Day_of_Week__c;
Response.Redirect("Attendance.aspx");
}
else
{
lbError.Visible = true;
lbError.Text = "You must select class name!";
}




  • May 15, 2012
  • Like
  • 0

Hi,

 

I Apex Class I m using,

 

List<Class__c> r =[SELECT Day_of_Week__c,end_Time__c,start_Time__c,teacher_Name__c,Name from Class__c WHERE teacher_Name__c =:teachername];
Class__c r1;
if(r.size()>0)
{
r1=new Class__c(Name=r[0].Name);
   return r[0];
   }
else
   return new Class__c();

 in above coding Query area i m using Teacher Name, but that query is return null value. But tha table have a value.

 

               After that I using delevloper console, there only i found one problem. normally the query return the Id value of Teacher's name.. So i seraching the Id value from Teacher Name's Tables but I cant find out it. So I dont know how to use teacher name , how to reterive the ID form Apex...??

 

NULL Value Return Code:

getClassName.Class__c getClassNameResponse = getClassNameObj.getClassFromTeacherName(Session["Username"].ToString());
      

 Value Return Code ( Another try)

getClassName.Class__c getClassNameResponse = getClassNameObj.getClassFromTeacherName("0039000000CYPbNAAX");

 


  • May 14, 2012
  • Like
  • 0

I m usng new customize object name 'Class' inside this {'Name', 'Teacher Name'} , Now I want execute query.... i want to get a class name.. but I got a error"

 

Apex Code

 

global class getClassName{
WebService static Class getClassFromTeacherName(string teachername){
List<Class> r=[SELECT Name from Class WHERE teacher_Name__c = :teachername];
if(c.size()>0){
l=new Class(Name=c[0].Name);
}
return l;
}
}

 

Error

ErrorError: Compile Error: getClassName.getClassFromTeacherName: Types cannot be marked as web services at line 2 column 25 

 

 

 

  • May 11, 2012
  • Like
  • 0
Hello,

I m using APEX Class for Check my login form inputs..

Basically I m passing my Username, Password via function from aspnet page. In apex class following coding i m using... when after process this coding ( Username password is match retuen true, or false).. but I got a error when save this Apex Class...

How do I perform my login Username and Password is correct ? If Correct/wrong how do i return the value to asp.net page????

APEX Code
global class getLoginCheck{
 
  WebService static Lead getLoginCheckFromusername(string username,string password) {
 
   Contact r=[SELECT Count() from Contact WHERE Firstname = :username];
  Integer result = 0;
  if(r=0)
  {
  result = 0;
  }
    return result ;
    
  }
}

 



aspx.cs
getLoginInfo.Lead getLoginInfoFromUsername = getLoginInfoObj.getLoginCheckFromusername(txtUsername.text,txtPassword.text);
// Dropdown list name is ddlUsername

 



/**** How do I get return value from return fucnction from Apex Code and how to bind the all the retrn data's to dropdown list ****/
  • May 10, 2012
  • Like
  • 0

Hi,

In Contact I m  using Some Fields ...

Standard Fields
Name

Cutomize Fields
ContactType
ClassName,

I want to select the Contact's under given condition.....

Conditions
1. ContactType ="Student"
2.ClassName=//** Get from Passing Parameter **//

-----------  Contact Custom Fields Screen -----------------------------

  • May 09, 2012
  • Like
  • 0
Hi,
In my applicaton i using Contace tab.. I want select all the Firstname only from here. and also to bind the all the Firstname in asp.net page dropdown list.. When I m trying this task i got error like  "System.QueryException: List has more than 1 row for assignment to SObject"
Can You please solve the problem?

My Apex Class Code : 

global class getUserName{
 
  WebService static Lead getLeadUserName() {
    Lead c = [SELECT FirstName FROM Lead ];
      Lead l= new Lead(FirstName =c.FirstName);
   return l; 
 
  }
}

 



My aspx Code Behind:

 getUserName.getUserNameService getUserNameObj = new getUserName.getUserNameService();
            getUserNameObj.SessionHeaderValue = new getUserName.SessionHeader();
            getUserNameObj.SessionHeaderValue.sessionId = sessionId;
 
            getUserName.Lead getUserNameResponse = getUserNameObj.getLeadUserName();
 
            ddlUserName.Items.Add(getUserNameResponse.FirstName);

 

  • May 07, 2012
  • Like
  • 0

How do I solve the error

REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded.

 

Riyaj

  • May 17, 2012
  • Like
  • 1

Hi

I m used to development edtion for develop some application and apex classes, afte that i used to free Enter prise Ediiton to migrate the data from Developer edtion to Enter prise edition. Using this i used one web application using Asp.net C#. Now its working fine.

Now i want to buy a fresh edtiion from salesforce. before i going to buy i nee to know something.

1. Is it New Edition allowed a previous free edtion datas?
2. Is it allow to a previous apex class and create a new Apex class?
3. If all is allowed, how do i migrate from free edtion to payable edition..

 

Thanks

  • June 04, 2012
  • Like
  • 0

Hi.

I am using now sample Development Account name "AdminSample".. I already done all the Apex classes in this Account. I m also use another Developer Account the name of  "AdminOrginal".. Now I wanna to Copy and paste the All the Apex Classes from AdminSample to AdminOrginal... how to transfer the Apex Classes one to another? pls anyone give me brief step by step process??/

 

Regd

Riyaj

  • May 23, 2012
  • Like
  • 0

Hi

My Apex Code:

global class InsertOneAttendanceDate{

WebService static void InsertOneDateAttendance(string studentname,string classname,string dtattendance){

Datetime getDt=DateTime.valueOf(dtattendance);

Attendance__c i=new Attendance__c(student_Name__c= studentname,class_Name__c= classname,attendance_Date__c= getDt);

Insert i;

}

}

My Aspx Code (C#)

String UserId=” 0039000000CYPcOAAX”;

String ClassNameId=” a0390000002vWW9AAM”;

String dtAttendance=” 2012-05-22 12:00 AM”;

InsertAttendanceObj.InsertOneDateAttendance(UserId, ClassNameID, dtAttendance);

 

When I m executing the above query.. the Data is Inserted into Attendance Table in salesforce sucessfully..

But when I m saw in attendance List I cant found that record… when I m bounded in the records in data grid in my asp.net application i can found..... but i cant found in salesforce Table...

 

 Same scenario when I m trying in debugging method the Data is Inserted into Attendance and I can found in the Data field.. Why I cant found the recorded data in saledforce??

 






  • May 22, 2012
  • Like
  • 0

 

When I am going to insert a record using following apex code, but it is not working. In my table in two fields are i m using lookup table. one is studentname, class name..

 

APEX CODE

global class InsertOneAttendanceDate{
WebService static void InsertOneDateAttendance(string studentname,string classname,datetime dtattendance){
Attendance__c i=new Attendance__c(student_Name__r.Name= studentname,class_Name__r.Name= classname,attendance_Date__c= dtattendance);
Insert i;
}
}

 Error: Compile Error: Invalid field initializer: student_Name__r.Name at line 3 column 35

 

 

 

global class InsertOneAttendanceDate{
WebService static void InsertOneDateAttendance(string studentname,string classname,datetime dtattendance){
Attendance__c i=new Attendance__c(student_Name__r.Name= studentname,class_Name__r.Name= classname,attendance_Date__c= dtattendance);
Insert i;
}
}

  • May 22, 2012
  • Like
  • 0

string studentname='0039000000CYPcOAAX';

string classname='a0390000002vWW9AAM';
Datetime dtAttendan='2012-05-22 12:00:00 AM';
InsertOneDateAttendance(studentname,classname,dtAttendan);
attendance__c i = new Attendance__c(student_Name__c= studentname,class_Name__c= classname,attendance_Date__c=dtAttendan);
Insert i;

 

Error: line 3, column 1: Illegal assignment from String to Datetime


  • May 21, 2012
  • Like
  • 0

Hi
When executing  the follwing aspx code it display the error....

 

Apex Code 

global class UpdateAttendanceList{
WebService static void UpdateAttendanceFromClassname(string classname,string studentname,string attendance){
Attendance__c conts=[Select student_Name__c,attendance_Roll__c from Attendance__c where class_Name__r.Name= :classname AND student_Name__r.Name= :studentname];
conts.attendance_Roll__c= attendance;
update conts;
}
}

 

Aspx Code

 

updateAttendanceObj.SessionHeaderValue = new UpdateAttendanceList.SessionHeader();

updateAttendanceObj.SessionHeaderValue.sessionId = sessionId;
updateAttendanceObj.UpdateAttendanceFromClassname(sClassName, sStudentname, attendanceText);

System.QueryException: List has no rows for assignment to SObject

  • May 17, 2012
  • Like
  • 0

Hi

I m using following Apex Class code...

---------------------------------------------------------------------------------------------------------
List<Attendance__c> r=[SELECT Id,attendance_Date__c,attendance_Roll__c,Remarks__c,student_Name__c FROM Attendance__c WHERE classname__c='Learn Corn' AND attendance_Date__c=2012-05-12];
Attendance__c r1;
if(r.size()>0)
{
r1=new Attendance__c(Id=r[0].Id);
return r[0];
}
else
return new Attendance__c();
---------------------------------------------------------------------------------------------------------
My table records
---------------------------------------------------------------------------------------------------------
Id : a0590000002LE9sAAG
ClassName : Learn Corn -- From Look up
Attendance Date : 5/12/2012
Attendance Roll : Present
Remarks : Hello
Student Name : Gio -- From Look up
---------------------------------------------------------------------------------------------------------
but when i debug it is not working, rather than return values are like
---------------------------------------------------------------------------------------------------------
Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : Gio
Class Name : Learn Corn
---------------------------------------------------------------------------------------------------------
How do i get Date field original Date when executing in Apex Query....????

  • May 17, 2012
  • Like
  • 0

Hi

 

I m using following Apex Class code...

 

---------------------------------------------------------------------------------------------------------
List<Attendance__c> r=[SELECT Id,attendance_Date__c,attendance_Roll__c,Remarks__c,student_Name__c FROM Attendance__c WHERE classname__c='Learn Corn' AND attendance_Date__c=2012-05-12];

Attendance__c r1;
if(r.size()>0)
{
r1=new Attendance__c(Id=r[0].Id);
return r[0];
}
else
return new Attendance__c();

---------------------------------------------------------------------------------------------------------

My table records
---------------------------------------------------------------------------------------------------------

Id : a0590000002LE9sAAG
ClassName : Learn Corn -- From Look up
Attendance Date : 5/12/2012
Attendance Roll : Present
Remarks : Hello
Student Name : Gio -- From Look up

---------------------------------------------------------------------------------------------------------

but when i debug it is not working, rather than return values are like

---------------------------------------------------------------------------------------------------------

Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : 0039000000CYP14AAH
Class Name : a0390000002vWW9AAM
---------------------------------------------------------------------------------------------------------

How do i get original text when executing in Apex Query....????

 

  • May 16, 2012
  • Like
  • 0
Hello,

I m using APEX Class for Check my login form inputs..

Basically I m passing my Username, Password via function from aspnet page. In apex class following coding i m using... when after process this coding ( Username password is match retuen true, or false).. but I got a error when save this Apex Class...

How do I perform my login Username and Password is correct ? If Correct/wrong how do i return the value to asp.net page????

APEX Code
global class getLoginCheck{
 
  WebService static Lead getLoginCheckFromusername(string username,string password) {
 
   Contact r=[SELECT Count() from Contact WHERE Firstname = :username];
  Integer result = 0;
  if(r=0)
  {
  result = 0;
  }
    return result ;
    
  }
}

 



aspx.cs
getLoginInfo.Lead getLoginInfoFromUsername = getLoginInfoObj.getLoginCheckFromusername(txtUsername.text,txtPassword.text);
// Dropdown list name is ddlUsername

 



/**** How do I get return value from return fucnction from Apex Code and how to bind the all the retrn data's to dropdown list ****/
  • May 10, 2012
  • Like
  • 0
Hi,
In my applicaton i using Contace tab.. I want select all the Firstname only from here. and also to bind the all the Firstname in asp.net page dropdown list.. When I m trying this task i got error like  "System.QueryException: List has more than 1 row for assignment to SObject"
Can You please solve the problem?

My Apex Class Code : 

global class getUserName{
 
  WebService static Lead getLeadUserName() {
    Lead c = [SELECT FirstName FROM Lead ];
      Lead l= new Lead(FirstName =c.FirstName);
   return l; 
 
  }
}

 



My aspx Code Behind:

 getUserName.getUserNameService getUserNameObj = new getUserName.getUserNameService();
            getUserNameObj.SessionHeaderValue = new getUserName.SessionHeader();
            getUserNameObj.SessionHeaderValue.sessionId = sessionId;
 
            getUserName.Lead getUserNameResponse = getUserNameObj.getLeadUserName();
 
            ddlUserName.Items.Add(getUserNameResponse.FirstName);

 

  • May 07, 2012
  • Like
  • 0