• Daniel Bleasdale
  • NEWBIE
  • 210 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 30
    Replies
I'm currently in a Developer Sandbox trying to get the "External Services" to work. I have gone through the TrailHead and had it working with the resources I was supplied but once I try to use the actual API schema we need I get the error “Error encountered while saving External Registration. Please try again later.” which doesn't give me much to go off. I have tried raising the case with Salesforce and asking this question on other sites to no avail. https://salesforce.stackexchange.com/questions/309320/while-trying-to-use-the-external-sevices-i-get-the-error-error-encountered-whil?noredirect=1#comment463197_309320 (https://salesforce.stackexchange.com/questions/309320/while-trying-to-use-the-external-sevices-i-get-the-error-error-encountered-whil?noredirect=1#comment463197_309320)

Just to confirm I have created a "Named Credential" and added the corresponding domain to the "Remote Site Settings".

The Steps to reproduce the error are:

1) From Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings.
Click New Remote Site.
Remote Site Name, use FindAnApprenticeshipAPIURL.
Remote Site URL https://apis.apprenticeships.sfa.bis.gov.uk.

2) From Setup, enter Named Credentials in the Quick Find box, then select Named Credentials.
Click New Named Credential.
Label, use FindAnApprenticeshipNamedCred.
URL, use https://apis.apprenticeships.sfa.bis.gov.uk/manage-vacancies-sandbox/v1/apprenticeships.

3) From Setup, enter External Services in the Quick Find box, then select External Services.
Click Add an External Service.
External Service Name, use FindAnApprenticeshipExService.
Select a Named Credential, select FindAnApprenticeshipNamedCred.
Select Service Schema Complete JSON. Then paste the schema information from "https://developers.apprenticeships.education.gov.uk/docs/services/eebd1522767f4f1fbdfe51bd7010aa7e/export?DocumentFormat=Swagger":
{
"swagger": "2.0",
"info": {
"title": "Manage vacancies API (Sandbox)",
"version": "1.0",
"description": "Manage vacancies API (Sandbox)"
},
"host": "apis.apprenticeships.sfa.bis.gov.uk",
"basePath": "/manage-vacancies-sandbox",
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"x-servers": [
{
"url": "https://apis.apprenticeships.sfa.bis.gov.uk"
},
{
"url": "https://apis.apprenticeships.education.gov.uk"
}
],
"paths": {
"/v1/apprenticeships": {
"post": {
"description": "The apprenticeship operation creates an apprenticeship vacancy using the specified values.\r\n\r\n#### Restricted values ####\r\n\r\nThese fields will only accept specific values as listed below:\r\n* ApplicationMethod\r\n - Online\r\n - Offline\r\n* LocationType\r\n - OtherLocation\r\n - EmployerLocation\r\n - Nationwide\r\n* DurationType\r\n - Weeks\r\n - Months\r\n - Years\r\n* WageType\r\n - CustomWageFixed\r\n - CustomWageRange\r\n - NationalMinimumWage\r\n - ApprenticeshipMinimumWage\r\n - Unwaged\r\n - CompetitiveSalary\r\n - ToBeSpecified\r\n* WageUnit\r\n - NotApplicable\r\n - Weekly\r\n - Monthly\r\n - Annually\r\n* TrainingType\r\n - Framework\r\n - Standard\r\n\r\n#### Validation rules ####\r\n\r\nWhen creating a vacancy the following rules must be considered. \r\n1. All values are required to be populated except in the following cases:\r\n\r\n* For all vacancies these values are optional\r\n - ContactName\r\n - ContactEmail\r\n - ContactNumber\r\n - ThingsToConsider\r\n\r\n* For an Online vacancy\r\n - SupplementaryQuestion1 and SupplementaryQuestion2 are optional\r\n - ExternalApplicationUrl and ExternalApplicationInstructions must be empty\r\n\r\n* For an Offline vacancy\r\n - ExternalApplicationInstructions is optional\r\n - SupplementaryQuestion1 and SupplementaryQuestion2 must be empty\r\n\r\n* When LocationType is EmployerLocation or Nationwide \r\n - Location is not required.\r\n\r\n* When LocationType is OtherLocation \r\n - Only Address1, Town and Postcode are required\r\n - All other address fields are optional\r\n\r\n* When WageType is CustomWageFixed\r\n - WageTypeReason must be empty\r\n - WageUnit must be a value other than NotApplicable\r\n - MinWage and MaxWage must be empty\r\n - FixedWage must be greater than or equal to the Apprenticeship minimum wage \r\n\r\n* When WageType is CustomWageRange\r\n - WageTypeReason must be empty\r\n - WageUnit must be a value other than NotApplicable\r\n - MinWage must be greater than or equal to the Apprenticeship minimum wage \r\n - MaxWage must be greater than MinWage\r\n - FixedWage must be empty\r\n\r\n* When WageType is NationalMinimumWage or ApprenticeshipMinimumWage\r\n - MinWage, MaxWage, FixedWage and WageTypeReason must be empty\r\n - WageUnit must be NotApplicable\r\n\r\n* When WageType is Unwaged, CompetitiveSalary or ToBeSpecified\r\n - FixedWage, MinWage and MaxWage must be empty\r\n - WageUnit must be NotApplicable\r\n\r\n* When TrainingType is Framework\r\n - TrainingCode should be in format ###-##-##\r\n\r\n* When TrainingType is Standard\r\n - TrainingCode should be a numeric value no greater than 9999\r\n\r\n* Text fields will take a maximum of 4,000 characters except for the following\r\n - Title = 100\r\n - ShortDescription = 350\r\n - ContactName = 100\r\n - ContactEmail = 100\r\n - AddressLine = 300\r\n - Town = 100\r\n - WageTypeReason = 240\r\n - WorkingWeek = 250\r\n\r\n* Additional rules\r\n - Title must include the word ***apprentice***\r\n - HoursPerWeek must be between 16 and 48 inclusive\r\n - ExpectedDuration must be a minimum of 1 year, 12 months or 52 weeks depending on the value of DurationType selected\r\n - NumberOfPositions must not exceed 5,000\r\n\r\n#### Error codes ####\r\n\r\nThe following error codes may be returned when calling this operation if any of the vacancy values \r\nspecified fail validation:\r\n\r\n| Error code | Explanation |\r\n| ----------- | ------------------------------------------- |\r\n| 31000 | Invalid Request body |\r\n| 31001 | Invalid Title |\r\n| 31002 | Invalid Short description |\r\n| 31003 | Invalid Long description |\r\n| 31004 | Invalid Application closing date |\r\n| 31005 | Invalid Expected start date |\r\n| 31006 | Invalid Working week |\r\n| 31007 | Invalid Hours per week |\r\n| 31008 | Invalid Wage type |\r\n| 31009 | Invalid Wage type reason |\r\n| 31010 | Invalid Wage unit |\r\n| 31011 | Invalid Fixed wage |\r\n| 31012 | Invalid Min wage |\r\n| 31013 | Invalid Max wage |\r\n| 31014 | Invalid Expected duration |\r\n| 31015 | Invalid Duration type |\r\n| 31016 | Invalid Location type |\r\n| 31017 | Invalid Location Address line 1 |\r\n| 31018 | Invalid Location Address line 2 |\r\n| 31019 | Invalid Location Address line 3 |\r\n| 31020 | Invalid Location Address line 4 |\r\n| 31021 | Invalid Location Address line 5 |\r\n| 31022 | Invalid Location Town |\r\n| 31023 | Invalid Location Postcode |\r\n| 31024 | Invalid Number of positions |\r\n| 31025 | Invalid Provider's Ukprn |\r\n| 31026 | Invalid Employer's Edsurn |\r\n| 31027 | Invalid Provider site's Edsurn |\r\n| 31028 | Invalid Contact Name |\r\n| 31029 | Invalid Contact Email |\r\n| 31030 | Invalid Contact Number |\r\n| 31031 | Invalid Training Type |\r\n| 31032 | Invalid Training Code |\r\n| 31033 | Invalid Desired skills |\r\n| 31034 | Invalid Desired personal qualities |\r\n| 31035 | Invalid Desired qualifications |\r\n| 31036 | Invalid Future prospects |\r\n| 31037 | Invalid Things to consider |\r\n| 31038 | Invalid Training to be provided |\r\n| 31039 | Invalid Application method |\r\n| 31040 | Invalid Supplementary question 1 |\r\n| 31041 | Invalid Supplementary question 2 |\r\n| 31042 | Invalid External application url |\r\n| 31043 | Invalid External Application Instructions |\r\n| 31044 | Invalid Is Employer Disability Confident |\r\n| 31045 | Invalid Location Additional Information |\r\n| 31046 | Invalid Employer Description |\r\n| 31047 | Invalid Employer Website Url |",
"operationId": "CreateApprenticeshipVacancy",
"summary": "CreateApprenticeshipVacancy",
"tags": [
"Apprenticeships"
],
"parameters": [
{
"name": "createApprenticeshipParameters",
"in": "body",
"schema": {
"$ref": "#/definitions/CreateApprenticeshipParameters"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/xml",
"text/xml",
"application/x-www-form-urlencoded"
],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CreateApprenticeshipResponse"
}
},
"400": {
"description": "Failed request validation",
"schema": {
"$ref": "#/definitions/BadRequestContent"
}
},
"401": {
"description": "Invalid provider ukprn",
"schema": {
"$ref": "#/definitions/StringContent"
}
}
}
}
}
},
"definitions": {
"CreateApprenticeshipParameters": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"shortDescription": {
"type": "string"
},
"longDescription": {
"type": "string"
},
"desiredSkills": {
"type": "string"
},
"desiredPersonalQualities": {
"type": "string"
},
"desiredQualifications": {
"type": "string"
},
"futureProspects": {
"type": "string"
},
"thingsToConsider": {
"type": "string"
},
"trainingToBeProvided": {
"type": "string"
},
"applicationMethod": {
"enum": [
"Online",
"Offline"
],
"type": "string"
},
"supplementaryQuestion1": {
"type": "string"
},
"supplementaryQuestion2": {
"type": "string"
},
"externalApplicationUrl": {
"type": "string"
},
"externalApplicationInstructions": {
"type": "string"
},
"expectedDuration": {
"format": "int32",
"type": "integer"
},
"durationType": {
"enum": [
"Weeks",
"Months",
"Years"
],
"type": "string"
},
"applicationClosingDate": {
"format": "date-time",
"type": "string"
},
"expectedStartDate": {
"format": "date-time",
"type": "string"
},
"workingWeek": {
"type": "string"
},
"hoursPerWeek": {
"format": "double",
"type": "number"
},
"wageType": {
"enum": [
"CustomWageFixed",
"CustomWageRange",
"NationalMinimumWage",
"ApprenticeshipMinimumWage",
"Unwaged",
"CompetitiveSalary",
"ToBeSpecified"
],
"type": "string"
},
"wageTypeReason": {
"type": "string"
},
"wageUnit": {
"enum": [
"NotApplicable",
"Weekly",
"Monthly",
"Annually"
],
"type": "string"
},
"minWage": {
"format": "double",
"type": "number"
},
"maxWage": {
"format": "double",
"type": "number"
},
"fixedWage": {
"format": "double",
"type": "number"
},
"locationType": {
"enum": [
"OtherLocation",
"EmployerLocation",
"Nationwide"
],
"type": "string"
},
"location": {
"$ref": "#/definitions/Location"
},
"numberOfPositions": {
"format": "int32",
"type": "integer"
},
"employerEdsUrn": {
"format": "int32",
"type": "integer"
},
"providerSiteEdsUrn": {
"format": "int32",
"type": "integer"
},
"contactName": {
"type": "string"
},
"contactEmail": {
"type": "string"
},
"contactNumber": {
"type": "string"
},
"trainingType": {
"enum": [
"Framework",
"Standard"
],
"type": "string"
},
"trainingCode": {
"type": "string"
},
"isEmployerDisabilityConfident": {
"type": "boolean"
},
"employerWebsiteUrl": {
"type": "string"
},
"employerDescription": {
"type": "string"
}
}
},
"Location": {
"type": "object",
"properties": {
"addressLine1": {
"type": "string"
},
"addressLine2": {
"type": "string"
},
"addressLine3": {
"type": "string"
},
"addressLine4": {
"type": "string"
},
"addressLine5": {
"type": "string"
},
"postcode": {
"type": "string"
},
"town": {
"type": "string"
},
"additionalInformation": {
"type": "string"
}
}
},
"CreateApprenticeshipResponse": {
"type": "object",
"properties": {
"vacancyReferenceNumber": {
"format": "int32",
"type": "integer"
}
}
},
"BadRequestContent": {
"type": "object",
"properties": {
"requestErrors": {
"type": "array",
"items": {
"$ref": "#/definitions/BadRequestError"
}
}
}
},
"BadRequestError": {
"type": "object",
"properties": {
"errorCode": {
"type": "string"
},
"errorMessage": {
"type": "string"
}
}
},
"StringContent": {
"type": "object",
"properties": {
"headers": {
"type": "array",
"items": {
"$ref": "#/definitions/KeyValuePair[String,IEnumerable[String]]"
},
"readOnly": true
}
}
},
"KeyValuePair[String,IEnumerable[String]]": {
"type": "object",
"properties": {
"key": {
"type": "string",
"readOnly": true
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"readOnly": true
}
}
}
},
"tags": []
}
4) Press Save.

