• Donald Reagan 3
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 1
    Replies
I'm not able to pass the selected picklist value to the controller class. I'm using the picklist value to use it for my ORDER BY criteria in the SOQL
Here is my controller class code and Visual Force page.
public String pSortedBy { get; set; }

Public List<SelectOption> getSortOptions() {
		List<SelectOption> SortOptions = new List<SelectOption>();
		SortOptions.add(new SelectOption('Employee__r.Name','--Select print sort order--'));
		SortOptions.add(new SelectOption('Employee__r.Name','Employee Name'));
		SortOptions.add(new SelectOption('Employee__r.Local_Employee_Number__c','Local Employee Number'));
		
		return SortOptions;
	}

	Public List <Object> LoadEmployeeAttendanceToPrint() {
		string sQuery;
		sQuery = 'SELECT Employee__r.Name, Employee__r.Local_Employee_Number__c FROM Employee_Attendance_Detail__c ORDER BY ' ;
		
		sQuery += pSortedBy;
		 
		lstEmployeesAttendanceToPrint = new List<Employee_Attendance_Detail__c> ();
		lstEmployeesAttendanceToPrint = Database.query(sQuery);
		return lstEmployeesAttendanceToPrint;
		
		}
		
		
<apex:selectlist label="Select Print Order" value="{!pSortedBy}" multiselect="false" size="0" id="sortby" title="Select Print Order">
        <apex:selectoptions value="{!SortOptions}" />
</apex:selectlist>

 
I have an object field that is of number data type, based on a picklist value in the parent object field I want to render in the visual force page as an input check box. If the check box is checked true, I want the value saved to 1 and 0 if false. If the picklist value requires it to render as a text field and I want to save the value as a number field. I'm successful in rendering the field as inputcheckbox and inputfield, but its not saving the checkbox value to the field. It is saving the value if it is rendered as a text box.
<apex:datatable value="{!attendanceRows}" var="o" id="theTable"

<apex:inputField value="{!o[column01.FieldName]}"  rendered="{!IF(c.Type__c='High School',true,false) }"/> 
<apex:inputCheckbox value="{!o[column01.FieldName]}"  rendered="{!IF(c.Type__c='Middle School',true,false) }"/>

In my controller I'm doing an upsert to the object.
public List<School__c> attendanceRows { get; set; }

public void SaveAttendance() {
    try {
        if (attendanceRows.size() > 0) {
            upsert attendanceRows;
        }
    }
    catch(DmlException e) {
        System.debug('An unexpected error has occurred while saving to School__c: ' + e.getMessage());
    }

}

// Header Definition Class
public with sharing class HeaderDefinition
{
    public HeaderDefinition(Boolean pIsVisible, String pColumnName, String pFieldName)
    {
        isVisible = pIsVisible;
        ColumnName = pColumnName;
        FieldName = pFieldName;
    }

    public Boolean isVisible { get; set; }
    public String ColumnName { get; set; }
    public String FieldName { get; set; }

    public string outString()
    {
        return FieldName + ' :: ' + ColumnName + ' - ' + String.valueOf(isVisible);
    }
}

SaveAttendance();

How do I save/get the value of the inputcheckbox?
MasterA --->DetailA--->Account. 
DetailA has a master detail relationship to both MasterA and Account.

Whenever fieldA is updated in MasterA, I want to update a field in Account which is related to DetailA. MasterA and Account are not directly related but only through DetailA.
Can I do this in Process builder? Can I go more than 2 levels in Process builder? 
I have row values as dates in one object, i.e dates within a given year. I have a second object with field names as Day1__c, Day2__c and so on till Day366__c. I want to assign the dates to the fields in the 2nd object.
Example, if the date in the first object is 2018-01-01 I want to assign a value to field Day1__c in the second object and if the date is 2018-12-31 I want to assign a value to Day365__c.
Thanks for any help.
I'm facing an AccountHistory delete problem almost exactly the same as https://salesforce.stackexchange.com/questions/210984/accounthistory-not-deleting-immediately-after-an-update. Has anybody else faced this problem? Any ideas?
I'm facing an AccountHistory delete problem almost exactly the same as https://salesforce.stackexchange.com/questions/210984/accounthistory-not-deleting-immediately-after-an-update. Has anybody else faced this problem? Any ideas?
I'm trying to implement the Apex Connector Framework to hook up to an external database.  However, I'm getting the following error: "Type is not visible: DataSource.Connection."

Here is my code:
 
global class ChoozleDBConnection extends DataSource.Connection {
	global ChoozleDBConnection(DataSource.ConnectionParams connectionParams) {}
}

Thank you for any help you can provide!