• linghongyong12@163.com
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 4
    Replies

Few questions:

I have a class with 'State' and 'Number'. The combination should be unique, and should be the Name field for the table. I'm hitting some road blocks that I suspect are built-in limitations of SF:

 

  1. Is there a way to make the Name Field a formula? If there is, I haven't found it.
  2. Is there a way to require the Name Field to be unique?
  3. Is there a way to make any Formula Field unique?

One work-around would be using auto-increment for the Name, but this will show up on Lookup Fields, and that's a deal killer. Any suggestions?

Another would be a Trigger that sets the Name before the district is saved and checks for uniqueness. This seems a lot of work for what should be something easy, but I could do it.

 

Is there an elegant approach. What have people tried?

Hi Everyone,

 

I want to uncheck a checkbox after I save a record.  I have a vadation rule stating the checkbox should be checked if status is "new".  Even if the status is "new" i want the trigger to uncheck the box after save so if someone edits the record they have to recheck the box, if the status is still new.

 

My Trigger:

trigger Uncheckbox on Lead (after update) {

for (Lead cb : Trigger.new) {
if (cb.Confirm_New_Status__c == true) {

Lead ourcb = new Lead (Confirm_New_Status__c=false);


update ourcb;

}
}
}

 

Any suggestions?

 

-Hkp716

 

  • October 24, 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