Then get the error "Error encountered while saving External Registration. Please try again later."
The Error I Get
Any help will be much-appreciated thankyou.
As the title says "When using dates on a process the date value is always off by -1"
Same happens when a date is imported.
Is it something to do with time zones. I'm using GMT zone.
Why is this, and how do I fix it?

Thanks Dan
So if the output is blank or a default value I would like it to highlight, is this possible, if so how?
User-added image
Is it possible to have a different print view so I have functionality on paper?
This is the multi picklist form but once printed it has no functionality.
User-added image
User-added image
How can I change the view so it shows all values so a user can tick or circle an option? (Print View)

Im expecting to probably make a page that looks the same but where I substitute picklists for checkboxes. 

Is this possible, if so how?

Thanks Dan
How do I give my radio buttons a value that has already been detarmined in a picklist?
User-added image
Example if I choose "Male" in my picklist I would like the "Male" radio button to be selected on my VF page.


Also,
<div class="slds-size_2-of-8">
                                <div class="slds-box slds-box_x-small slds-text-align_center slds-m-around_x-small">
                                    <div class="slds-form-element__control">
                                        <label class="slds-form-element__label" for="form-element-02">
                                            <b>
                                                Are You British Citizen?:-
                                            </b>
                                        </label>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-3" value="radio-" name="YesNo" />
                                            <label class="slds-radio__label" for="radio-3">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Yes
                                                </span>
                                            </label>
                                        </span>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-4" value="radio-4" name="YesNo" />
                                            <label class="slds-radio__label" for="radio-4">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    No
                                                </span>
                                            </label>
                                        </span>
                                    </div>
                                    {! Apprentice__c.British_Citizen__c}
                                </div>
                            </div>

how do I use a checkbox with a value of TRUE & FALSE and convert it into a radio button saying yes and no?
User-added image
 
<div class="slds-size_2-of-8">
                                <div class="slds-box slds-box_x-small slds-text-align_center slds-m-around_x-small">
                                    <div class="slds-form-element__control">
                                        <label class="slds-form-element__label" for="form-element-01">
                                            <b>
                                                Gender
                                            </b>
                                        </label>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-1" value="{! Apprentice__c.Gender__c}" name="MaleFemale"/>
                                            <label class="slds-radio__label" for="radio-1">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Male
                                                </span>
                                            </label>
                                        </span>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-2" value="{! Apprentice__c.Gender__c}" name="MaleFemale" />
                                            <label class="slds-radio__label" for="radio-2">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Female
                                                </span>
                                            </label>
                                        </span>
                                    </div>
                                </div>
                            </div>

Thanks Dan
User-added image
How do I give my Picklist, Lookup and Date Picker Functionality. Is it done with components or can it all be done within Visual Force pages.

How is a component supposed to be called is it somthing like <c:ComponentName>?
Im wondering how I go about using the SLDS components, I cant for the life of me figure it out and non of the online guides are helping me out. For example the combo box and picklist require <aura:component> but I have no clue how to use them or refrence them. 

This is the page:-
User-added image
The Visual Force Code is in the comments:-

Here is what im trying to do:-
https://developer.salesforce.com/docs/component-library/bundle/lightning:combobox/example
https://www.lightningdesignsystem.com/components/combobox/#site-main-content

But it I cant get it working.

Any help or explanation on how its done will be much appreciated thanks.
Im wondering how I go about using the SLDS components, not of the online guides are helping me out. For example the combo box and picklist require <aura:component> but I have no clue how to use them or refrence them. 

This is the page:-
User-added image

This is the Visual Force Code:-
<apex:page standardController="Apprentice__c" title="Learning Agreement" showHeader="false" standardStylesheets="false" sidebar="false">
    <div class="slds-global-header__item">   
    </div>
    <head>
        <title>
            VF Template Tab Title
        </title>
        <apex:slds />
    </head>
    <body>
        <div class="slds-scope">
<div class="slds-size_3-of-5">
                            <div class="slds-box slds-box_x-small slds-m-around_x-small">
                                <div style="height: 13rem;">
                                    <div class="slds-form-element">
                                        <label class="slds-form-element__label" for="combobox-id-1">Look Up</label>
                                        <div class="slds-form-element__control">
                                            <div class="slds-combobox_container slds-has-selection">
                                                <div class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click slds-is-open" aria-expanded="false" aria-haspopup="listbox" role="combobox">
                                                    <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                                                        <input type="text" class="slds-input slds-combobox__input" id="combobox-id-1" aria-autocomplete="list" aria-controls="listbox-id-1" autocomplete="off" role="textbox" placeholder="Search..." />
                                                    </div>
                                                    <div id="listbox-id-1" class="slds-dropdown slds-dropdown_length-with-icon-7 slds-dropdown_fluid" role="listbox">
                                                        <ul class="slds-listbox slds-listbox_vertical" role="presentation">
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option1" class="slds-media slds-listbox__option slds-listbox__option_entity slds-listbox__option_has-meta" role="option">
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-listbox__option-text slds-listbox__option-text_entity">UseComboBox Implimentation</span>
                                                                        <span class="slds-listbox__option-meta slds-listbox__option-meta_entity">Account • Burlington, NC</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option2" class="slds-media slds-listbox__option slds-listbox__option_entity slds-listbox__option_has-meta" role="option">
                                                                    
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-listbox__option-text slds-listbox__option-text_entity">Dickenson plc</span>
                                                                        <span class="slds-listbox__option-meta slds-listbox__option-meta_entity">Account • Lawrence, KS</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option3" class="slds-media slds-listbox__option slds-listbox__option_entity slds-listbox__option_has-meta" role="option">
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-listbox__option-text slds-listbox__option-text_entity">Edge Communications</span>
                                                                        <span class="slds-listbox__option-meta slds-listbox__option-meta_entity">Account • Austin, TX</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="slds-size_2-of-5">
                            <div class="slds-box slds-box_x-small slds-m-around_x-small">
                                <div style="height: 13rem;">
                                    <div class="slds-form-element">
                                        <label class="slds-form-element__label" for="combobox-id-1">Pick List</label>
                                        <div class="slds-form-element__control">
                                            <div class="slds-combobox_container">
                                                <div class="slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click slds-is-open" aria-expanded="false" aria-haspopup="listbox" role="combobox">
                                                    <div class="slds-combobox__form-element slds-input-has-icon slds-input-has-icon_right" role="none">
                                                        <input type="text" class="slds-input slds-combobox__input" id="combobox-id-1" aria-controls="listbox-id-1" autoComplete="off" role="textbox" placeholder="Select an Option" readonly="" />
                                                        <span class="slds-icon_container slds-icon-utility-down slds-input__icon slds-input__icon_right"> 
                                                        </span>
                                                    </div>
                                                    <div id="listbox-id-1" class="slds-dropdown slds-dropdown_length-5 slds-dropdown_fluid" role="listbox">
                                                        <ul class="slds-listbox slds-listbox_vertical" role="presentation">
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option1" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
                                                                    <span class="slds-media__figure">
                                                                        
                                                                    </span>
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-truncate" title="Accounts"> Accounts</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option2" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
                                                                    <span class="slds-media__figure">
                                                                        
                                                                    </span>
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-truncate" title="Reports"> Reports</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option3" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
                                                                    <span class="slds-media__figure">
                                                                        
                                                                    </span>
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-truncate" title="Contacts"> Contacts</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                            
                                                            <li role="presentation" class="slds-listbox__item">
                                                                <div id="option4" class="slds-media slds-listbox__option slds-listbox__option_plain slds-media_small" role="option">
                                                                    <span class="slds-media__figure"> 
                                                                    </span>
                                                                    <span class="slds-media__body">
                                                                        <span class="slds-truncate" title="Files"> Files</span>
                                                                    </span>
                                                                </div>
                                                            </li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
