• prady
  • NEWBIE
  • 80 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 89
    Questions
  • 58
    Replies
I want to show some documents in the content library to customer community users. Can this be done?

http://help.salesforce.com/HTViewHelpDoc?id=customer_portal_content.htm&language=en_US

    Update Customer Portal profiles:

    Clone the Customer Portal User or Customer Portal Manager profile.

    In the cloned profiles, add the “View Content in Portals” user permission.

    Change the tab visibility for the Libraries, Content, and Subscriptions tabs from Tab Hidden to Default On.

    Assign the cloned profiles to your Customer Portal users.

I cant find View Content in Portals for the foll licenses

Authenticated Website
High Volume Customer Portal
Customer Portal Managed Custom
Customer Portal Managed Standard

Is there some way we could enable content for these licenses?
  • February 26, 2014
  • Like
  • 0

Hi,

 

I have a custom button created and i am calling a VF page to open in new window. I have also the window properites set up. I have unchecked the field 'Show Address bar " in "Window properties". But the new page still shows the address bar.

 

Does anyone have the same problem? Or am i doing something wrong?

 

 

Width (in pixels)265
Height (in pixels)300
*Window PositionNo Preference
Resizeableunchecked
Show Address Barunchecked
Show Scrollbars unchecked
Show Toolbars unchecked
Show Menu Bar unchecked
Show Status Bar checked
  • January 10, 2012
  • Like
  • 0

Hi,

 

I am trying to have a jquery plugin into Vf page.

Plugin : Zclip http://www.steamdev.com/zclip/

 

I have put the files required in to static resource. this plugin uses a swf file

Here is the code to use in html

 

$(document).ready(function(){
$('a#copy-description').zclip({
path:'js/ZeroClipboard.swf',
copy:$('p#description').text()
});

 

Below is my VF page: I am not sure if the path i am giving for is correct in VF page. It doesnt seem to work oin VF page

path:'js/ZeroClipboard.swf',

 

<apex:page standardController="Account" sidebar="false" showHeader="false" id="page1">
 <apex:includeScript value="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"/>
<apex:includeScript value="{!URLFOR($Resource.zclip, 'jquery.zclip.min.js')}"/>


     <script type="text/javascript">
         var j$ = jQuery.noConflict();
 
        j$(document).ready(function(){
j$('#copyname1').zclip({
path:"{!URLFOR($Resource.zclip, 'ZeroClipboard.swf')}",  // i am not sure if this is the right way to do it
copy:j$('#txtaccname1').text()
});
        });
     </script> 
<table>
<tr> <td>Account Name :</td> <td> <apex:outputField value="{!account.name}" id="txtaccname1"/> </td><td><input type="button" id="copyname1" class="btn" value="Copy to Clipboard" /></td></tr>
</table>

 any ideas why its not working

  • $(document).ready(function(){
  • $('a#copy-description').zclip({
  • path:'js/ZeroClipboard.swf',
  • copy:$('p#description').text()
  • });
  • December 28, 2011
  • Like
  • 0

Hi,

 

I have aVF page where in i am trying to copy a outputtext value into prompt. The idea is to have an option to copy field values into clipboard.

The issue i am facing is that the value in javascript is coming as undefined.

first alert shows page1:txtaccid

the second alert shows undefined.

 

Any idea what could be the issue

 

<apex:page standardController="Account" sidebar="false" showHeader="false" id="page1">
  <!-- Begin Default Content REMOVE THIS -->
<script>
function copyToClipid(textid)
{
alert(textid);
alert(document.getElementById(textid).value);
var copy_id= document.getElementById(textid).value;
window.prompt ("Copy to clipboard: Ctrl+C, Enter", copy_id);

}
</script>
    
Account :  <apex:outputField value="{!account.id}" id="txtaccid"/> <input type="button" id="copyMe" class="btn" value="Copy to Clipboard" onclick="copyToClipid('{!$Component.txtaccid}');"/><br/>
Account Name : <apex:outputField value="{!account.name}" id="txtaccname"/>

  <!-- End Default Content REMOVE THIS -->
</apex:page>

 

  • December 27, 2011
  • Like
  • 0

Hi,

 

On researching on apex scheduler to for scheduling a class for every 10 or 15 mins we would need to write the schedule code in the system log.

 YourScheduleClass c = new YourScheduleClass();
String sch = '0 0 * * * ?';
System.schedule('Schedule Job1', sch, c);

YourScheduleClass c = new YourScheduleClass();
String sch = '0 10 * * * ?';
System.schedule('Schedule Job2', sch, c);

YourScheduleClass c = new YourScheduleClass();
String sch = '0 20 * * * ?';
System.schedule('Schedule Job3', sch, c);

YourScheduleClass c = new YourScheduleClass();
String sch = '0 30 * * * ?';
System.schedule('Schedule Job4', sch, c);

 Would these entries be an one time job on production env? Would it affect anything if i edit/change the times later?

  • December 26, 2011
  • Like
  • 0

I am trying to understand upsert from data loader. I ws reading through documentation and came across below

 

If you are performing an upsert:

  1. Your CSV file must contain a column of ID values for matching against existing records. The column may be either an external ID (a custom field with the “External ID” attribute), or Id (the Salesforce record ID). From the drop-down list, select which field to use for matching. If the object has no external ID fields, Id is automatically used. For more information on external IDs, see Custom Field Attributes. Click Next to continue.
  2. If your file includes the external IDs of an object that has a relationship to your chosen object, enable that external ID for record matching by selecting its name from the drop-down list. If you make no selection here, you can use the related object's Id field for matching by mapping it in the next step. Click Next to continue.

My understanding of this is that, i need to have in my csv file id or an external id field to have match and upsert. If i dont have a reference in csv file for id or external id in the object i want to upsert to then i cant go ahead with upsert? Is step 1 necessary ? Can i do 2 without step1? 

 

I am not very clear on what step 2 does. can anyone explain it to me?

 

In my csv file i dont have an id but i have an external id on a related object. Can i perform an upsert?

  • December 22, 2011
  • Like
  • 0

hi

 

i have an customobject. i have a view created to show some records. i want to have an ability to update a field in the custom object to true for all selected records. i have a custom button created and have it included in the view layout

 

I am not sure how to go about doing the update using java script.  i have the behaviour as execute javascript and in onclick javascript i have

	{!Appointment__c.test1__c}='true'

 Test1 is the field which i want to update. check syntax give no errors but when i click the button its gives

A problem with the OnClick JavaScript for this button or link was encountered:

syntax error

 Any ideas, i dont mind using javascript or any other means to do a mass update.

 

Thanks

 

 

  • December 21, 2011
  • Like
  • 0

Hi,

 

i have 3 custom object trnasaction, item and devices

 

Transaction has a field called asset , devices has a field called item and item has a field called assetno

i am trying to read through data from trnasaction and upsert into devices with assetno as external id.

 

My question is since devices has a lookup to item and item has asset no, can we relate transaction.asset and devices.item.assetno

 

I dont know if i am making any sense.  basically what i want is upsert into devices using asset as external id. Should devices have a field called asset to work or can it check with item.asset?

 

 

  • December 20, 2011
  • Like
  • 0

hi,

 

how does upsert work?

my understanding is that it checks if there is a record with unique id and if its available then it updates that record and if its not then inserts it.

 

Am i right?

 

I seem to get an error

Upsert failed. First exception on row 1; first error: DUPLICATE_EXTERNAL_ID, Asset Tag: more than one record found for external id field: [a11M0000000CwJqIAK, a11M0000000CwJvIAK]: [Asset_Tag__c]

 

i have a list with item and they dont have asset tag repeating in that

 

system.debug('LstItem Asset_Tag__c'+LstItem );
		upsert 	LstItem Asset_Tag__c;

 From the debug log

 

LstItem Asset_Tag__c(Item_c__c:{Scanned_By__c=005M0000000IlxyIAC, Asset_Tag__c=12149, Status__c=Active, Scan_Location__c=001M0000008GzJXIA0, Last_Scan_Date__c=2011-12-17 06:08:47}, Item_c__c:{Scanned_By__c=005M0000000IlxyIAC, Asset_Tag__c=23157, Status__c=Active, Scan_Location__c=001M0000008GzJXIA0, Last_Scan_Date__c=2011-12-17 08:26:14})

 You can see that the asset tags are not repeated. So i am not sure from where the duplicate external id is coming

 

Thanks

  • December 19, 2011
  • Like
  • 0

I need to query an object called trans__c which has the following fields

 

id,

scantime__c // datetime

name

asset__c // external id

status

 

I need to get only data which has status as pending and if there are any repeating asset then i need to get only  record with scantime as the latest.

 

Thanks

 

 

 

  • December 17, 2011
  • Like
  • 0

Hi,

 

Do governor limits apply when i use a insert using a list.

 

For eg. i add all the records to be inserted in to a list and finally give a insert list. I might have 3000 records in the list

Does it take as one DML statement or does it take as 3000 DML statements?

 

Thanks

 

  • December 15, 2011
  • Like
  • 0

If you are looking to implement salesforce solutions that require

1) Visual Force/Apex development for internal application or Appexchange applications

2) .Net Development, Database developement(SQLServer, Oracle)

3) Integrations

4) Automation of Day to day maintanance and data clean up activities