</body>
</apex:page>

Here is what im trying to do:-
https://developer.salesforce.com/docs/component-library/bundle/lightning:combobox/example
https://www.lightningdesignsystem.com/components/combobox/#site-main-content


But it I cant get it working.
 
How do I use VisualForce Component, Im struggling to wrap my head arond them. How are they called and refrenced and what Must I do to impliment a Save and Cancel function to my page?
<div class="slds-col slds-no-flex slds-grid slds-align-top">
                    <div class="slds-button-group" role="SPC">
                        <button class="slds-button slds-button_neutral">
                        	Save
                        </button>
                        <button class="slds-button slds-button_neutral" onclick="window.print();" >
                            Print
                         </button>
                        <button class="slds-button slds-button_neutral" >
                        	Cancel
                        </button>
                    </div>
                </div>
I expected It to be somthing like this -
<div class="slds-col slds-no-flex slds-grid slds-align-top">
                    <div class="slds-button-group" role="SPC">
                        <button class="slds-button slds-button_neutral" action="{!save}" >
                        	Save
                        </button>
                        <button class="slds-button slds-button_neutral" onclick="window.print();" >
                            Print
                         </button>
                        <button class="slds-button slds-button_neutral" >
                        	Cancel
                        </button>
                    </div>
                </div>

But I get this Error
Unknown property 'Apprentice__cStandardController.save'
Im using a Standard Controller so I have no clue why this error is appearing.
 
<apex:page standardController="Apprentice__c" title="Learning Agreement" showHeader="false" standardStylesheets="false" sidebar="false">
<head>
    <title>Apprentice Learning Agreement Form</title>
    <apex:slds />
</head>
<body>
    <div class="slds-scope">
        <div class="slds-page-header">
            <div class="slds-grid">   
                <div class="slds-col slds-has-flexi-truncate">
                    <div class="slds-media slds-no-space slds-grow">
                        <div class="slds-media__body">
                            <h1 class="slds-page-header__title slds-m-right_small slds-align-middle slds-truncate" title="Apprentice Learning Agreement">Apprentice Learning Agreement</h1>
                        </div>
                    </div>
                </div>     
<!-- PAGE HEADER / ROW 1 / COLUMN 2 -->
                <div class="slds-col slds-no-flex slds-grid slds-align-top">
                    <div class="slds-button-group" role="SPC">
                        <button class="slds-button slds-button_neutral" action="{!save}" >
                        	Save
                        </button>
                        <button class="slds-button slds-button_neutral" onclick="window.print();" >
                            Print
                         </button>
                        <button class="slds-button slds-button_neutral" >
                        	Cancel
                        </button>
                    </div>
                </div>


 
Any good guides or methods that I can use for styling a visual force page?

Is SLDS the way to go?
Ive made a print function that I would like to use to print out my learning agreement form with all the data included but when I press print It says "Page a021r00000hWJOKAA4".

This is my page that the print buton is on -

User-added image
This is what shows up:-
User-added image
Here is my Print function in an Apex Extention :-
public class PrintableView
{
   public final Apprentice__c App;
   public PrintableView(ApexPages.StandardController stdController) {
        this.App = (Apprentice__c)stdController.getRecord();
    }  
  public Apprentice__c ApprenticeObj{get;set;}
  public Programme_Area__c ProgramArea {get;set;}
  public Boolean bolPrintableView {get;set;}
           
    public void init() {
   String strPrintableView = ApexPages.currentPage().getParameters().get('print');
   bolPrintableView = (strPrintableView == '1');
        Programme_Area__c ProgramArea = new Programme_Area__c();
        ProgramArea.PA_Code__c = '112';
        
  }
    public PrintableView(){
        ApprenticeObj = new Apprentice__c();
        ProgramArea = new Programme_Area__c();
        
    }
}



Here is my visual force page with the print function at the top -
<apex:page lightningStyleSheets="True" StandardController="Apprentice__c" extensions="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
    <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="{!$CurrentPage.parameters.id}/returl/?print=1" target="_blank">Printable View</a>
</apex:outputPanel>

<apex:outputPanel rendered="{!bolPrintableView}">
    <script>
        window.print()
    </script>
</apex:outputPanel>
     Apprenticeship: Learning Agreement <br />
                        This document forms a learning agreement between you and East Riding college. The College agrees to provide the resources necessary to achieve
                         your learning goals and you agree in turn to register for the appropriate qualification and to complete the programme of study which you <br /> have chosen. 
                         Please complete this document as fully as possible. Without your details, we cannot apply for the funding which allows 
                         us to run the course that you wish to study. Discuss any problems or uncertainties that you may have with staff and then finally sign and date the agreement.
         
        <apex:pageBlock >
         Learner ID :- <apex:inputField value="{! Apprentice__c.Learner_Reference_Number__c }"/>
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! Apprentice__c.Date_of_Birth__c}"/>
                <apex:inputField value="{! Apprentice__c.Surname__c}"/>
                <apex:inputField value="{! Apprentice__c.First_Name__c}"/>
                <apex:inputField value="{! Apprentice__c.Middle_Other_Names__c}"/>
                <apex:inputField value="{! Apprentice__c.Previous_Surname__c}"/>
                <apex:inputField value="{! Apprentice__c.Preferred__c}"/>
                <apex:inputField value="{! Apprentice__c.Gender__c}"/>
                <apex:inputField value="{! Apprentice__c.ULN__c}"/>
                <apex:inputField value="{! Apprentice__c.NI_Number__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
         
         <apex:pageBlock >
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! Apprentice__c.Address__c}"/>
               <apex:inputField value="{! Apprentice__c.Postcode__c}"/>
               <apex:inputField value="{! Apprentice__c.Mobile__c}"/>
               <apex:inputField value="{! Apprentice__c.Home_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Alternative_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Email__c}"/>
               <apex:inputField value="{! Apprentice__c.Emergency_Contact__c}"/>
               <apex:inputField value="{! Apprentice__c.Emergency_Contact_Phone__c}"/>
                <apex:inputField value="{! Apprentice__c.Emergency_Contact_Relationship__c}"/>
               <apex:inputField value="{! Apprentice__c.Parent_Guardian_Name__c}"/>
               <apex:inputField value="{! Apprentice__c.Parent_Guardian_Phone__c}"/>
               <H4>Reminder -</H4> If any of your details change during the year please inform the college. <br />
               <H4>Note -</H4> By providing your mobile no. you may recive SMS messages relevant to your course.
            </apex:pageBlockSection>
         </apex:pageBlock>
     <!--End of Personal Details Section-->
        
     <!--Country Of Residence-->
       <apex:pageBlock title="Country Of Residence">
            <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Nationality__c}"/>
                <apex:inputField value="{! Apprentice__c.British_Citizen__c}"/>
                <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Lived_In_England_Or_EEA_for_3_Years__c}"/>
                
                <apex:inputField value="{! Apprentice__c.If_no_date_of_entry_to_UK_or_EU__c}"/>
                <H5>*If you have answered NO to the question above please complete the following details and state date of entry into the UK or EU:</H5>
                </apex:pageBlockSection>
                
                <H5>*Please tick the relevant box if your passport indicates that your current status is any of the following:</H5>
                <apex:inputField value="{! Apprentice__c.Passport_Status__c}"/>
                
                <H5>Non-UK residents will be required to produce evidence of their current status (Passport or other official documentation e.g. visa details)</H5>
                
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Country Of Residence-->
        
        <!--End of Ethnic Origin-->
        
        <apex:pageBlock title="Ethnic Origin">
            <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Ethnicity__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
      <!--End of Ethnic Origin-->
        
      <!--Personal Needs-->
        <apex:pageBlock title="Personal Needs">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Recorded_Disabilities__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Difficulties__c}"/>
                <apex:inputField value="{! Apprentice__c.Other_Disabilities__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Personal Needs-->
      
      <!--Prior Attainment-->
        <apex:pageBlock title="Prior Attainment">
            <apex:pageBlockSection columns="2" >
                <H5>Please select the level that corresponds with your highest qualification before coming to the College. </H5>
                <apex:inputField value="{! Apprentice__c.Highest_Previous_Attainment__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Prior Attainment-->
      
      <!--Employment Information-->
        <apex:pageBlock title="Employment Information">
            <apex:pageBlockSection columns="4" >
                <H4>I am a New STARTER with this employer and have been recruited specifically to fill a new Apprenticeship vacancy.</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_New_Starter__c}"/>
                <H4>My full-time contract started on</H4>
                <apex:inputField value="{! Apprentice__c.New_Start_Contract_Date__c}"/>
                <H4>I am an EXISTING EMPLOYEE that is moving up from part-time hours to fill a new Apprenticeship vacancy </H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_from_P_Time__c}"/>
                <H4>My full-time contract started on</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_New_Contract_Start__c}"/>
                <H4>I am an EXISTING EMPLOYEE that is changing job role to fill a new Apprenticeship Vacancy.</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_from_Changing__c}"/>
                <H4>My full-time contract for the new job role started on</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_New_Job_Start__c}"/>
                <H4>I am an EXISTING EMPLOYEE full-time that is continuing with my current job role but require significant new knowledge and skills</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_Development__c}"/>
                <H4>My approximate start date with this company was</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_Company_Start__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--Employment Information-->
      
      <!--Employment Status on the day ... -->
        <apex:pageBlock title="Employment Status on the day before you started your Apprenticeship">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Pre_Apprenticeship_Employed_Hours__c}"/>
                <apex:inputField value="{! Apprentice__c.Seeking_Not_Seeking_Work__c}"/>
                <apex:inputField value="{! Apprentice__c.Previous_Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Not_employed_status_benefits__c}"/>
                <apex:inputField value="{! Apprentice__c.Period_Not_Employed__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Employment Status on the day ... -->
      
      <!--At the start of my ... -->
        <apex:pageBlock title="At the start of my apprenticeship I will be Employed by">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Employer_name__c}"/>
                <apex:inputField value="{! Apprentice__c.Employer_Address__c}"/> <!--Set As Address-->
                <apex:inputField value="{! Apprentice__c.Postcode__c}"/>
                <apex:inputField value="{! Apprentice__c.Hours_Worked_Per_Week__c}"/>
                <apex:inputField value="{! Apprentice__c.ERN__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of At the start of my ... -->
      
      <!--Enrolment Details 
        <apex:pageBlock title="Enrolment Details">
            <apex:pageBlockSection columns="2" >
         
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Enrolment Details -->
      
       <!--Privacy Notice-->
        
        <apex:pageBlock title="PRIVACY NOTICE 2017/18">
            <apex:pageBlockSection columns="1" >
                
<h4>How We Use Your Personal Information</h4> 
This privacy notice is issued by the Education and Skills Funding Agency (ESFA), on behalf of the Secretary of State for the Department of Education (DfE). <br /> It is to inform learners how their personal information will be used by the DfE, the ESFA (an executive agency of the DfE) and any successor bodies to these organisations. <br /> For the purposes of relevant data protection legislation, the DfE is the data controller for personal data processed by the ESFA. <br /><br />
 
Your personal information is used by the DfE to exercise its functions and to meet its statutory responsibilities, including under the Apprenticeships, Skills, Children and Learning Act 2009 and to create and maintain a unique learner number (ULN) and a personal learning record (PLR). Your information will be securely destroyed after it is no longer required for these purposes. <br /><br />
 
Your information may be shared with third parties for education, training, employment and well-being related purposes, including for research. <br /> This will only take place where the law allows it and the sharing is in compliance with data protection legislation. <br /> The English European Social Fund (ESF) Managing Authority (or agents acting on its behalf) may contact you in order for them to carry out research and evaluation to inform the effectiveness of training. <br /><br />
 
You can agree to be contacted for other purposes by ticking any of the following boxes:
  
Further information about use of and access to your personal data, details of organisations with whom we regularly share data, information about how long we retain your data, and how to change your consent to being contacted, please visit:  https://goo.gl/0rwQMT
 
Any changes to the privacy notice will be published on Moodle (for current students) and the website (for applicants) as soon as they become available.  Please check for updates. 
  
<h4>Learning Records Service Privacy Notice</h4>

The information you supply will be used by the Education and Skills Funding Agency, an executive agency of the Department of Education (DfE), to issue you with a Unique Learner Number (ULN), and to create your Personal Learning Record. For more information about how your information is processed and shared refer to the Extended Privacy Notice available at: https://goo.gl/iOxSgJ 
 

<h4>DISCLAIMER</h4>

Before accepting any place offered on a course, prospective students should be aware that the provision of an education service is subject to written terms and conditions of  contract. Such conditions include limiting the Colleges liability should industrial action or other circumstances prevent or interfere with the provision of services or cause the College to alter or rearrange any of the educational service offered. The College also reserves the right to withdraw any advertised class for which insufficient numbers of full fee paying students enrol and to close any class if low numbers attending make it no longer viable. 
 
The enrolment of a learner with a criminal record, caution or reprimand will depend upon the nature of the course and the details of any conviction or 
caution. If you are convicted of a criminal offence, after you have enrolled, you let us know immediately. If you are not sure whether to tell us about a previous conviction you can get more advice from Learner Services.
 
The College is bound by relevant data protection legislation and your data and image will be stored in accordance with these regulations. 
 

<h4>LEARNING AGREEMENT DECLARATIONS - My signature below indicates that:</h4>
- I confirm that all the information on this form is correct and that I have declared all of my current qualifications. I understand that if I have declared false information the College may take action against me to reclaim the tuition fees and any support costs incurred.
- I intend to follow the programme of study as specified by the qualifications listed. I have discussed the programme with relevant staff and understand the entry requirements and progression routes offered by the course, its suitability to my needs, the workload required of me and any financial or 
       learning support which may be available during my studies.
- I agree to be responsible for the payment of tuition, registration and examination fees (as applicable) by the due date and any additional costs should I make a late entry.  I accept liability for any examination or registration fees should I fail to attend or complete my programme.  
- I will comply with all College Rules and Regulations and any other regulations specific to my chosen programme.
- All Apprentice Learners: I am aware that in addition to the main qualification detailed on this form, my Apprenticeship Programme will incorporate other elements which may include Maths and/or English skills development; and other Qualifications and non-Qualification activities. These will be agreed and recorded in my learning plan. <h5> I understand that I will be required to attend all sessions. </h5>
<h5> I am aware of the College’s fees and charges policy (available on the website or on reception). </h5>
 


            </apex:pageBlockSection>
        </apex:pageBlock>
        
        <!--End of Privacy Notice-->
        
      <!--Save/Cancel-->
        <apex:pageBlock >
        
        
        </apex:pageBlock> 
        
      <!--End of Save/Cancel-->
       
       
    <!--End of Table-->     

    </apex:form>
</apex:page>
From my understanding this is what pulls up the page with the data in <a href="{!$CurrentPage.parameters.id}/returl/?print=1" target="_blank">Printable View</a> but it wont show me a page?

Thanks for any and all help. An explanation as to what I must do would be much appreciated.

Thanks Dan
 
User-added image
When I go to Validate to set live I get this problem, It dosnt show in the testing and It dosnt cause any issues in the sandbox. I was wondering if anyone could help me solve it?

Controller:-
public class PrintableView
{
   public final Apprentice__c App;
   public PrintableView(ApexPages.StandardController stdController) {
        this.App = (Apprentice__c)stdController.getRecord();
    }  
	public Apprentice__c ApprenticeObj{get;set;}
	public Programme_Area__c ProgramArea {get;set;}
	public Boolean bolPrintableView {get;set;}
           
    public void init() {
 	String strPrintableView = ApexPages.currentPage().getParameters().get('print');
 	bolPrintableView = (strPrintableView == '1');
        Programme_Area__c ProgramArea = new Programme_Area__c();
        ProgramArea.PA_Code__c = '112';
        insert ProgramArea;
        
	}
    public PrintableView(){
        ApprenticeObj = new Apprentice__c();
        ProgramArea = new Programme_Area__c();
        
    }
}
Test Class:-
@isTest

private class PrintViewTest {
    private Apprentice__c ApprenticeObj {get;set;}
    private Boolean bolPrintableView {get;set;}
    public PrintableView Pview {get;set;}
    public Programme_Area__c ProgramArea {get;set;}

    @istest Private Static void ApprenticeObjTest(){
       
		Programme_Area__c ProgramArea = new Programme_Area__c();
        ProgramArea.PA_Code__c = '112';
		insert ProgramArea;
	
		Apprentice__c ApprenticeObj = new Apprentice__c();
		ApprenticeObj.Date_of_Birth__c = date.parse('12/08/2000');
		ApprenticeObj.Programme_area__c = ProgramArea.Id;
		insert ApprenticeObj;
    }
    
    @istest Private Static void StandardTest(){
      Apprentice__c ApprenticeObj = new Apprentice__c();  
      Apexpages.StandardController sc = new Apexpages.standardController(ApprenticeObj);
      PrintableView PrintExt = new PrintableView(sc);
    }
     @istest Private Static void GetSetTest(){
        PrintableView Pview = new PrintableView();
        Pview.init();
        
        // check that an Apprentice__c was created
        List<Apprentice__c> ApprenticeObj = [SELECT Id FROM Apprentice__c];
        List<Programme_Area__c> ProgramArea = [SELECT Id FROM Programme_Area__c]; 
    }       
}

Thanks for any help

 
Im always having problems with the "Programme Area" object. It never seems to want to test and Its always at this point I get stuck.
User-added imageUser-added imageUser-added image
Can somone help me with what im missing and tell me how you knew what I needed and where I needed it thankyou.
If it helps the "Programme Area" is a master Detail.

Thanks Dan
Hi, I've had the problem again, where i get no coverage could somone explain what I should do to determine where and what I needed to add to my test class?

User-added imageThanks Dan
This is more of a general question but I was wondering what everyone did to improve their Apex skills?

I've done Trailheads and looked online at code usage and still struggle alot.
here should I look to learn about Apex Syntax, usage and best software/pluggins to use.
Any good books or online guides that take me through A-Z.
How Apex can be used and basic must know Apex knowledge. 😊

Thankyou
Finally got all the testing done for my Apex controller and got the print layout functioning as I wanted but a huge problem I have encounterd now is that my Visual Force Page isnt showing any data. What must I add to my Visualforce/Apex to show the values that I have in the fields.
User-added image
Ive had this problem before but couldnt figure it out. Here is some information It should be displaying.
User-added image

Here is my apex Class:-
public class PrintableView{   
public Apprentice__c ApprenticeObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public Boolean bolPrintableView {get;set;}
       
    public void init() {
   String strPrintableView = ApexPages.currentPage().getParameters().get('print');
   bolPrintableView = (strPrintableView == '1');
  }
  
public PageReference save(){
if(ApprenticeObj != null){
} 
return null;
}
}
Visual Force componet used to make the print function:-
<apex:component controller="PrintableView" allowDML="true">
    public PrintableView(){ 
    ApprenticeObj = new Apprentice__c();
    ProgramArea = new Programme_Area__c ();
    ProgramArea.PA_Code__c = 'P12';
    insert ProgramArea;
    }
</apex:component>
And a small Snippet of the Visualforce Page
<apex:page lightningStyleSheets="True" Controller="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
    <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="/apex/Apprentice?print=1" target="_blank">Printable View</a>
</apex:outputPanel>

<apex:outputPanel rendered="{!bolPrintableView}">
    <script>
        window.print()
    </script>
</apex:outputPanel>

<apex:pageBlock >
         Learner ID :- <apex:inputField value="{! ApprenticeObj.Learner_Reference_Number__c }"/>
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! ApprenticeObj.Date_of_Birth__c}"/>
                <apex:inputField value="{! ApprenticeObj.Surname__c}"/>
                <apex:inputField value="{! ApprenticeObj.First_Name__c}"/>
                <apex:inputField value="{! ApprenticeObj.Middle_Other_Names__c}"/>
                <apex:inputField value="{! ApprenticeObj.Previous_Surname__c}"/>
                <apex:inputField value="{! ApprenticeObj.Preferred__c}"/>
                <apex:inputField value="{! ApprenticeObj.Gender__c}"/>
                <apex:inputField value="{! ApprenticeObj.ULN__c}"/>
                <apex:inputField value="{! ApprenticeObj.NI_Number__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>

Thankyou for all and any help!

 
I keep getting this error when I preview my Visual force page.
User-added image
Here is my custom Apex controller:-
public class PrintableView{   
public Apprentice__c ApprenticeObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public Boolean bolPrintableView {get;set;}
        
public PrintableView(){ 
    ApprenticeObj = new Apprentice__c();
    ProgramArea = new Programme_Area__c ();
    ProgramArea.PA_Code__c = 'P12';
    insert ProgramArea;
    }
    public void init() {
 	String strPrintableView = ApexPages.currentPage().getParameters().get('print');
 	bolPrintableView = (strPrintableView == '1');
	}
	
public PageReference save(){
if(ApprenticeObj != null){
	ApprenticeObj.Programme_Area__c = ProgramArea.Id;
	ApprenticeObj.Date_of_Birth__c = date.parse('12/08/2000');
  upsert ApprenticeObj;
} 
return null;
}
}
Here is the top of my Visual force page:-
<apex:page lightningStyleSheets="True" Controller="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
        <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="/apex/Apprentice?print=1" target="_blank">Printable View</a>