I am currently accepting small and large projects. I have over 12 years experience developing enterprise solutions in multiple technologies and is accepting projects. I do money back guarantee.


Please contact pradykris@gmail.com

 

Best Regards

Pradip

  • November 30, 2011
  • Like
  • 0

Hi,

 

I want to send email when a field is updated in a custom object. so i have a trigger written. i also created a email template.

I find that the targetobjectid is a required field while sending an email. Its erroring out where i am setting targeto

bject .Id. It says Save error: Variable does not exist: Lstuser.id

Any ideas what am i doing wrong

trigger change_action on Ticket__c (after update) {
	//List<user>Lstuser= new List<user>();
	List<id> lstid=new List<id>();
	List<string> lstemail= new List<string>();
	Map<id,string> Mapemail = new Map<id,string>();
	

	for(ticket__c t:trigger.new)
	{
		if(trigger.isUpdate)
		{
			if(t.Actions__c!=System.Trigger.oldMap.get(t.Id).Actions__c)
			{
				lstemail.clear();
				lstemail.add(t.Initiator_Email__c);
				lstemail.add(t.Admin_email__c);
				
				for(User Lstuser:[select id, email,username from user where email in :lstemail]);
				{
				List<EmailTemplate> emailtemplatelist = new List<EmailTemplate>();
				emailtemplatelist=[select id, name from EmailTemplate where name='Update on ticket'];
				if (emailtemplatelist.size()>0)
				{
					//emailtemplatelist[0]
					Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
					mail.toAddresses = new string[]{t.Initiator_Email__c,t.Admin_email__c};
					//mail.setToAddresses(t.Initiator_Email__c);
					mail.setTemplateId(emailtemplatelist[0].id);
/**************************Its THROWING ERROR ON BELOW LINE **********************************/ mail.TargetObjectId(Lstuser.id);//ERROR ON THIS LINE Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } } } } } }

 

  • November 24, 2011
  • Like
  • 0

Hi,

 

I want the edit or change the display of fields in  Items to Aprrove List.  Is this possible? I want to show the person who intiated the approval process than the most recent approver.

 

Can it be done?

 

Thanks

  • November 23, 2011
  • Like
  • 0

Hi,

Since chatter users dont have access to cases, I am developing a ticketing system.

I need to restrict the view of tickets created only to the owner of the record and an assigned user. Would this be possible?

 

Thanks

  • November 23, 2011
  • Like
  • 0

Hi,

 

I have a few reports created. I want these reports to be viewed by a particular profile. They should not be able to edit it. How can i set these ?

 

Thanks

Prady

  • November 22, 2011
  • Like
  • 0

Hi,

 

I have a class written and when i move the class to production i get an error. Everything seems to work fine on sandBox.

If i remove the block of code it passes the code to production. I have a almost similar piece of code just

below the erroring code. This works fine and gets passed over into production. Any ideas on what could

be the issue?

 

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.AppointmentController.refresh: line 252, column 82 Class.Test_Appointment.Testapp: line 29, column 6 External entry point"

 

Here is my code

 

Public Class AppointmentController
{

    public PageReference createApp() {
    
        return page.Appointment;
    }

Public Appointment__c Appointment { get; set; }
public String Error { get; set; }
public String ClientsSearch { get; set; }
public list<CEventTimeSlot> liETimeSlots {get;set;}
public list<CEventTimeSlot> liETimeSlots_form {get;set;}
public list<CTimeSlot> liTimeSlots {get;set;}
public list<CTimeSlot> liTimeSlots_form {get;set;}
public Map<string,CTimeSlot> mapTimeToSlot {get;set;}
public Map<string,CEventTimeSlot> mapETimeToSlot {get;set;}
public List<String> LstString{get;set;}

Public AppointmentController()
{
Appointment = new  Appointment__c();
}
   


/* function called from VF page for updating the startdatetime and endDatetime  and rendering into VF page   */
   public PageReference refresh() {
    try
      {
         liTimeSlots = new list<CTimeSlot>();
         mapTimeToSlot = new Map<string,CTimeSlot>();
         liTimeSlots_form = new list<CTimeSlot>();
         //For adding Events
         liETimeSlots = new list<CEventTimeSlot>();
         mapETimeToSlot = new Map<string,CEventTimeSlot>();
         liETimeSlots_form = new list<CEventTimeSlot>();
          
          
          
         

        
      if (Appointment.Start_Date__c<>null)
      {
        Time pktime;
        Time pkTime1;
        List<Time> LstTime = new List<Time>();
        pktime=time.newInstance(7,0,0,0);
        LstTime.add(pktime);

        for(integer ctr=0; ctr<30;ctr++)
        {
            pktime=pktime.addMinutes(30);
            LstTime.Add(pkTime);
        }
        system.Debug(' Listtime '+LstTime);
        
        system.debug('No of Time Items'+LstTime.size());
        for(integer ctr1=0; ctr1<LstTime.size();ctr1++)
        {       
        
        CTimeSlot newSlot = new CTimeSlot(string.valueof(LstTime[ctr1]));
        liTimeSlots.add(newSlot);
        
        mapTimeToSlot.put(string.valueof(LstTime[ctr1])+ '', newSlot);
        newSlot=null;
        
        CEventTimeSlot newESlot = new CEventTimeSlot(string.valueof(LstTime[ctr1]));
        liETimeSlots.add(newESlot);
        
        mapETimeToSlot.put(string.valueof(LstTime[ctr1])+ '', newESlot);
        newESlot=null;
        }
        
        
		system.debug('liETimeSlots.....'+liETimeSlots);
		system.debug('mapETimeToSlot.....'+mapETimeToSlot);
        String t_startdatetime_str;
        String t_enddatetime_str;
        integer t_syear;
        
        integer t_smonth;
        integer t_day;
        t_syear=Appointment.Start_Date__c.year();
        t_smonth=Appointment.Start_Date__c.month();
        t_day=Appointment.Start_Date__c.day();
        t_startdatetime_str=t_syear+'-'+t_smonth+'-'+t_day+' 00:00:00';
        datetime t_startdatetime;
        datetime t_enddatetime;
        t_startdatetime=datetime.valueof(t_startdatetime_str);
        t_enddatetime=t_startdatetime.addHours(23);
        t_enddatetime=t_enddatetime.addMinutes(59);
        t_enddatetime=t_enddatetime.addSeconds(59);
        
        
        datetime Ls_startdatetime;
        datetime Ls_enddatetime;
        
        //t_startdatetime=Appointment.Start_Date__c.format();
        system.debug('t_startdatetime'+t_startdatetime);
        
        List<Appointment__c> a=[select id, name,Appointment_Type__c,Status__c,StartDateTime__c,EndDateTime__c,Duration__c, ap.Client_First_Name__c,patient__c,subject__c from Appointment__c ap where   
         (
                                  (ap.StartDateTime__c >= :t_startdatetime  AND ap.StartDateTime__c <= :t_enddatetime) OR
                                  (ap.EndDateTime__c >= :t_startdatetime  AND ap.EndDateTime__c <= :t_enddatetime) OR
                                  (ap.StartDateTime__c <= :t_startdatetime   AND ap.EndDateTime__c >= :t_enddatetime)
                               )];
                               
        List<Event> eve=[select id, subject,StartDateTime,EndDateTime from event eve where   
         (
                                  (eve.StartDateTime >= :t_startdatetime  AND eve.StartDateTime <= :t_enddatetime) OR
                                  (eve.EndDateTime >= :t_startdatetime  AND eve.EndDateTime <= :t_enddatetime) OR
                                  (eve.StartDateTime <= :t_startdatetime   AND eve.EndDateTime >= :t_enddatetime)
                               )];
        
        
        /*Start_Date__c=: Appointment.Start_Date__c order by Start_Date__c asc ] ;*/
        System.debug(eve);
        
        string tshour;
        string tmin;
        string strLs_startdatetime;
        Integer noofslots=0;
        time overLapSlotsTime;
        Integer noofEslots=0;
        time overLapESlotsTime;
        string timeAMPM;
        integer timeHour;
        string timeMin;
        Decimal datediff=0;
        
 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */       
 /*=========================ERRORS OUT IN THIS BLOCK==============================*/ 
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ if (eve.size()>0) { for(integer z=0;z<eve.size();z++) { if(mapETimeToSlot.get(string.valueof(eve[z].StartDateTime.time())) != null) { // system.debug('+++++++++++++++++++++++++++++++++++++duration'+a[z].Duration__c); overLapESlotsTime=eve[z].StartDateTime.time(); datediff=((Decimal.valueOf(eve[z].EndDateTime.getTime()) - Decimal.valueOf(eve[z].StartDateTime.getTime()))/(1000*60*60))*60; system.debug('datediff '+datediff); if(datediff>30) { noofEslots=integer.valueOf((datediff/30)); system.debug('+++++++++++++++++++++++++++++++++++++noofslots'+noofEslots); for(Integer nctr=0;nctr<noofEslots;nctr++) { if(mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEvent!=null)
//-------------------------------------------------------------------------------------------
//////////////////////////////////////ERRORS ON ABOVE LINE//////////////////////////////////
//-------------------------------------------------------------------------------------------
 { mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEventOverlap = eve[z]; mapETimeToSlot.get(string.valueof(overLapESlotsTime)).status='Y'; system.debug('++++++++++++++++++++++++++++++++++++inside overlap'); } else { mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEvent = eve[z]; system.debug('+++++++++++++++++++++++++++++++++outside overlap'); } overLapESlotsTime=overLapESlotsTime.addMinutes(30); } //mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointment = a[z]; }else { if(mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEvent!=null) { mapETimeToSlot.get(string.valueof(eve[z].StartDateTime.time())).sEventOverlap = eve[z]; } else { mapETimeToSlot.get(string.valueof(eve[z].StartDateTime.time())).sEvent = eve[z]; } } } } } /*=========================================================================================*/
/********************************************THIS BLOCK BELOW WORKS********************************/
/*===========================================================================================*/


if (a.size()>0) { for(integer z=0;z<a.size();z++) { if(mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())) != null) { system.debug('+++++++++++++++++++++++++++++++++++++duration'+a[z].Duration__c); overLapSlotsTime=a[z].StartDateTime__c.time(); datediff=((Decimal.valueOf(a[z].EndDateTime__c.getTime()) - Decimal.valueOf(a[z].StartDateTime__c.getTime()))/(1000*60*60))*60; system.debug('datediff '+datediff); if(datediff>30) { noofslots=integer.valueOf((datediff/30)); system.debug('+++++++++++++++++++++++++++++++++++++noofslots'+noofslots); for(Integer nctr=0;nctr<noofslots;nctr++) { system.debug('+++++++++++++++++++++++++++++++++++++overLapSlotsTime'+overLapSlotsTime); if(mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointment!=null) { mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointmentOverlap = a[z]; mapTimeToSlot.get(string.valueof(overLapSlotsTime)).status='Y'; system.debug('++++++++++++++++++++++++++++++++++++inside overlap'); } else { mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointment = a[z]; system.debug('+++++++++++++++++++++++++++++++++outside overlap'); } overLapSlotsTime=overLapSlotsTime.addMinutes(30); } //mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointment = a[z]; }else { if(mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointment!=null) { mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointmentOverlap = a[z]; } else { mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointment = a[z]; } } } } } /*============================================================================================== for(integer lictr=0;lictr<liETimeSlots.size();lictr++) { system.debug('inside transfer of liETimeSlots to Formated List'); timeAMPM=liETimeSlots[lictr].tstart1.substring(0,5); timeHour=integer.valueof(timeAMPM.substring(0,2)); timeMin=timeAMPM.substring(2,5); system.debug('time hour value'+timeHour); system.debug('time hour value'+timeMin); if (timeHour>12) { timeHour=timehour-12; system.debug('timeHour++++++++++++++++++++++++++'+timeHour) ; timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' PM'; } else { timeAMPM=timeAMPM+timeMin+' PM'; } } else { timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' AM'; } else { timeAMPM=timeAMPM+timeMin+' AM'; } } liETimeSlots[lictr].tstart1=timeAMPM; //liTimeSlots_form[lictr].sAppointment=liTimeSlots[lictr].sAppointment; } system.debug('liETimeSlots++++++++++++++++++++++++'+liETimeSlots); /*============================================================================================*/ for(integer lictr=0;lictr<liTimeSlots.size();lictr++) { system.debug('inside transfer of liTimeSlots to Formated List'); timeAMPM=liTimeSlots[lictr].tstart1.substring(0,5); timeHour=integer.valueof(timeAMPM.substring(0,2)); timeMin=timeAMPM.substring(2,5); system.debug('time hour value'+timeHour); system.debug('time hour value'+timeMin); if (timeHour>12) { timeHour=timehour-12; system.debug('timeHour++++++++++++++++++++++++++'+timeHour) ; timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' PM'; } else { timeAMPM=timeAMPM+timeMin+' PM'; } } else { timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' AM'; } else { timeAMPM=timeAMPM+timeMin+' AM'; } } liTimeSlots[lictr].tstart1=timeAMPM; //liTimeSlots_form[lictr].sAppointment=liTimeSlots[lictr].sAppointment; } } } }

 

public with sharing class CEventTimeSlot {
	

	
	// public Time           tStart         {get; set;}
	public string status {get;set;}
	 public String tStart1 {get; set;}
    public Event sEvent {get; set;}
    public Event sEventOverlap {get; set;}

    public CEventTimeSlot(String startTime)
    {
        tStart1 = startTime;
        status='';
        sEvent = null;
        sEventOverlap=null;
    }



}

 

public with sharing class CTimeSlot {
	
	// public Time           tStart         {get; set;}
	public string status {get;set;}
	 public String tStart1 {get; set;}
    public Appointment__c sAppointment {get; set;}
    public Appointment__c sAppointmentOverlap {get; set;}

    public CTimeSlot(String startTime)
    {
        tStart1 = startTime;
        status='';
        sAppointment = null;
        sAppointmentOverlap=null;
    }

}

 

  • November 22, 2011
  • Like
  • 0

Hi,

 

I am writing a trigger on update but  i get this error

Save error: Initial term of field expression must be a concrete SObject: LIST<QuoteLineItem>.

I am not sure what is causing this. Here is my code

 

trigger Update_Discount_on_QuoteLineItem on Quote (after update) {
	
	List <QuoteLineItem> QLI = new List <QuoteLineItem>();
	Map<id,double> MapSoftwareDiscount= new Map <id,double>();
	Map<id,double> MapHardwareDiscount= new Map <id,double>();
	Set <id> Qid= new Set<id>();
	
	for (Quote  Q: Trigger.new)
	{
		if (Q.Software_Discount__c!=System.Trigger.oldMap.get(Q.Id).Software_Discount__c ||Q.hardware_Discount__c!=System.Trigger.oldMap.get(Q.Id).hardware_Discount__c )
		{
			Qid.add(Q.id);
			MapSoftwareDiscount.put(Q.id,Q.Software_Discount__c);
			MapHardwareDiscount.put(Q.id,Q.hardware_Discount__c);
			
		}
	}
	
	QLI=[select id,QuoteId,product_category__c,Discount from QuoteLineItem where QuoteId in :Qid];
	for(integer i=0; i <QLI.size();i++)
	{
		if (QLI[i].product_category__c=='Software')
		{
			QLI[i].Discount=MapSoftwareDiscount.get(QLI.QuoteId); //ERRORS OUT HERE
		}
		else if(QLI[i].product_category__c=='Hardware')
		{
			QLI[i].Discount=MapHardwareDiscount.get(QLI.QuoteId);
		}
	}
	update QLI;
	
	

}

 

Any ideas what is causing this

 

  • November 18, 2011
  • Like
  • 0

Hi,

 

I am trying to use the LastLoginDate from user object to be used in a custom object. But i cant seem to find the field in the formula editor.

 

Is there a way we can do it?

  • November 17, 2011
  • Like
  • 0

Hi,

 

I want to modify the list of Items to approve  to show the submitted user, it currently shows

 

Action | Related To | Type | Most Recent Approver | Date Submitted

 

Is there anyway i can modify /add a new column into this to show who submitted this request.

 

Thanks

Pradip

  • November 16, 2011
  • Like
  • 0

Hi,

 

I am trying to retrive opps created between 01-01-2011 and 06-30-2011.

 

Select o.CreatedDate, o.Id, o.LastModifiedDate,  from Opportunity o where   o.CreatedDate > '1/1/2011' and o.CreatedDate <  '12/31/2011'order by  o.LastModifiedDate

 since createdate is a datetime i get a error saying createdDate is datetime and should not be enclosed in quotes.

Can someone help on how to get this query working

 

Thanks

Prady

  • July 12, 2011
  • Like
  • 1

I want to automatically convert new leads into contacts. I have a trigger on Lead after update that will bulk convert 100 leads at a time. The problem I have  is that my marketing automation tool pushes new leads into Salesforce in batches of 200 at a time. When I try to import 200 leads, the bulk convert fails due to a too many DML 151 error.

 

I read that the convertlead function can only handle 100 records at a time. How can I edit the code to handle 200 imports at a time? Is it possible?

 

Thanks in advance.

 

trigger AutoConvert on Lead (after update) {

for(Lead myLead: Trigger.new){ if(Trigger.new[0].isConverted == false) { Database.LeadConvert lc = new database.LeadConvert(); lc.setLeadId(myLead.Id); lc.convertedStatus = 'Qualified'; //Database.ConvertLead(lc,true); lc.setDoNotCreateOpportunity(true); Database.LeadConvertResult lcr = Database.convertLead(lc); System.assert(lcr.isSuccess()); }}}

 

Hi all,

 

I have created a report out 3000 leads I have 770 leads with Date of Birth. I want to convert only this 770 leads to contacts.

 

Can anyone please help me with this?

 

Thanks in Advance

 

Cheers

Uma

  • May 02, 2012
  • Like
  • 0

Hi,

 

On researching on apex scheduler to for scheduling a class for every 10 or 15 mins we would need to write the schedule code in the system log.

 YourScheduleClass c = new YourScheduleClass();
String sch = '0 0 * * * ?';
System.schedule('Schedule Job1', sch, c);

YourScheduleClass c = new YourScheduleClass();
String sch = '0 10 * * * ?';
System.schedule('Schedule Job2', sch, c);

YourScheduleClass c = new YourScheduleClass();
String sch = '0 20 * * * ?';
System.schedule('Schedule Job3', sch, c);

YourScheduleClass c = new YourScheduleClass();
String sch = '0 30 * * * ?';
System.schedule('Schedule Job4', sch, c);

 Would these entries be an one time job on production env? Would it affect anything if i edit/change the times later?

  • December 26, 2011
  • Like
  • 0

hi,

 

how does upsert work?

my understanding is that it checks if there is a record with unique id and if its available then it updates that record and if its not then inserts it.

 

Am i right?

 

I seem to get an error

Upsert failed. First exception on row 1; first error: DUPLICATE_EXTERNAL_ID, Asset Tag: more than one record found for external id field: [a11M0000000CwJqIAK, a11M0000000CwJvIAK]: [Asset_Tag__c]

 

i have a list with item and they dont have asset tag repeating in that

 

system.debug('LstItem Asset_Tag__c'+LstItem );
		upsert 	LstItem Asset_Tag__c;

 From the debug log

 

LstItem Asset_Tag__c(Item_c__c:{Scanned_By__c=005M0000000IlxyIAC, Asset_Tag__c=12149, Status__c=Active, Scan_Location__c=001M0000008GzJXIA0, Last_Scan_Date__c=2011-12-17 06:08:47}, Item_c__c:{Scanned_By__c=005M0000000IlxyIAC, Asset_Tag__c=23157, Status__c=Active, Scan_Location__c=001M0000008GzJXIA0, Last_Scan_Date__c=2011-12-17 08:26:14})

 You can see that the asset tags are not repeated. So i am not sure from where the duplicate external id is coming

 

Thanks

  • December 19, 2011
  • Like
  • 0

I need to query an object called trans__c which has the following fields

 

id,

scantime__c // datetime

name

asset__c // external id

status

 

I need to get only data which has status as pending and if there are any repeating asset then i need to get only  record with scantime as the latest.

 

Thanks

 

 

 

  • December 17, 2011
  • Like
  • 0

Hi,

 

Do governor limits apply when i use a insert using a list.

 

For eg. i add all the records to be inserted in to a list and finally give a insert list. I might have 3000 records in the list

Does it take as one DML statement or does it take as 3000 DML statements?

 

Thanks

 

  • December 15, 2011
  • Like
  • 0

I have an object called "Lease".When i create a record in Lease  it  gets saved.I should have a button  "Generate Office " in the record which automatically creates an office record which is exactly same as record created earlier in Lease

 

In " office" all the fields which are there in "lease" are present and also they are formula fields

 

 

I am in a confusion as i didnot understand d req properly or how do i need approach

 

 

Do i need to visual force page for the button

Hi,

 

i am trying to assign a string value to text type custom field on line 7 but getting the complier error "Expression cannot be assigned "

 

any idea what i am missing?

 

 

thanks,

ublic class IRPTemplateSelection {

public PageReference TemplateSelection() {
        
        // String TemplateId = 'a0JP0000001qGwU'; 
        String TemplateId = System.currentPageReference().getParameters().get('Templateid');
        Orphan__c.Biodata_Report_Template_4_Conductor__c = TemplateId ;
        
        PageReference pageRef = new PageReference('https://cs4.salesforce.com/a0A?fcf=00B20000005raAO' );
        pageRef.setRedirect(true);

        return pageRef; 

    }
}

 

Hi,

 

I want to send email when a field is updated in a custom object. so i have a trigger written. i also created a email template.

I find that the targetobjectid is a required field while sending an email. Its erroring out where i am setting targeto

bject .Id. It says Save error: Variable does not exist: Lstuser.id

Any ideas what am i doing wrong

trigger change_action on Ticket__c (after update) {
	//List<user>Lstuser= new List<user>();
	List<id> lstid=new List<id>();
	List<string> lstemail= new List<string>();
	Map<id,string> Mapemail = new Map<id,string>();
	

	for(ticket__c t:trigger.new)
	{
		if(trigger.isUpdate)
		{
			if(t.Actions__c!=System.Trigger.oldMap.get(t.Id).Actions__c)
			{
				lstemail.clear();
				lstemail.add(t.Initiator_Email__c);
				lstemail.add(t.Admin_email__c);
				
				for(User Lstuser:[select id, email,username from user where email in :lstemail]);
				{
				List<EmailTemplate> emailtemplatelist = new List<EmailTemplate>();
				emailtemplatelist=[select id, name from EmailTemplate where name='Update on ticket'];
				if (emailtemplatelist.size()>0)
				{
					//emailtemplatelist[0]
					Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
					mail.toAddresses = new string[]{t.Initiator_Email__c,t.Admin_email__c};
					//mail.setToAddresses(t.Initiator_Email__c);
					mail.setTemplateId(emailtemplatelist[0].id);
/**************************Its THROWING ERROR ON BELOW LINE **********************************/ mail.TargetObjectId(Lstuser.id);//ERROR ON THIS LINE Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); } } } } } }

 

  • November 24, 2011
  • Like
  • 0

Hi,

 

I have a few reports created. I want these reports to be viewed by a particular profile. They should not be able to edit it. How can i set these ?

 

Thanks

Prady

  • November 22, 2011
  • Like
  • 0

Hi,

 

I have a class written and when i move the class to production i get an error. Everything seems to work fine on sandBox.

If i remove the block of code it passes the code to production. I have a almost similar piece of code just

below the erroring code. This works fine and gets passed over into production. Any ideas on what could

be the issue?

 

Failure Message: "System.NullPointerException: Attempt to de-reference a null object", Failure Stack Trace: "Class.AppointmentController.refresh: line 252, column 82 Class.Test_Appointment.Testapp: line 29, column 6 External entry point"

 

Here is my code

 

Public Class AppointmentController
{

    public PageReference createApp() {
    
        return page.Appointment;
    }

Public Appointment__c Appointment { get; set; }
public String Error { get; set; }
public String ClientsSearch { get; set; }
public list<CEventTimeSlot> liETimeSlots {get;set;}
public list<CEventTimeSlot> liETimeSlots_form {get;set;}
public list<CTimeSlot> liTimeSlots {get;set;}
public list<CTimeSlot> liTimeSlots_form {get;set;}
public Map<string,CTimeSlot> mapTimeToSlot {get;set;}
public Map<string,CEventTimeSlot> mapETimeToSlot {get;set;}
public List<String> LstString{get;set;}

Public AppointmentController()
{
Appointment = new  Appointment__c();
}
   


/* function called from VF page for updating the startdatetime and endDatetime  and rendering into VF page   */
   public PageReference refresh() {
    try
      {
         liTimeSlots = new list<CTimeSlot>();
         mapTimeToSlot = new Map<string,CTimeSlot>();
         liTimeSlots_form = new list<CTimeSlot>();
         //For adding Events
         liETimeSlots = new list<CEventTimeSlot>();
         mapETimeToSlot = new Map<string,CEventTimeSlot>();
         liETimeSlots_form = new list<CEventTimeSlot>();
          
          
          
         

        
      if (Appointment.Start_Date__c<>null)
      {
        Time pktime;
        Time pkTime1;
        List<Time> LstTime = new List<Time>();
        pktime=time.newInstance(7,0,0,0);
        LstTime.add(pktime);

        for(integer ctr=0; ctr<30;ctr++)
        {
            pktime=pktime.addMinutes(30);
            LstTime.Add(pkTime);
        }
        system.Debug(' Listtime '+LstTime);
        
        system.debug('No of Time Items'+LstTime.size());
        for(integer ctr1=0; ctr1<LstTime.size();ctr1++)
        {       
        
        CTimeSlot newSlot = new CTimeSlot(string.valueof(LstTime[ctr1]));
        liTimeSlots.add(newSlot);
        
        mapTimeToSlot.put(string.valueof(LstTime[ctr1])+ '', newSlot);
        newSlot=null;
        
        CEventTimeSlot newESlot = new CEventTimeSlot(string.valueof(LstTime[ctr1]));
        liETimeSlots.add(newESlot);
        
        mapETimeToSlot.put(string.valueof(LstTime[ctr1])+ '', newESlot);
        newESlot=null;
        }
        
        
		system.debug('liETimeSlots.....'+liETimeSlots);
		system.debug('mapETimeToSlot.....'+mapETimeToSlot);
        String t_startdatetime_str;
        String t_enddatetime_str;
        integer t_syear;
        
        integer t_smonth;
        integer t_day;
        t_syear=Appointment.Start_Date__c.year();
        t_smonth=Appointment.Start_Date__c.month();
        t_day=Appointment.Start_Date__c.day();
        t_startdatetime_str=t_syear+'-'+t_smonth+'-'+t_day+' 00:00:00';
        datetime t_startdatetime;
        datetime t_enddatetime;
        t_startdatetime=datetime.valueof(t_startdatetime_str);
        t_enddatetime=t_startdatetime.addHours(23);
        t_enddatetime=t_enddatetime.addMinutes(59);
        t_enddatetime=t_enddatetime.addSeconds(59);
        
        
        datetime Ls_startdatetime;
        datetime Ls_enddatetime;
        
        //t_startdatetime=Appointment.Start_Date__c.format();
        system.debug('t_startdatetime'+t_startdatetime);
        
        List<Appointment__c> a=[select id, name,Appointment_Type__c,Status__c,StartDateTime__c,EndDateTime__c,Duration__c, ap.Client_First_Name__c,patient__c,subject__c from Appointment__c ap where   
         (
                                  (ap.StartDateTime__c >= :t_startdatetime  AND ap.StartDateTime__c <= :t_enddatetime) OR
                                  (ap.EndDateTime__c >= :t_startdatetime  AND ap.EndDateTime__c <= :t_enddatetime) OR
                                  (ap.StartDateTime__c <= :t_startdatetime   AND ap.EndDateTime__c >= :t_enddatetime)
                               )];
                               
        List<Event> eve=[select id, subject,StartDateTime,EndDateTime from event eve where   
         (
                                  (eve.StartDateTime >= :t_startdatetime  AND eve.StartDateTime <= :t_enddatetime) OR
                                  (eve.EndDateTime >= :t_startdatetime  AND eve.EndDateTime <= :t_enddatetime) OR
                                  (eve.StartDateTime <= :t_startdatetime   AND eve.EndDateTime >= :t_enddatetime)
                               )];
        
        
        /*Start_Date__c=: Appointment.Start_Date__c order by Start_Date__c asc ] ;*/
        System.debug(eve);
        
        string tshour;
        string tmin;
        string strLs_startdatetime;
        Integer noofslots=0;
        time overLapSlotsTime;
        Integer noofEslots=0;
        time overLapESlotsTime;
        string timeAMPM;
        integer timeHour;
        string timeMin;
        Decimal datediff=0;
        
 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */       
 /*=========================ERRORS OUT IN THIS BLOCK==============================*/ 
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ if (eve.size()>0) { for(integer z=0;z<eve.size();z++) { if(mapETimeToSlot.get(string.valueof(eve[z].StartDateTime.time())) != null) { // system.debug('+++++++++++++++++++++++++++++++++++++duration'+a[z].Duration__c); overLapESlotsTime=eve[z].StartDateTime.time(); datediff=((Decimal.valueOf(eve[z].EndDateTime.getTime()) - Decimal.valueOf(eve[z].StartDateTime.getTime()))/(1000*60*60))*60; system.debug('datediff '+datediff); if(datediff>30) { noofEslots=integer.valueOf((datediff/30)); system.debug('+++++++++++++++++++++++++++++++++++++noofslots'+noofEslots); for(Integer nctr=0;nctr<noofEslots;nctr++) { if(mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEvent!=null)
//-------------------------------------------------------------------------------------------
//////////////////////////////////////ERRORS ON ABOVE LINE//////////////////////////////////
//-------------------------------------------------------------------------------------------
 { mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEventOverlap = eve[z]; mapETimeToSlot.get(string.valueof(overLapESlotsTime)).status='Y'; system.debug('++++++++++++++++++++++++++++++++++++inside overlap'); } else { mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEvent = eve[z]; system.debug('+++++++++++++++++++++++++++++++++outside overlap'); } overLapESlotsTime=overLapESlotsTime.addMinutes(30); } //mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointment = a[z]; }else { if(mapETimeToSlot.get(string.valueof(overLapESlotsTime)).sEvent!=null) { mapETimeToSlot.get(string.valueof(eve[z].StartDateTime.time())).sEventOverlap = eve[z]; } else { mapETimeToSlot.get(string.valueof(eve[z].StartDateTime.time())).sEvent = eve[z]; } } } } } /*=========================================================================================*/
/********************************************THIS BLOCK BELOW WORKS********************************/
/*===========================================================================================*/


if (a.size()>0) { for(integer z=0;z<a.size();z++) { if(mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())) != null) { system.debug('+++++++++++++++++++++++++++++++++++++duration'+a[z].Duration__c); overLapSlotsTime=a[z].StartDateTime__c.time(); datediff=((Decimal.valueOf(a[z].EndDateTime__c.getTime()) - Decimal.valueOf(a[z].StartDateTime__c.getTime()))/(1000*60*60))*60; system.debug('datediff '+datediff); if(datediff>30) { noofslots=integer.valueOf((datediff/30)); system.debug('+++++++++++++++++++++++++++++++++++++noofslots'+noofslots); for(Integer nctr=0;nctr<noofslots;nctr++) { system.debug('+++++++++++++++++++++++++++++++++++++overLapSlotsTime'+overLapSlotsTime); if(mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointment!=null) { mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointmentOverlap = a[z]; mapTimeToSlot.get(string.valueof(overLapSlotsTime)).status='Y'; system.debug('++++++++++++++++++++++++++++++++++++inside overlap'); } else { mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointment = a[z]; system.debug('+++++++++++++++++++++++++++++++++outside overlap'); } overLapSlotsTime=overLapSlotsTime.addMinutes(30); } //mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointment = a[z]; }else { if(mapTimeToSlot.get(string.valueof(overLapSlotsTime)).sAppointment!=null) { mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointmentOverlap = a[z]; } else { mapTimeToSlot.get(string.valueof(a[z].StartDateTime__c.time())).sAppointment = a[z]; } } } } } /*============================================================================================== for(integer lictr=0;lictr<liETimeSlots.size();lictr++) { system.debug('inside transfer of liETimeSlots to Formated List'); timeAMPM=liETimeSlots[lictr].tstart1.substring(0,5); timeHour=integer.valueof(timeAMPM.substring(0,2)); timeMin=timeAMPM.substring(2,5); system.debug('time hour value'+timeHour); system.debug('time hour value'+timeMin); if (timeHour>12) { timeHour=timehour-12; system.debug('timeHour++++++++++++++++++++++++++'+timeHour) ; timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' PM'; } else { timeAMPM=timeAMPM+timeMin+' PM'; } } else { timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' AM'; } else { timeAMPM=timeAMPM+timeMin+' AM'; } } liETimeSlots[lictr].tstart1=timeAMPM; //liTimeSlots_form[lictr].sAppointment=liTimeSlots[lictr].sAppointment; } system.debug('liETimeSlots++++++++++++++++++++++++'+liETimeSlots); /*============================================================================================*/ for(integer lictr=0;lictr<liTimeSlots.size();lictr++) { system.debug('inside transfer of liTimeSlots to Formated List'); timeAMPM=liTimeSlots[lictr].tstart1.substring(0,5); timeHour=integer.valueof(timeAMPM.substring(0,2)); timeMin=timeAMPM.substring(2,5); system.debug('time hour value'+timeHour); system.debug('time hour value'+timeMin); if (timeHour>12) { timeHour=timehour-12; system.debug('timeHour++++++++++++++++++++++++++'+timeHour) ; timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' PM'; } else { timeAMPM=timeAMPM+timeMin+' PM'; } } else { timeAMPM=string.valueof(timeHour); if (timeAMPM.length()==1) { timeAMPM='0'+timeAMPM+timeMin+' AM'; } else { timeAMPM=timeAMPM+timeMin+' AM'; } } liTimeSlots[lictr].tstart1=timeAMPM; //liTimeSlots_form[lictr].sAppointment=liTimeSlots[lictr].sAppointment; } } } }

 

public with sharing class CEventTimeSlot {
	

	
	// public Time           tStart         {get; set;}
	public string status {get;set;}
	 public String tStart1 {get; set;}
    public Event sEvent {get; set;}
    public Event sEventOverlap {get; set;}

    public CEventTimeSlot(String startTime)
    {
        tStart1 = startTime;
        status='';
        sEvent = null;
        sEventOverlap=null;
    }



}

 

public with sharing class CTimeSlot {
	
	// public Time           tStart         {get; set;}
	public string status {get;set;}
	 public String tStart1 {get; set;}
    public Appointment__c sAppointment {get; set;}
    public Appointment__c sAppointmentOverlap {get; set;}

    public CTimeSlot(String startTime)
    {
        tStart1 = startTime;
        status='';
        sAppointment = null;
        sAppointmentOverlap=null;
    }

}

 

  • November 22, 2011
  • Like
  • 0

Hi,

 

I am writing a trigger on update but  i get this error

Save error: Initial term of field expression must be a concrete SObject: LIST<QuoteLineItem>.

I am not sure what is causing this. Here is my code

 

trigger Update_Discount_on_QuoteLineItem on Quote (after update) {
	
	List <QuoteLineItem> QLI = new List <QuoteLineItem>();
	Map<id,double> MapSoftwareDiscount= new Map <id,double>();
	Map<id,double> MapHardwareDiscount= new Map <id,double>();
	Set <id> Qid= new Set<id>();
	
	for (Quote  Q: Trigger.new)
	{
		if (Q.Software_Discount__c!=System.Trigger.oldMap.get(Q.Id).Software_Discount__c ||Q.hardware_Discount__c!=System.Trigger.oldMap.get(Q.Id).hardware_Discount__c )
		{
			Qid.add(Q.id);
			MapSoftwareDiscount.put(Q.id,Q.Software_Discount__c);
			MapHardwareDiscount.put(Q.id,Q.hardware_Discount__c);
			
		}
	}
	
	QLI=[select id,QuoteId,product_category__c,Discount from QuoteLineItem where QuoteId in :Qid];
	for(integer i=0; i <QLI.size();i++)
	{
		if (QLI[i].product_category__c=='Software')
		{
			QLI[i].Discount=MapSoftwareDiscount.get(QLI.QuoteId); //ERRORS OUT HERE
		}
		else if(QLI[i].product_category__c=='Hardware')
		{
			QLI[i].Discount=MapHardwareDiscount.get(QLI.QuoteId);
		}
	}
	update QLI;
	
	

}

 

Any ideas what is causing this

 

  • November 18, 2011
  • Like
  • 0

I have a VF page which has a popup to accept a few fields.

When I run the page and fill in the fields, I can see that only some field values are getting captured, others are returining as null. I cross checked the field names, they are the same. Any ideas why this could happen?



<apex:outputPanel id="tstpopup1">
        <apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!displayPopUp}"/>
            <apex:outputPanel styleClass="custPopup" layout="block" rendered="{!displayPopUp}">
            <apex:pageblock >
                <apex:pageblocksection >
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="Project: " />
                    <apex:inputfield id="proj" value="{!AC.Project__c}" />
                    </apex:pageblocksectionitem><p/>
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="Start Date: " />
                    <apex:inputfield id="sd" value="{!AC.Start_Date__c}" />
                    </apex:pageblocksectionitem>
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="End Date: " />
                    <apex:inputfield id="ed" value="{!AC.End_Date__c}" />
                    </apex:pageblocksectionitem>
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="C85 Project Lead: " />
                    <apex:inputfield id="pl" value="{!AC.C85_Project_Lead__c}" />
                    </apex:pageblocksectionitem>
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="Daily Charge Rate of Consultant: " />
                    <apex:inputfield id="charge" value="{!AC.Daily_Charge_Rate_of_Consultant__c}" />
                    </apex:pageblocksectionitem>
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="Project Role Title: " />
                    <apex:inputfield id="role" value="{!AC.Project_Role_Title__c}" />
                    </apex:pageblocksectionitem>
                    <apex:pageblocksectionitem >
                    <apex:outputlabel value="Overtime Allowed: " />
                    <apex:inputfield id="overtime" value="{!AC.overtime_allowed__c}" />
                    </apex:pageblocksectionitem>
                    </apex:pageblocksection>
                    <apex:commandbutton value="Assign to a New Project" action="{!assign}"   />
                    <apex:commandbutton value="Cancel" action="{!closePopup}" immediate="true" /><br/><br/><br/>
                    </apex:pageblock>
            </apex:outputPanel>

 

    public Assigned_Consultant__c AC{
        get{
            if (AC == null) AC = new Assigned_Consultant__c();
            return AC;
        }
        set; 
    }


public PageReference assign()
{ 
system.debug('Role title ...........................' + AC.Project_Role_Title__c); // this is returning null
            system.debug('Day charge ...........................' + AC.Daily_Charge_Rate_of_Consultant__c); this has value filled
system.debug('overtime_allowed__c ...........................' + AC.overtime_allowed__c);  // this is returning null


         // Project_Role_Title__c
            displayPopup = false;  
            system.debug('inside assign...........................3');
            system.debug('AC.................' + AC);   

  }

 

  • November 10, 2011
  • Like
  • 0