</apex:outputPanel>

<apex:outputPanel rendered="{!bolPrintableView}">
    <script>
        window.print()
    </script>
</apex:outputPanel>

Any help is appreciated, hopefully I wont have to adjust apex because its a nighmare for me to test.

Thankyou Dan
 
I am receiving the green tick but gaining 0% cover what must I include to begin gauging the code coverage?

Controller -
User-added image
Test Class-

User-added image

Thankyou Dan
Basically I can figure out what cose I must use to get a layout that represents this :-
User-added image
With One row acroos the top and two columns below.
Need a hand structuring the code:-
User-added image
<aura:component implements="lightning:homeTemplate" access="global" >
    <aura:attribute name="center" type="Aura.Component[]" />
    <aura:attribute name="left" type="Aura.Component[]" />
    <aura:attribute name="right" type="Aura.Component[]" />
    
    <div>
    	<lightning:layout >
            
            <lightning:layoutitem 
                          class="slds_m-center_small">
            	{v.center}
            </lightning:layoutitem>
            
        	<lightning:layoutitem flexibility="grow" 
                                  class="slds-m-right_small">
            	{!v.left}
            </lightning:layoutitem>
            
            <lightning:layoutitem size="{! $Browser.isDesktop ? '3' : '6' }"
                                  class="slds-m-left_small">
            	{!v.right}
            </lightning:layoutitem>
        </lightning:layout>
    </div>
    
</aura:component>
 
<design:component label="Two column Page">
	<flexipage:template>
        
        <flexipage:region name="center" defaultWidth="SMALL">
            <flexipage:formfactor type="MEDIUM" width="LARGE"/>
        </flexipage:region>
        
    <flexipage:region name="left" defaultWidth="LARGE">
        <flexipage:formfactor type="MEDIUM" width="SMALL"/>
        </flexipage:region>
        
        <flexipage:region name="right" defaultWidth="SMALL">
            <flexipage:formfactor type="MEDIUM" width="SMALL"/>
        </flexipage:region>
        
    </flexipage:template>
</design:component>

Im supprised its not an option for the homepage layout.

Any help is much appreciated thanks Dan.
How do I give my radio buttons a value that has already been detarmined in a picklist?
User-added image
Example if I choose "Male" in my picklist I would like the "Male" radio button to be selected on my VF page.


Also,
<div class="slds-size_2-of-8">
                                <div class="slds-box slds-box_x-small slds-text-align_center slds-m-around_x-small">
                                    <div class="slds-form-element__control">
                                        <label class="slds-form-element__label" for="form-element-02">
                                            <b>
                                                Are You British Citizen?:-
                                            </b>
                                        </label>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-3" value="radio-" name="YesNo" />
                                            <label class="slds-radio__label" for="radio-3">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Yes
                                                </span>
                                            </label>
                                        </span>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-4" value="radio-4" name="YesNo" />
                                            <label class="slds-radio__label" for="radio-4">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    No
                                                </span>
                                            </label>
                                        </span>
                                    </div>
                                    {! Apprentice__c.British_Citizen__c}
                                </div>
                            </div>

how do I use a checkbox with a value of TRUE & FALSE and convert it into a radio button saying yes and no?
User-added image
 
<div class="slds-size_2-of-8">
                                <div class="slds-box slds-box_x-small slds-text-align_center slds-m-around_x-small">
                                    <div class="slds-form-element__control">
                                        <label class="slds-form-element__label" for="form-element-01">
                                            <b>
                                                Gender
                                            </b>
                                        </label>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-1" value="{! Apprentice__c.Gender__c}" name="MaleFemale"/>
                                            <label class="slds-radio__label" for="radio-1">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Male
                                                </span>
                                            </label>
                                        </span>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-2" value="{! Apprentice__c.Gender__c}" name="MaleFemale" />
                                            <label class="slds-radio__label" for="radio-2">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Female
                                                </span>
                                            </label>
                                        </span>
                                    </div>
                                </div>
                            </div>

Thanks Dan
I'm currently in a Developer Sandbox trying to get the "External Services" to work. I have gone through the TrailHead and had it working with the resources I was supplied but once I try to use the actual API schema we need I get the error “Error encountered while saving External Registration. Please try again later.” which doesn't give me much to go off. I have tried raising the case with Salesforce and asking this question on other sites to no avail. https://salesforce.stackexchange.com/questions/309320/while-trying-to-use-the-external-sevices-i-get-the-error-error-encountered-whil?noredirect=1#comment463197_309320 (https://salesforce.stackexchange.com/questions/309320/while-trying-to-use-the-external-sevices-i-get-the-error-error-encountered-whil?noredirect=1#comment463197_309320)

Just to confirm I have created a "Named Credential" and added the corresponding domain to the "Remote Site Settings".

The Steps to reproduce the error are:

1) From Setup, enter Remote Site Settings in the Quick Find box, then select Remote Site Settings.
Click New Remote Site.
Remote Site Name, use FindAnApprenticeshipAPIURL.
Remote Site URL https://apis.apprenticeships.sfa.bis.gov.uk.

2) From Setup, enter Named Credentials in the Quick Find box, then select Named Credentials.
Click New Named Credential.
Label, use FindAnApprenticeshipNamedCred.
URL, use https://apis.apprenticeships.sfa.bis.gov.uk/manage-vacancies-sandbox/v1/apprenticeships.

3) From Setup, enter External Services in the Quick Find box, then select External Services.
Click Add an External Service.
External Service Name, use FindAnApprenticeshipExService.
Select a Named Credential, select FindAnApprenticeshipNamedCred.
Select Service Schema Complete JSON. Then paste the schema information from "https://developers.apprenticeships.education.gov.uk/docs/services/eebd1522767f4f1fbdfe51bd7010aa7e/export?DocumentFormat=Swagger":
{
"swagger": "2.0",
"info": {
"title": "Manage vacancies API (Sandbox)",
"version": "1.0",
"description": "Manage vacancies API (Sandbox)"
},
"host": "apis.apprenticeships.sfa.bis.gov.uk",
"basePath": "/manage-vacancies-sandbox",
"schemes": [
"https"
],
"securityDefinitions": {
"apiKeyHeader": {
"type": "apiKey",
"name": "Ocp-Apim-Subscription-Key",
"in": "header"
},
"apiKeyQuery": {
"type": "apiKey",
"name": "subscription-key",
"in": "query"
}
},
"security": [
{
"apiKeyHeader": []
},
{
"apiKeyQuery": []
}
],
"x-servers": [
{
"url": "https://apis.apprenticeships.sfa.bis.gov.uk"
},
{
"url": "https://apis.apprenticeships.education.gov.uk"
}
],
"paths": {
"/v1/apprenticeships": {
"post": {
"description": "The apprenticeship operation creates an apprenticeship vacancy using the specified values.\r\n\r\n#### Restricted values ####\r\n\r\nThese fields will only accept specific values as listed below:\r\n* ApplicationMethod\r\n - Online\r\n - Offline\r\n* LocationType\r\n - OtherLocation\r\n - EmployerLocation\r\n - Nationwide\r\n* DurationType\r\n - Weeks\r\n - Months\r\n - Years\r\n* WageType\r\n - CustomWageFixed\r\n - CustomWageRange\r\n - NationalMinimumWage\r\n - ApprenticeshipMinimumWage\r\n - Unwaged\r\n - CompetitiveSalary\r\n - ToBeSpecified\r\n* WageUnit\r\n - NotApplicable\r\n - Weekly\r\n - Monthly\r\n - Annually\r\n* TrainingType\r\n - Framework\r\n - Standard\r\n\r\n#### Validation rules ####\r\n\r\nWhen creating a vacancy the following rules must be considered. \r\n1. All values are required to be populated except in the following cases:\r\n\r\n* For all vacancies these values are optional\r\n - ContactName\r\n - ContactEmail\r\n - ContactNumber\r\n - ThingsToConsider\r\n\r\n* For an Online vacancy\r\n - SupplementaryQuestion1 and SupplementaryQuestion2 are optional\r\n - ExternalApplicationUrl and ExternalApplicationInstructions must be empty\r\n\r\n* For an Offline vacancy\r\n - ExternalApplicationInstructions is optional\r\n - SupplementaryQuestion1 and SupplementaryQuestion2 must be empty\r\n\r\n* When LocationType is EmployerLocation or Nationwide \r\n - Location is not required.\r\n\r\n* When LocationType is OtherLocation \r\n - Only Address1, Town and Postcode are required\r\n - All other address fields are optional\r\n\r\n* When WageType is CustomWageFixed\r\n - WageTypeReason must be empty\r\n - WageUnit must be a value other than NotApplicable\r\n - MinWage and MaxWage must be empty\r\n - FixedWage must be greater than or equal to the Apprenticeship minimum wage \r\n\r\n* When WageType is CustomWageRange\r\n - WageTypeReason must be empty\r\n - WageUnit must be a value other than NotApplicable\r\n - MinWage must be greater than or equal to the Apprenticeship minimum wage \r\n - MaxWage must be greater than MinWage\r\n - FixedWage must be empty\r\n\r\n* When WageType is NationalMinimumWage or ApprenticeshipMinimumWage\r\n - MinWage, MaxWage, FixedWage and WageTypeReason must be empty\r\n - WageUnit must be NotApplicable\r\n\r\n* When WageType is Unwaged, CompetitiveSalary or ToBeSpecified\r\n - FixedWage, MinWage and MaxWage must be empty\r\n - WageUnit must be NotApplicable\r\n\r\n* When TrainingType is Framework\r\n - TrainingCode should be in format ###-##-##\r\n\r\n* When TrainingType is Standard\r\n - TrainingCode should be a numeric value no greater than 9999\r\n\r\n* Text fields will take a maximum of 4,000 characters except for the following\r\n - Title = 100\r\n - ShortDescription = 350\r\n - ContactName = 100\r\n - ContactEmail = 100\r\n - AddressLine = 300\r\n - Town = 100\r\n - WageTypeReason = 240\r\n - WorkingWeek = 250\r\n\r\n* Additional rules\r\n - Title must include the word ***apprentice***\r\n - HoursPerWeek must be between 16 and 48 inclusive\r\n - ExpectedDuration must be a minimum of 1 year, 12 months or 52 weeks depending on the value of DurationType selected\r\n - NumberOfPositions must not exceed 5,000\r\n\r\n#### Error codes ####\r\n\r\nThe following error codes may be returned when calling this operation if any of the vacancy values \r\nspecified fail validation:\r\n\r\n| Error code | Explanation |\r\n| ----------- | ------------------------------------------- |\r\n| 31000 | Invalid Request body |\r\n| 31001 | Invalid Title |\r\n| 31002 | Invalid Short description |\r\n| 31003 | Invalid Long description |\r\n| 31004 | Invalid Application closing date |\r\n| 31005 | Invalid Expected start date |\r\n| 31006 | Invalid Working week |\r\n| 31007 | Invalid Hours per week |\r\n| 31008 | Invalid Wage type |\r\n| 31009 | Invalid Wage type reason |\r\n| 31010 | Invalid Wage unit |\r\n| 31011 | Invalid Fixed wage |\r\n| 31012 | Invalid Min wage |\r\n| 31013 | Invalid Max wage |\r\n| 31014 | Invalid Expected duration |\r\n| 31015 | Invalid Duration type |\r\n| 31016 | Invalid Location type |\r\n| 31017 | Invalid Location Address line 1 |\r\n| 31018 | Invalid Location Address line 2 |\r\n| 31019 | Invalid Location Address line 3 |\r\n| 31020 | Invalid Location Address line 4 |\r\n| 31021 | Invalid Location Address line 5 |\r\n| 31022 | Invalid Location Town |\r\n| 31023 | Invalid Location Postcode |\r\n| 31024 | Invalid Number of positions |\r\n| 31025 | Invalid Provider's Ukprn |\r\n| 31026 | Invalid Employer's Edsurn |\r\n| 31027 | Invalid Provider site's Edsurn |\r\n| 31028 | Invalid Contact Name |\r\n| 31029 | Invalid Contact Email |\r\n| 31030 | Invalid Contact Number |\r\n| 31031 | Invalid Training Type |\r\n| 31032 | Invalid Training Code |\r\n| 31033 | Invalid Desired skills |\r\n| 31034 | Invalid Desired personal qualities |\r\n| 31035 | Invalid Desired qualifications |\r\n| 31036 | Invalid Future prospects |\r\n| 31037 | Invalid Things to consider |\r\n| 31038 | Invalid Training to be provided |\r\n| 31039 | Invalid Application method |\r\n| 31040 | Invalid Supplementary question 1 |\r\n| 31041 | Invalid Supplementary question 2 |\r\n| 31042 | Invalid External application url |\r\n| 31043 | Invalid External Application Instructions |\r\n| 31044 | Invalid Is Employer Disability Confident |\r\n| 31045 | Invalid Location Additional Information |\r\n| 31046 | Invalid Employer Description |\r\n| 31047 | Invalid Employer Website Url |",
"operationId": "CreateApprenticeshipVacancy",
"summary": "CreateApprenticeshipVacancy",
"tags": [
"Apprenticeships"
],
"parameters": [
{
"name": "createApprenticeshipParameters",
"in": "body",
"schema": {
"$ref": "#/definitions/CreateApprenticeshipParameters"
}
}
],
"consumes": [
"application/json",
"text/json",
"application/xml",
"text/xml",
"application/x-www-form-urlencoded"
],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CreateApprenticeshipResponse"
}
},
"400": {
"description": "Failed request validation",
"schema": {
"$ref": "#/definitions/BadRequestContent"
}
},
"401": {
"description": "Invalid provider ukprn",
"schema": {
"$ref": "#/definitions/StringContent"
}
}
}
}
}
},
"definitions": {
"CreateApprenticeshipParameters": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"shortDescription": {
"type": "string"
},
"longDescription": {
"type": "string"
},
"desiredSkills": {
"type": "string"
},
"desiredPersonalQualities": {
"type": "string"
},
"desiredQualifications": {
"type": "string"
},
"futureProspects": {
"type": "string"
},
"thingsToConsider": {
"type": "string"
},
"trainingToBeProvided": {
"type": "string"
},
"applicationMethod": {
"enum": [
"Online",
"Offline"
],
"type": "string"
},
"supplementaryQuestion1": {
"type": "string"
},
"supplementaryQuestion2": {
"type": "string"
},
"externalApplicationUrl": {
"type": "string"
},
"externalApplicationInstructions": {
"type": "string"
},
"expectedDuration": {
"format": "int32",
"type": "integer"
},
"durationType": {
"enum": [
"Weeks",
"Months",
"Years"
],
"type": "string"
},
"applicationClosingDate": {
"format": "date-time",
"type": "string"
},
"expectedStartDate": {
"format": "date-time",
"type": "string"
},
"workingWeek": {
"type": "string"
},
"hoursPerWeek": {
"format": "double",
"type": "number"
},
"wageType": {
"enum": [
"CustomWageFixed",
"CustomWageRange",
"NationalMinimumWage",
"ApprenticeshipMinimumWage",
"Unwaged",
"CompetitiveSalary",
"ToBeSpecified"
],
"type": "string"
},
"wageTypeReason": {
"type": "string"
},
"wageUnit": {
"enum": [
"NotApplicable",
"Weekly",
"Monthly",
"Annually"
],
"type": "string"
},
"minWage": {
"format": "double",
"type": "number"
},
"maxWage": {
"format": "double",
"type": "number"
},
"fixedWage": {
"format": "double",
"type": "number"
},
"locationType": {
"enum": [
"OtherLocation",
"EmployerLocation",
"Nationwide"
],
"type": "string"
},
"location": {
"$ref": "#/definitions/Location"
},
"numberOfPositions": {
"format": "int32",
"type": "integer"
},
"employerEdsUrn": {
"format": "int32",
"type": "integer"
},
"providerSiteEdsUrn": {
"format": "int32",
"type": "integer"
},
"contactName": {
"type": "string"
},
"contactEmail": {
"type": "string"
},
"contactNumber": {
"type": "string"
},
"trainingType": {
"enum": [
"Framework",
"Standard"
],
"type": "string"
},
"trainingCode": {
"type": "string"
},
"isEmployerDisabilityConfident": {
"type": "boolean"
},
"employerWebsiteUrl": {
"type": "string"
},
"employerDescription": {
"type": "string"
}
}
},
"Location": {
"type": "object",
"properties": {
"addressLine1": {
"type": "string"
},
"addressLine2": {
"type": "string"
},
"addressLine3": {
"type": "string"
},
"addressLine4": {
"type": "string"
},
"addressLine5": {
"type": "string"
},
"postcode": {
"type": "string"
},
"town": {
"type": "string"
},
"additionalInformation": {
"type": "string"
}
}
},
"CreateApprenticeshipResponse": {
"type": "object",
"properties": {
"vacancyReferenceNumber": {
"format": "int32",
"type": "integer"
}
}
},
"BadRequestContent": {
"type": "object",
"properties": {
"requestErrors": {
"type": "array",
"items": {
"$ref": "#/definitions/BadRequestError"
}
}
}
},
"BadRequestError": {
"type": "object",
"properties": {
"errorCode": {
"type": "string"
},
"errorMessage": {
"type": "string"
}
}
},
"StringContent": {
"type": "object",
"properties": {
"headers": {
"type": "array",
"items": {
"$ref": "#/definitions/KeyValuePair[String,IEnumerable[String]]"
},
"readOnly": true
}
}
},
"KeyValuePair[String,IEnumerable[String]]": {
"type": "object",
"properties": {
"key": {
"type": "string",
"readOnly": true
},
"value": {
"type": "array",
"items": {
"type": "string"
},
"readOnly": true
}
}
}
},
"tags": []
}
4) Press Save.

Then get the error "Error encountered while saving External Registration. Please try again later."
The Error I Get
Any help will be much-appreciated thankyou.
As the title says "When using dates on a process the date value is always off by -1"
Same happens when a date is imported.
Is it something to do with time zones. I'm using GMT zone.
Why is this, and how do I fix it?

Thanks Dan
How do I give my radio buttons a value that has already been detarmined in a picklist?
User-added image
Example if I choose "Male" in my picklist I would like the "Male" radio button to be selected on my VF page.


Also,
<div class="slds-size_2-of-8">
                                <div class="slds-box slds-box_x-small slds-text-align_center slds-m-around_x-small">
                                    <div class="slds-form-element__control">
                                        <label class="slds-form-element__label" for="form-element-02">
                                            <b>
                                                Are You British Citizen?:-
                                            </b>
                                        </label>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-3" value="radio-" name="YesNo" />
                                            <label class="slds-radio__label" for="radio-3">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Yes
                                                </span>
                                            </label>
                                        </span>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-4" value="radio-4" name="YesNo" />
                                            <label class="slds-radio__label" for="radio-4">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    No
                                                </span>
                                            </label>
                                        </span>
                                    </div>
                                    {! Apprentice__c.British_Citizen__c}
                                </div>
                            </div>

how do I use a checkbox with a value of TRUE & FALSE and convert it into a radio button saying yes and no?
User-added image
 
<div class="slds-size_2-of-8">
                                <div class="slds-box slds-box_x-small slds-text-align_center slds-m-around_x-small">
                                    <div class="slds-form-element__control">
                                        <label class="slds-form-element__label" for="form-element-01">
                                            <b>
                                                Gender
                                            </b>
                                        </label>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-1" value="{! Apprentice__c.Gender__c}" name="MaleFemale"/>
                                            <label class="slds-radio__label" for="radio-1">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Male
                                                </span>
                                            </label>
                                        </span>
                                        <span class="slds-radio">
                                            <input type="radio" id="radio-2" value="{! Apprentice__c.Gender__c}" name="MaleFemale" />
                                            <label class="slds-radio__label" for="radio-2">
                                                <span class="slds-radio_faux">
                                                </span>
                                                <span class="slds-form-element__label">
                                                    Female
                                                </span>
                                            </label>
                                        </span>
                                    </div>
                                </div>
                            </div>

Thanks Dan
Im wondering how I go about using the SLDS components, I cant for the life of me figure it out and non of the online guides are helping me out. For example the combo box and picklist require <aura:component> but I have no clue how to use them or refrence them. 

This is the page:-
User-added image
The Visual Force Code is in the comments:-

Here is what im trying to do:-
https://developer.salesforce.com/docs/component-library/bundle/lightning:combobox/example
https://www.lightningdesignsystem.com/components/combobox/#site-main-content

But it I cant get it working.

Any help or explanation on how its done will be much appreciated thanks.
How do I use VisualForce Component, Im struggling to wrap my head arond them. How are they called and refrenced and what Must I do to impliment a Save and Cancel function to my page?
<div class="slds-col slds-no-flex slds-grid slds-align-top">
                    <div class="slds-button-group" role="SPC">
                        <button class="slds-button slds-button_neutral">
                        	Save
                        </button>
                        <button class="slds-button slds-button_neutral" onclick="window.print();" >
                            Print
                         </button>
                        <button class="slds-button slds-button_neutral" >
                        	Cancel
                        </button>
                    </div>
                </div>
I expected It to be somthing like this -
<div class="slds-col slds-no-flex slds-grid slds-align-top">
                    <div class="slds-button-group" role="SPC">
                        <button class="slds-button slds-button_neutral" action="{!save}" >
                        	Save
                        </button>
                        <button class="slds-button slds-button_neutral" onclick="window.print();" >
                            Print
                         </button>
                        <button class="slds-button slds-button_neutral" >
                        	Cancel
                        </button>
                    </div>
                </div>

But I get this Error
Unknown property 'Apprentice__cStandardController.save'
Im using a Standard Controller so I have no clue why this error is appearing.
 
<apex:page standardController="Apprentice__c" title="Learning Agreement" showHeader="false" standardStylesheets="false" sidebar="false">
<head>
    <title>Apprentice Learning Agreement Form</title>
    <apex:slds />
</head>
<body>
    <div class="slds-scope">
        <div class="slds-page-header">
            <div class="slds-grid">   
                <div class="slds-col slds-has-flexi-truncate">
                    <div class="slds-media slds-no-space slds-grow">
                        <div class="slds-media__body">
                            <h1 class="slds-page-header__title slds-m-right_small slds-align-middle slds-truncate" title="Apprentice Learning Agreement">Apprentice Learning Agreement</h1>
                        </div>
                    </div>
                </div>     
<!-- PAGE HEADER / ROW 1 / COLUMN 2 -->
                <div class="slds-col slds-no-flex slds-grid slds-align-top">
                    <div class="slds-button-group" role="SPC">
                        <button class="slds-button slds-button_neutral" action="{!save}" >
                        	Save
                        </button>
                        <button class="slds-button slds-button_neutral" onclick="window.print();" >
                            Print
                         </button>
                        <button class="slds-button slds-button_neutral" >
                        	Cancel
                        </button>
                    </div>
                </div>


 
Ive made a print function that I would like to use to print out my learning agreement form with all the data included but when I press print It says "Page a021r00000hWJOKAA4".

This is my page that the print buton is on -

User-added image
This is what shows up:-
User-added image
Here is my Print function in an Apex Extention :-
public class PrintableView
{
   public final Apprentice__c App;
   public PrintableView(ApexPages.StandardController stdController) {
        this.App = (Apprentice__c)stdController.getRecord();
    }  
  public Apprentice__c ApprenticeObj{get;set;}
  public Programme_Area__c ProgramArea {get;set;}
  public Boolean bolPrintableView {get;set;}
           
    public void init() {
   String strPrintableView = ApexPages.currentPage().getParameters().get('print');
   bolPrintableView = (strPrintableView == '1');
        Programme_Area__c ProgramArea = new Programme_Area__c();
        ProgramArea.PA_Code__c = '112';
        
  }
    public PrintableView(){
        ApprenticeObj = new Apprentice__c();
        ProgramArea = new Programme_Area__c();
        
    }
}



Here is my visual force page with the print function at the top -
<apex:page lightningStyleSheets="True" StandardController="Apprentice__c" extensions="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
    <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="{!$CurrentPage.parameters.id}/returl/?print=1" target="_blank">Printable View</a>
</apex:outputPanel>

<apex:outputPanel rendered="{!bolPrintableView}">
    <script>
        window.print()
    </script>
</apex:outputPanel>
     Apprenticeship: Learning Agreement <br />
                        This document forms a learning agreement between you and East Riding college. The College agrees to provide the resources necessary to achieve
                         your learning goals and you agree in turn to register for the appropriate qualification and to complete the programme of study which you <br /> have chosen. 
                         Please complete this document as fully as possible. Without your details, we cannot apply for the funding which allows 
                         us to run the course that you wish to study. Discuss any problems or uncertainties that you may have with staff and then finally sign and date the agreement.
         
        <apex:pageBlock >
         Learner ID :- <apex:inputField value="{! Apprentice__c.Learner_Reference_Number__c }"/>
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! Apprentice__c.Date_of_Birth__c}"/>
                <apex:inputField value="{! Apprentice__c.Surname__c}"/>
                <apex:inputField value="{! Apprentice__c.First_Name__c}"/>
                <apex:inputField value="{! Apprentice__c.Middle_Other_Names__c}"/>
                <apex:inputField value="{! Apprentice__c.Previous_Surname__c}"/>
                <apex:inputField value="{! Apprentice__c.Preferred__c}"/>
                <apex:inputField value="{! Apprentice__c.Gender__c}"/>
                <apex:inputField value="{! Apprentice__c.ULN__c}"/>
                <apex:inputField value="{! Apprentice__c.NI_Number__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
         
         <apex:pageBlock >
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! Apprentice__c.Address__c}"/>
               <apex:inputField value="{! Apprentice__c.Postcode__c}"/>
               <apex:inputField value="{! Apprentice__c.Mobile__c}"/>
               <apex:inputField value="{! Apprentice__c.Home_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Alternative_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Email__c}"/>
               <apex:inputField value="{! Apprentice__c.Emergency_Contact__c}"/>
               <apex:inputField value="{! Apprentice__c.Emergency_Contact_Phone__c}"/>
                <apex:inputField value="{! Apprentice__c.Emergency_Contact_Relationship__c}"/>
               <apex:inputField value="{! Apprentice__c.Parent_Guardian_Name__c}"/>
               <apex:inputField value="{! Apprentice__c.Parent_Guardian_Phone__c}"/>
               <H4>Reminder -</H4> If any of your details change during the year please inform the college. <br />
               <H4>Note -</H4> By providing your mobile no. you may recive SMS messages relevant to your course.
            </apex:pageBlockSection>
         </apex:pageBlock>
     <!--End of Personal Details Section-->
        
     <!--Country Of Residence-->
       <apex:pageBlock title="Country Of Residence">
            <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Nationality__c}"/>
                <apex:inputField value="{! Apprentice__c.British_Citizen__c}"/>
                <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Lived_In_England_Or_EEA_for_3_Years__c}"/>
                
                <apex:inputField value="{! Apprentice__c.If_no_date_of_entry_to_UK_or_EU__c}"/>
                <H5>*If you have answered NO to the question above please complete the following details and state date of entry into the UK or EU:</H5>
                </apex:pageBlockSection>
                
                <H5>*Please tick the relevant box if your passport indicates that your current status is any of the following:</H5>
                <apex:inputField value="{! Apprentice__c.Passport_Status__c}"/>
                
                <H5>Non-UK residents will be required to produce evidence of their current status (Passport or other official documentation e.g. visa details)</H5>
                
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Country Of Residence-->
        
        <!--End of Ethnic Origin-->
        
        <apex:pageBlock title="Ethnic Origin">
            <apex:pageBlockSection >
                <apex:inputField value="{! Apprentice__c.Ethnicity__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
      <!--End of Ethnic Origin-->
        
      <!--Personal Needs-->
        <apex:pageBlock title="Personal Needs">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Recorded_Disabilities__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Difficulties__c}"/>
                <apex:inputField value="{! Apprentice__c.Other_Disabilities__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Personal Needs-->
      
      <!--Prior Attainment-->
        <apex:pageBlock title="Prior Attainment">
            <apex:pageBlockSection columns="2" >
                <H5>Please select the level that corresponds with your highest qualification before coming to the College. </H5>
                <apex:inputField value="{! Apprentice__c.Highest_Previous_Attainment__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Prior Attainment-->
      
      <!--Employment Information-->
        <apex:pageBlock title="Employment Information">
            <apex:pageBlockSection columns="4" >
                <H4>I am a New STARTER with this employer and have been recruited specifically to fill a new Apprenticeship vacancy.</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_New_Starter__c}"/>
                <H4>My full-time contract started on</H4>
                <apex:inputField value="{! Apprentice__c.New_Start_Contract_Date__c}"/>
                <H4>I am an EXISTING EMPLOYEE that is moving up from part-time hours to fill a new Apprenticeship vacancy </H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_from_P_Time__c}"/>
                <H4>My full-time contract started on</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_New_Contract_Start__c}"/>
                <H4>I am an EXISTING EMPLOYEE that is changing job role to fill a new Apprenticeship Vacancy.</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_from_Changing__c}"/>
                <H4>My full-time contract for the new job role started on</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_New_Job_Start__c}"/>
                <H4>I am an EXISTING EMPLOYEE full-time that is continuing with my current job role but require significant new knowledge and skills</H4>
                <apex:inputField value="{! Apprentice__c.Employer_Status_Existing_Development__c}"/>
                <H4>My approximate start date with this company was</H4>
                <apex:inputField value="{! Apprentice__c.Existing_Staff_Company_Start__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--Employment Information-->
      
      <!--Employment Status on the day ... -->
        <apex:pageBlock title="Employment Status on the day before you started your Apprenticeship">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Pre_Apprenticeship_Employed_Hours__c}"/>
                <apex:inputField value="{! Apprentice__c.Seeking_Not_Seeking_Work__c}"/>
                <apex:inputField value="{! Apprentice__c.Previous_Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Not_employed_status_benefits__c}"/>
                <apex:inputField value="{! Apprentice__c.Period_Not_Employed__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Employment Status on the day ... -->
      
      <!--At the start of my ... -->
        <apex:pageBlock title="At the start of my apprenticeship I will be Employed by">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Employer_name__c}"/>
                <apex:inputField value="{! Apprentice__c.Employer_Address__c}"/> <!--Set As Address-->
                <apex:inputField value="{! Apprentice__c.Postcode__c}"/>
                <apex:inputField value="{! Apprentice__c.Hours_Worked_Per_Week__c}"/>
                <apex:inputField value="{! Apprentice__c.ERN__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of At the start of my ... -->
      
      <!--Enrolment Details 
        <apex:pageBlock title="Enrolment Details">
            <apex:pageBlockSection columns="2" >
         
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Enrolment Details -->
      
       <!--Privacy Notice-->
        
        <apex:pageBlock title="PRIVACY NOTICE 2017/18">
            <apex:pageBlockSection columns="1" >
                
<h4>How We Use Your Personal Information</h4> 
This privacy notice is issued by the Education and Skills Funding Agency (ESFA), on behalf of the Secretary of State for the Department of Education (DfE). <br /> It is to inform learners how their personal information will be used by the DfE, the ESFA (an executive agency of the DfE) and any successor bodies to these organisations. <br /> For the purposes of relevant data protection legislation, the DfE is the data controller for personal data processed by the ESFA. <br /><br />
 
Your personal information is used by the DfE to exercise its functions and to meet its statutory responsibilities, including under the Apprenticeships, Skills, Children and Learning Act 2009 and to create and maintain a unique learner number (ULN) and a personal learning record (PLR). Your information will be securely destroyed after it is no longer required for these purposes. <br /><br />
 
Your information may be shared with third parties for education, training, employment and well-being related purposes, including for research. <br /> This will only take place where the law allows it and the sharing is in compliance with data protection legislation. <br /> The English European Social Fund (ESF) Managing Authority (or agents acting on its behalf) may contact you in order for them to carry out research and evaluation to inform the effectiveness of training. <br /><br />
 
You can agree to be contacted for other purposes by ticking any of the following boxes:
  
Further information about use of and access to your personal data, details of organisations with whom we regularly share data, information about how long we retain your data, and how to change your consent to being contacted, please visit:  https://goo.gl/0rwQMT
 
Any changes to the privacy notice will be published on Moodle (for current students) and the website (for applicants) as soon as they become available.  Please check for updates. 
  
<h4>Learning Records Service Privacy Notice</h4>

The information you supply will be used by the Education and Skills Funding Agency, an executive agency of the Department of Education (DfE), to issue you with a Unique Learner Number (ULN), and to create your Personal Learning Record. For more information about how your information is processed and shared refer to the Extended Privacy Notice available at: https://goo.gl/iOxSgJ 
 

<h4>DISCLAIMER</h4>

Before accepting any place offered on a course, prospective students should be aware that the provision of an education service is subject to written terms and conditions of  contract. Such conditions include limiting the Colleges liability should industrial action or other circumstances prevent or interfere with the provision of services or cause the College to alter or rearrange any of the educational service offered. The College also reserves the right to withdraw any advertised class for which insufficient numbers of full fee paying students enrol and to close any class if low numbers attending make it no longer viable. 
 
The enrolment of a learner with a criminal record, caution or reprimand will depend upon the nature of the course and the details of any conviction or 
caution. If you are convicted of a criminal offence, after you have enrolled, you let us know immediately. If you are not sure whether to tell us about a previous conviction you can get more advice from Learner Services.
 
The College is bound by relevant data protection legislation and your data and image will be stored in accordance with these regulations. 
 

<h4>LEARNING AGREEMENT DECLARATIONS - My signature below indicates that:</h4>
- I confirm that all the information on this form is correct and that I have declared all of my current qualifications. I understand that if I have declared false information the College may take action against me to reclaim the tuition fees and any support costs incurred.
- I intend to follow the programme of study as specified by the qualifications listed. I have discussed the programme with relevant staff and understand the entry requirements and progression routes offered by the course, its suitability to my needs, the workload required of me and any financial or 
       learning support which may be available during my studies.
- I agree to be responsible for the payment of tuition, registration and examination fees (as applicable) by the due date and any additional costs should I make a late entry.  I accept liability for any examination or registration fees should I fail to attend or complete my programme.  
- I will comply with all College Rules and Regulations and any other regulations specific to my chosen programme.
- All Apprentice Learners: I am aware that in addition to the main qualification detailed on this form, my Apprenticeship Programme will incorporate other elements which may include Maths and/or English skills development; and other Qualifications and non-Qualification activities. These will be agreed and recorded in my learning plan. <h5> I understand that I will be required to attend all sessions. </h5>
<h5> I am aware of the College’s fees and charges policy (available on the website or on reception). </h5>
 


            </apex:pageBlockSection>
        </apex:pageBlock>
        
        <!--End of Privacy Notice-->
        
      <!--Save/Cancel-->
        <apex:pageBlock >
        
        
        </apex:pageBlock> 
        
      <!--End of Save/Cancel-->
       
       
    <!--End of Table-->     

    </apex:form>
</apex:page>
From my understanding this is what pulls up the page with the data in <a href="{!$CurrentPage.parameters.id}/returl/?print=1" target="_blank">Printable View</a> but it wont show me a page?

Thanks for any and all help. An explanation as to what I must do would be much appreciated.

Thanks Dan
 
Im always having problems with the "Programme Area" object. It never seems to want to test and Its always at this point I get stuck.
User-added imageUser-added imageUser-added image
Can somone help me with what im missing and tell me how you knew what I needed and where I needed it thankyou.
If it helps the "Programme Area" is a master Detail.

Thanks Dan
Hi, I've had the problem again, where i get no coverage could somone explain what I should do to determine where and what I needed to add to my test class?

User-added imageThanks Dan
Finally got all the testing done for my Apex controller and got the print layout functioning as I wanted but a huge problem I have encounterd now is that my Visual Force Page isnt showing any data. What must I add to my Visualforce/Apex to show the values that I have in the fields.
User-added image
Ive had this problem before but couldnt figure it out. Here is some information It should be displaying.
User-added image

Here is my apex Class:-
public class PrintableView{   
public Apprentice__c ApprenticeObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public Boolean bolPrintableView {get;set;}
       
    public void init() {
   String strPrintableView = ApexPages.currentPage().getParameters().get('print');
   bolPrintableView = (strPrintableView == '1');
  }
  
public PageReference save(){
if(ApprenticeObj != null){
} 
return null;
}
}
Visual Force componet used to make the print function:-
<apex:component controller="PrintableView" allowDML="true">
    public PrintableView(){ 
    ApprenticeObj = new Apprentice__c();
    ProgramArea = new Programme_Area__c ();
    ProgramArea.PA_Code__c = 'P12';
    insert ProgramArea;
    }
</apex:component>
And a small Snippet of the Visualforce Page
<apex:page lightningStyleSheets="True" Controller="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
    <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="/apex/Apprentice?print=1" target="_blank">Printable View</a>
</apex:outputPanel>

<apex:outputPanel rendered="{!bolPrintableView}">
    <script>
        window.print()
    </script>
</apex:outputPanel>

<apex:pageBlock >
         Learner ID :- <apex:inputField value="{! ApprenticeObj.Learner_Reference_Number__c }"/>
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! ApprenticeObj.Date_of_Birth__c}"/>
                <apex:inputField value="{! ApprenticeObj.Surname__c}"/>
                <apex:inputField value="{! ApprenticeObj.First_Name__c}"/>
                <apex:inputField value="{! ApprenticeObj.Middle_Other_Names__c}"/>
                <apex:inputField value="{! ApprenticeObj.Previous_Surname__c}"/>
                <apex:inputField value="{! ApprenticeObj.Preferred__c}"/>
                <apex:inputField value="{! ApprenticeObj.Gender__c}"/>
                <apex:inputField value="{! ApprenticeObj.ULN__c}"/>
                <apex:inputField value="{! ApprenticeObj.NI_Number__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>

Thankyou for all and any help!

 
I keep getting this error when I preview my Visual force page.
User-added image
Here is my custom Apex controller:-
public class PrintableView{   
public Apprentice__c ApprenticeObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public Boolean bolPrintableView {get;set;}
        
public PrintableView(){ 
    ApprenticeObj = new Apprentice__c();
    ProgramArea = new Programme_Area__c ();
    ProgramArea.PA_Code__c = 'P12';
    insert ProgramArea;
    }
    public void init() {
 	String strPrintableView = ApexPages.currentPage().getParameters().get('print');
 	bolPrintableView = (strPrintableView == '1');
	}
	
public PageReference save(){
if(ApprenticeObj != null){
	ApprenticeObj.Programme_Area__c = ProgramArea.Id;
	ApprenticeObj.Date_of_Birth__c = date.parse('12/08/2000');
  upsert ApprenticeObj;
} 
return null;
}
}
Here is the top of my Visual force page:-
<apex:page lightningStyleSheets="True" Controller="PrintableView" title="Learning Agreement" showHeader="{!bolPrintableView}" sidebar="{!bolPrintableView}" action="{!init}">
    <apex:form >
        <apex:outputPanel rendered="{!NOT(bolPrintableView)}">
    <a href="/apex/Apprentice?print=1" target="_blank">Printable View</a>
</apex:outputPanel>

<apex:outputPanel rendered="{!bolPrintableView}">
    <script>
        window.print()
    </script>
</apex:outputPanel>

Any help is appreciated, hopefully I wont have to adjust apex because its a nighmare for me to test.

Thankyou Dan
 
Hi,
I am getting the below error when trying to login to trailhead

This page isn’t working
trailhead.salesforce.com is currently unable to handle this request.
HTTP ERROR 500
I am receiving the green tick but gaining 0% cover what must I include to begin gauging the code coverage?

Controller -
User-added image
Test Class-

User-added image

Thankyou Dan
How do I go about sorting this error so I can go live?

User-added image
Unknown constructor 'myController.myController(ApexPages.StandardController controller)'

Apex page-
<apex:page lightningStyleSheets="true" StandardController="Apprentice__c" extensions="myController" title="Apprentice Documentation">
My custom controller/Extension :-
public class myController{
public Apprentice__c ApprenticeObj{get;set;}
public Apprenticeship_Component__c ComponentsObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public Apprenticeship_Qual__c Qual {get;set;}  
ApexPages.StandardController sc;
public myController(ApexPages.StandardController sc){ 
    this.sc = sc; 
    ApprenticeObj = new Apprentice__c(); 
    ComponentsObj = new Apprenticeship_Component__c(); 
    ProgramArea = new Programme_Area__c ();
    Qual = new Apprenticeship_Qual__c ();
}

Thanks Dan
 
Basically Im getting problem after problem, I had to make an Apex class to use as a coustom contoller which all worked well and then I proceeded to "try" and put it on live where I was stopped dead in my tracks because of code coverage after struggling for ages then finally getting an answer on the form I was able to achive 77% coverage. I went to upload to live again and then I got the error :-The error
After applying a work around my code coverage has dropped to 70% and im really struggling to get the coverage back upto the 75% threshold to even begin testing if the work around does the job. The testing still compleatly confuses me and Im an absolute begginer so I dont know how to format or develop in Apex too well as of yet. Was just hoping if somone can point me in the right direction for gaining the 75% required.

This is my 70% that is covered:-
User-added image  
Here is my Testing Class:-
 User-added image

Thankyou,
Sorry if its super simple and I cant process it.