• Shubham Nandwana
  • NEWBIE
  • 448 Points
  • Member since 2017
  • AppPerfect Corp.

  • Chatter
    Feed
  • 12
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 9
    Questions
  • 84
    Replies
Hi,
I was wondering what exactly is the difference between roles and profiles?
Thanks in advance.

Harshit
Hi,

Could anyone help me on how to capture errors after using Database DML methods in Salesforce instead of using try/catch methods?

Thanks
Vishvesh.
Hi all,

I want to allow modification of a record only by specific user using SOQL query. Can this be done? 

Thanks
Mayank.
Hi all ,
 
I am confused with when exactly do we use an indirect lookup, a lookup and an external lookup relationship. Why cant we use just a lookup relationship for every case.

Thanks
Mayank. 
Consider the case:
public with sharing class containerClass {
     ...
 public class innerClass {
     ...
 }
}
I know that the innerClass does not inherit the sharing setting of the containerClass and [without sharing] is the default for the inner class. Then what is the use of specifying with sharing in the container class.                                        
Hi all,

I have a quick question, I am not able to understand when exactly do we use 'insert()' and 'database.insert()'... both seem to do the work of insertion in the database. 

Thanks
Mayank.
 

Hi,

I am facing problem in understanding merge fields with custom relationships. Could I get some examples using custom relationship(to access parent from child) along with standard objects to get a better understanding? 

Thanks in advance!!

Hi all,

I am working on an assignment where i have multiple profiles for different users.I want a particular user to see only a subset of the picklist values.Can anyone help me achieve this.It would be of great help.

Thanks.
Hi all,
I am not able to understand that in what cases do we create a workflow rule, a roll up summary ,a trigger or a formula field , its really confusing .I looked this up on internet as well but its not clear. Can anyone help me with this.

Thanks.
What are the most commonly used objects in salesforce about which I should know for completing the Platform Developer I certification exam? How are they related to each other?
Hi all , 
I am new to salesforce and aim to be a certified developer , can anyone please give me some suggestions and tips on how to prepare for salesforce platform developer 1 exam.
Thanks

Hi. Working through the Visualforce Mobile module, and im haivng throuble with the 3rd unit. 

Im getting this issue:
"Challenge Not yet complete... here's what's wrong: 
The 'MobileContactList' Visualforce page does not appear be displaying the contact name or contact phone."


The code I am using is:

<apex:page showHeader="true" sidebar="true" standardController="Contact" recordSetVar="contacts">
	<head>
	<apex:slds />
	</head>


	<apex:repeat value="{!contacts}" var="c">
		<dl class="slds-list_horizontal slds-wrap">
			<dt class="slds-item_label slds-text-color_weak slds-truncate" title="Contact Name:">{!c.Name}</dt>
			<dd class="slds-item_detail slds-truncate" title="Mobile Phone Number:">{!c.MobilePhone}</dd>
		</dl>
	</apex:repeat>

</apex:page>
Which then displays this;

User-added image
Which looks like it works, as long as the Contacts list view is set to view all (otherwise nothing displays).

Is this just another case of the trailhead looking for a very specific solution? I can't seem to find much help on this one.

Thanks
Hi,
a. I have a confusion, it's mentioned over https://help.salesforce.com/articleView?id=000193871&language=en_US&type=1 that salesforce record takes 2kb of storage space with some exceptions.
What if I use a rich text area field with 10kb of data in it, and that too for like 50 custom fields, how that will be accommodated in Salesforce?
Can someone please enlighten me on this 2kb record storage information?
b. And my another doubt is if I use Account/Contact object it has a number of fields which I am not using or putting my data into, so will storage space be counted for them or not?
Any help or links are appreciated.
Regards
Shubham

Hi,
I am trying to integrate salesforce with unity for data transfer and not creating a game, hence i think there is no point in buying PlayMaker.
I treied installing salesforce VR but it resulted in an error saying 'PlayMaker assembly is missing'.

Please suggest me a way to integrate both.

Any help is appreciated.
Regards,
Shubham

Hi,
I have a custom object having multi-select picklist which contains the name of all the contacts. I want to write a trigger on contact which updates values in picklist whenever a new contact is added. 
Can anyone help me provide the code for that? Any help is appreciated.

Shubham Nandwana.
 
Hi,
I am trying to use square checkout API as a payment gateway for my force.com site. I want my user to click on a button which will redirect him to the square payment form, take his details and process his payment and return to my site page with success or failure status.
Referring to https://docs.connect.squareup.com/payments/checkout/setup I installed composer, square SDK setup but I am not able to use them for my site. How should I redirect the user to PHP payment form? 
Guide with any information you have or tell me if I am doing anything wrong.
 
Hi,
I have created a lightning component which is working in a visualforce page, when i click on preview button it open with lightning component functionalities, but as soon as i add that visualforce page to my site (force.com site), it shows a blank page.
Does someone know what needs to be done or something else is to be configured?
I referred to below link to create a lightning component with visualforce page.
https://www.jitendrazaa.com/blog/salesforce/use-lightning-component-in-visualforce-page/
Any little help is appreciated.
Regards,
Shubham Nandwana
 
Hi,
I am trying to override the 'New Event' button in lightning salesforce. I have created a visualforce page and custom controller for that and also included standard object 'Event' and extension 'mycutsomController' but it still shows the default layout page on click of 'New Event' button in calendar page.
Button override works in classic but not in lightning.
Hope to get the solution ASAP.
Including some screenshots please check.

User-added image
User-added image
Regards,
Shubham Nandwana
Hello,
While solving challenge 8 I am getting an error:- 
Challenge Not yet complete... here's what's wrong: 
Ensure that orderTrigger and orderHelper are still working as specified in the earlier challenge.
Please let me know what I am doing wrong else paste the correct code here.
My code goes as follows-:

CLASS- OrderTests

@isTest
public class OrderTests {
    @testSetup 
    public static void SetupTestData() {     
            TestDataFactory.InsertTestData(3);      
    }
    
   @isTest
    public static void OrderUpdate_UnitTest (){
        Test.startTest();
        
        List<Product2> originalProduct=[Select Quantity_Ordered__c from Product2 where Name like 'ProductConstruction%'];
        
        List<Order> ord=new List<Order>();
        List<Order> testOrders=[Select status from Order where status='Draft'];
        System.debug('originalPro '+originalProduct);
        System.debug('Ordertest orders '+testOrders);
        
        for(Order o:testOrders){
            
            o.Status=Constants.ACTIVATED_ORDER_STATUS;
            ord.add(o);
        }
        System.debug('OrderTests 21 '+ord);
        update ord;
        List<Product2> updatedProduct=OrderHelper.pr; 
        //System.debug(updatedProduct.get(0)+' '+originalProduct.get(0));
           TestDataFactory.VerifyQuantityOrdered(originalProduct.get(0), updatedProduct.get(0), (Integer)OrderHelper.temp.get(0)); 
        Test.stopTest();
    }
    @isTest
    public static void OrderExtension_UnitTest (){
        Test.startTest();
        
        Account ac=new Account();
        ac.Name='Test1';
        insert ac;
        
        Contract ct=new Contract();
        ct.AccountId=ac.Id;
        ct.StartDate =date.today();
        ct.Status='Draft';
        ct.ContractTerm=4; 
        insert ct;
        
        Order obj=new Order();
        obj.AccountId=ac.Id;
        obj.EffectiveDate=date.today();
        obj.ContractId=ct.Id;
        obj.Status='Draft';
        obj.Name='OrderName';
       
        insert obj;
        
        ApexPages.StandardController sc = new ApexPages.StandardController(obj);
        
        OrderExtension cc=new OrderExtension(sc);
        cc.SelectFamily();
        cc.OnFieldChange();
        cc.Save();
        cc.First();
        cc.Next();
        cc.Previous();
        cc.Last();
        cc.GetHasPrevious();
        cc.GetHasNext();
        cc.GetTotalPages();
        cc.GetFamilyOptions();
        Test.stopTest();
    }
}

CLASS- prouct2Tests
@isTest (seeAllData=true)
private class Product2Tests {

    /**
     * @name product2Extension_UnitTest
     * @description UnitTest for product2Extension
    **/ 
    static TestMethod void Product2Extension_UnitTest(){
        Test.startTest();
           PageReference pageRef = Page.Product2New;
           Test.setCurrentPage(pageRef);
          
        
        ApexPages.StandardController controller =new Apexpages.StandardController(new Product2());
            Product2Extension ext = new Product2Extension(controller);
            ext.addRows();
            ext.save();
            System.assertEquals(Product2Extension.productsToInsert.size(), Constants.DEFAULT_ROWS);
        
         
         //if(addValue.equals('Add'))
                  //System.assertEquals(Product2Extension.productsToInsert.size(), 2*Constants.DEFAULT_ROWS);
        
        Integer i=0;
        for(Product2Extension.ProductWrapper pr: Product2Extension.productsToInsert){
            if (String.isBlank(pr.productRecord.Name) || pr.productRecord.Name==null){
                pr.productRecord.Name='Product'+i;
            }
               
            if(String.isBlank(pr.productRecord.Family) ||  pr.productRecord.Family==null ){
                pr.productRecord.Family='Side';
            }
                  
            if(pr.productRecord.IsActive==false){
                pr.productRecord.IsActive=true;
            }
            if(pr.productRecord.Initial_Inventory__c==null){
                pr.productRecord.Initial_Inventory__c=15;
            }
            i++;
                   
        }
        PageReference p=ext.save();
        List<Product2> queryResults=[Select Name,IsActive,Initial_Inventory__c from Product2 where Initial_Inventory__c=15 and IsActive= true and Family='Side'];
                Test.stopTest();
        System.assertEquals(queryResults.size(), 5);
        System.debug(Product2Extension.productsToInsert.size());       

    }
    static void Product2Trigger_UnitTest(){
        Test.startTest();
        
        Product2 p=new Product2();
        p.Name='TestProduct';
        p.Family='Side';
        p.IsActive=true;
        p.Quantity_Ordered__c =100;
        p.Initial_Inventory__c =10;
        insert p;
        
        p.Quantity_Ordered__c=200;
        update p;
            
        Test.stopTest();
    }

}

CLASS - OrderHelper
public without sharing class OrderHelper {

    /**
     * @name AfterUpdate
     * @description 
     * @param List<Order> newList
     * @param List<Order> oldList
     * @return void
    **/
    public static List<Product2> pr=new List<Product2>();
    public static List<Decimal> temp;
    public static void AfterUpdate(List<Order> newList, List<Order> oldList){
        Set<Id> orderIds = new Set<Id>();
        for ( Integer i=0; i<newList.size(); i++ ){
            if ( newList[i].Status == Constants.ACTIVATED_ORDER_STATUS && oldList[i].Status == Constants.DRAFT_ORDER_STATUS ){
                orderIds.add(newList[i].Id);
            }
        }
        System.debug('New Order '+newList);
        System.debug('Old Order '+oldList);
        System.debug('OrderIDS '+orderIds);
        OrderHelper.RollUpOrderItems(orderIds);
    }

    /**
     * @name RollUpOrderItems
     * @description Given a set of Activated Order ids, query the child Order Items and related Products to calculate Inventory levels
     * @param Set<Id> activatedOrderIds
     * @return void
    **/
    public static void RollUpOrderItems(Set<Id> activatedOrderIds){
        List<OrderItem> oi=[Select Id, Product2Id ,AvailableQuantity from OrderItem where OrderId IN:activatedOrderIds];
        Map<Id,Product2> productMap=new Map<Id,Product2>();
        //ToDo: Declare a Map named "productMap" of Ids to Product2 records

        //ToDo: Loop through a query of OrderItems related to the activatedOrderIds
        for(OrderItem ord:oi){
            Product2 p=[Select Id,Name, Quantity_Ordered__c , Quantity_Remaining__c from Product2 where Id=: ord.Product2Id ];
            productMap.put(ord.Product2Id, p);
         }
         
        
          AggregateResult[] groupedResults =[Select Product2Id,SUM(Quantity) from OrderItem where Product2Id IN : productMap.keySet() group by Product2Id];
        
        for(AggregateResult ag:groupedResults){
             Product2 p= productmap.get((Id)ag.get('Product2Id'));
               p.Quantity_Ordered__c =(Double)ag.get('expr0');
                temp.add(p.Quantity_Ordered__c);
               pr.add(p);
        }
        System.debug('orderHelper'+pr+' '+activatedOrderIds+' '+groupedResults);
        update pr;
            //ToDo: Populate the map with the Id of the related Product2 as the key and Product2 record as the value
            
        //ToDo: Loop through a query that aggregates the OrderItems related to the Products in the ProductMap keyset

        //ToDo: Perform an update on the records in the productMap
    }

}

Thanks in advance
Shubham Nandwana
Hello,
I am facing a problem with challenge 5 of the Superbadge. Error is:

Challenge Not yet complete... here's what's wrong: 
Ensure that you perform a query to verify the Save button works.

I have saved the 5 records by populating them and trying to work on the save button but unable to catch the error.
Below is my code of Product2Tests...Any help is appreciated.

@isTest (seeAllData=false)
private class Product2Tests {

    /**
     * @name product2Extension_UnitTest
     * @description UnitTest for product2Extension
    **/
    static TestMethod void Product2Extension_UnitTest(){
        Test.startTest();
           PageReference pageRef = Page.Product2New;
           Test.setCurrentPage(pageRef);
          
        
        ApexPages.StandardController controller =new Apexpages.StandardController(new Product2());
            Product2Extension ext = new Product2Extension(controller);
            ext.addRows();
            ext.save();
            System.assertEquals(Product2Extension.productsToInsert.size(), Constants.DEFAULT_ROWS);
        
         
         //if(addValue.equals('Add'))
                  //System.assertEquals(Product2Extension.productsToInsert.size(), 2*Constants.DEFAULT_ROWS);
        
        Integer i=0;
        for(Product2Extension.ProductWrapper pr: Product2Extension.productsToInsert){
            if (String.isBlank(pr.productRecord.Name) || pr.productRecord.Name==null){
                pr.productRecord.Name='Product'+i;
            }
               
            if(String.isBlank(pr.productRecord.Family) ||  pr.productRecord.Family==null ){
                pr.productRecord.Family='Side';
            }
                  
            if(pr.productRecord.IsActive==false){
                pr.productRecord.IsActive=true;
            }
            if(pr.productRecord.Initial_Inventory__c==null){
                pr.productRecord.Initial_Inventory__c=10;
            }
            i++;
                   
        }
        PageReference p=ext.save();
        
        System.assertEquals(Product2Extension.productsToInsert.size(), 5);
        System.debug(Product2Extension.productsToInsert.size());
        
        Test.stopTest();
    }

}
 

Hello,

I want to know if salesforce provides any mock tests(free or paid) to prepare for the developer I certification.

The test I could find online are mostly outdated or their syllabus differs from the original syllabus mentioned in SALESFORCE CERTIFIED PLATFORM DEVELOPER I.

Any help is appreciated.

Regards

Shubham Nandwana

id- shubhamnandwana18@gmail.com

Hi,
I am looking for scenario based interview questions for Salesforce. Mosty in google I am able to find theory question but what I observe in my recent 2-3 interviews instead of direct questions interviewers are focusing on situation and scenario based question. I am having 1.7 years of experience as salesforce developer, if anyone can suggest from where I do prepare for my interview what would be really helpful.

If anyone have certain set of questions,please send it over my email as well- harsha.suman9421@gmail.com 

Thanks in advance!!
Hello,

As I am trying to insert more than 10000 records by using batch apex,getting error too many DML.
As 
 there is goverener limit that we can not perform dml more than 10000 records but I am using Batch apex,in that it overecome the governer limit by separting into batches(batches having their own limits).but not able to perform how to achiev this,

Please help me in this:
Thank you.
here is  my code: 

global class insertRecordsUsingBatchApex implements database.Batchable<sObject>{
    
    global database.QueryLocator start(database.BatchableContext bc){
        return database.getQueryLocator('select id,name,myEmail__c from Account limit 2000 ');
    }
    
    global void execute(database.BatchableContext bc,list<Account> scope){
        for(Account cc:scope){
            for(integer i=0;i<=10001;i++){
                //10001 records insert
                Account a=new Account(name='testingforInsertRecords' +i,myEmail__C='bsdh@gmail.com' );
                scope.add(a);
            }
            insert scope;
            
        }
        
    }
    global void finish(database.BatchableContext bc){       
        
    }
}

database.execute(**,100);
https://ap4lc-dev-ed.my.salesforce.com/_ui/common/apex/debug/ApexCSIPage

While creating account record I want to set the status to Open by default and after creation, I want to change status to complete if linked contact records are 10 or greater than 10?
hi all , i am not able to write to cover code palease suppot me 
trigger soluation on gole__c(before insert,before update){
    set<string> SetAgentIds = new Set<string>();
    Map<string,string> MapSalesAgentsWithNpn = new Map<string,String>();
    for(gole__c sales:trigger.new){
            if(sales.Writing_Agent_ID__c!=null){
                SetAgentIds.add(sales.Writing_Agent_ID__c);
            }
    }
    if(SetAgentIds.size()>0){
        for(Agent__c SalsAgent:[select id,AWN__c,NPN__c  from Agent__c where AWN__c IN:SetAgentIds]){
                MapSalesAgentsWithNpn.put(SalsAgent.AWN__c,SalsAgent.NPN__c);
        
        }
    }
    
    for(gole__c sales:trigger.new){
      if(MapSalesAgentsWithNpn.containsKey(sales.Writing_Agent_ID__c)){
                  sales.Writing_Agent_NPN__c=MapSalesAgentsWithNpn.get(sales.Writing_Agent_ID__c);
      }
    }
    
 
}
  • October 30, 2018
  • Like
  • 0
Hi All,

Need one quick help. is there any way to fetch the AsyncApex limits from org. As we know that we are having 250000 AsyncApex jobs limits for every 24 hour. after increasing it by salesforce can we verify that limit has been increased from 2.5 Lcs to some other number.
sop can we fetched that limits details by any way?
Any response will be appriciated.

Thanks,
Chanchal
Error:Apex trigger TaskToCommunityTrigger caused an unexpected exception, contact your administrator: TaskToCommunityTrigger: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []: Class.TaskToCommunity.aftrupdate: line 27, column 1
=======================================================================
public class TaskToCommunity {

    public static void aftrupdate(Map<id,contact> oldmap,Map<id,Contact> newmap){

        list<Task> ta=new list<Task>();
        user u=[select id from user where alias='sree'];

        // profile p=[select id from profile where name='Partner Community User'];
        for(id key:oldmap.keyset()){
            Contact old=oldmap.get(key);
            Contact newmp=newmap.get(key);
            
            if(old.Phone!=newmp.Phone){
                Task t=new Task();
                t.OwnerId=u.id; 
               // t.OwnerId=p.id; 
                //t.OwnerId=userinfo.getUserId();
                t.Status='Pending';
                t.Priority='Normal';
                //t.WhatId=newmp.id;
                
                t.ActivityDate=system.today();
                t.Subject='Testing';
                ta.add(t);
            }
        }
        update ta;
    }
}
===============================================================================================
trigger TaskToCommunityTrigger on Contact (after update) {

    if(trigger.isafter && trigger.isupdate){
    TaskToCommunity.aftrupdate(Trigger.oldmap, Trigger.newmap);
}
}

 
Hi,
I am confused in what cases should we use apex:pageMessages, apex:pageMessage, apex:Message and apex:Messages? 

Thanks.
Harshit
Hi,

Is there a way to make an exact replica of an org (including data in the objects).

Thanks.
Prateek Singh.

Hi,
I want to create a tab for Standard object User. Can I do so, if yes then how to do so?

Thanks in advance.

Hi,
Despite so many measures taken by salesforce to safe keep our data, i would like to know if data loss is still possible in salesforce ?

Thanks 
Kriti khanna
Hi,
I have a custom object having multi-select picklist which contains the name of all the contacts. I want to write a trigger on contact which updates values in picklist whenever a new contact is added. 
Can anyone help me provide the code for that? Any help is appreciated.

Shubham Nandwana.
 
Hi all! Is it possible to create a field with multiple lookup(s) in a custom object page? 

In the custom object page, there are 3 pages (from a seperate custom object) that fall within the same field, however I would like to have them as individual look-up fields. If this is possible, how can I go about with this? 

Thanks!!
How do I use my extension "myController" to show information on my visual force page?
User-added image
Im wanting to pull the information up onto this screen which is my VisualForce page :-
User-added image
Here is the code for my VisualForce page:-
<apex:page lightningStyleSheets="true" StandardController="Apprentice__c" extensions="myController" title="Apprentice Documentation">
    <apex:form >
    <!--myController refers to the Apex class I created called myController.apxc this is so I can use two object types in one form in place of a Standard controller
        For refrence ApprenticeObj = new Apprentice__c and ComponentsObj = new Apprenticeship_Component__c-->
        
    <!--Style-->
        <style>
        body{
        font-family: Arial,Helvetica,sans-serif;
        color: #000000;
        Padding:25px;
        }
        </style>
    <!--End of Style-->
        
        <apex:pageBlock >
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! Apprentice__c.Name}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        
     <!--Apprentice Details Section-->
        <apex:pageBlock title="Apprentice Details">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! Apprentice__c.Apprentice_name__c}"/>
                <apex:inputField value="{! Apprentice__c.Curriculum_Verified__c}"/>
                <apex:inputField value="{! Apprentice__c.Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Programme_Area__c}"/>
                <apex:inputField value="{! Apprentice__c.Vacancy__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Start_Date__c}"/>
                <apex:inputField value="{! Apprentice__c.Levy_Status__c}"/>
                <apex:inputField value="{! Apprentice__c.Programme_Agreed_With_Employer__c}"/>
                <apex:inputField value="{! Apprentice__c.Existing_Employee__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        <!--End of Apprentice Details Section-->
        
        <!--Line Manager Details Section-->
         <apex:pageBlock title="Line Manager Details">
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! Apprentice__c.Line_Manager__c}"/>
               <apex:inputField value="{! Apprentice__c.Line_Manager_Phone__c}"/>
               <apex:inputField value="{! Apprentice__c.Line_Manager_Email__c}"/>
               <apex:inputField value="{! Apprentice__c.Line_Manager_Mobile__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
     <!--End ofLine Manager Details Section-->
        
     <!--Previous Education & Diagnostics-->
       <apex:pageBlock title="Previous Education & Diagnostics">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! Apprentice__c.English_Assessment__c}"/>
                <apex:inputField value="{! Apprentice__c.Date_of_Birth__c}"/>
                <apex:inputField value="{! Apprentice__c.Maths_Assessment__c}"/>
                <apex:inputField value="{! Apprentice__c.Funding_Line__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_Previous_Attainment__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_ICT_Achievement__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_English_Qual__c}"/>
                <apex:inputField value="{! Apprentice__c.Prior_Learning_Record_Attached__c}"/>
                <apex:inputField value="{! Apprentice__c.Highest_Maths_Qual__c}"/>
                <apex:inputField value="{! Apprentice__c.Learning_Difficulties__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Education & Diagnostics-->
        
        <!--Apprenticeship Programme-->
        
        <apex:pageBlock title="Apprenticeship Programme">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Title__c}"/>
                <apex:inputField value="{! Apprentice__c.Minimum_Duration__c}"/>
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Pathway__c}"/>
                <apex:inputField value="{! Apprentice__c.Prefered_Duration__c}"/>
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Level__c}"/>
                <apex:inputField value="{! Apprentice__c.Development_Coach__c}"/>
                <apex:inputField value="{! Apprentice__c.Apprenticeship_Type__c}"/>
                <apex:inputField value="{! Apprentice__c.Usual_College_Day__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
      <!--End of Apprenticeship Programme-->
        
      <!--Functional Skills-->
        <apex:pageBlock title="Functional Skills">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Functional_Maths__c}"/>
                <apex:inputField value="{! Apprentice__c.Maths_Status__c}"/>
                <apex:inputField value="{! Apprentice__c.Functional_English__c}"/>
                <apex:inputField value="{! Apprentice__c.English_Status__c}"/> 
                <apex:inputField value="{! Apprentice__c.Functional_ICT__c}"/> 
                <apex:inputField value="{! Apprentice__c.ICT_Status__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Functional Skills-->
        
        <!--Existing Employer Details-->
        <apex:pageBlock title="Existing Employer Details">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Original_Start_Date__c}"/>
                <apex:inputField value="{! Apprentice__c.Additional_Skills_Existing_Employee__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Existing Employer Details-->
        
        <!--End Point Assessment (EPA)-->
        <apex:pageBlock title="End Point Assessment (EPA)">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! Apprentice__c.Functional_Maths__c}"/>
                <apex:inputField value="{! Apprentice__c.Maths_Status__c}"/>
                <apex:inputField value="{! ComponentsObj.Qual_Aim_Text__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of End Point Assessment (EPA)-->
        
      <!--Apprenticeship Components-->
        
        <apex:pageBlock title="Apprenticeship Components">
            <apex:pageBlockSection columns="1" >
                <apex:inputField value="{! ComponentsObj.Apprenticeship_Qualifications__c}"/> 
                <apex:inputField value="{! ComponentsObj.Learning_Aim_Code__c}"/>
                <apex:inputField value="{! ComponentsObj.Level__c}"/>
                <apex:inputField value="{! ComponentsObj.Delivery_Location__c}"/>
                <apex:inputField value="{! ComponentsObj.Start_Date__c}"/>
                <apex:inputField value="{! ComponentsObj.Expected_End_date__c}"/>
                <apex:inputField value="{! ComponentsObj.Percentage_of_Aim_to_be_Delivered__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Apprenticeship Components-->
        
      <!--Save/Cancel-->
       
        <apex:pageBlock >
        <apex:commandButton action="{!save }" value="Save" />
        </apex:pageBlock>
        
      <!--End of Save/Cancel-->
            

    </apex:form>
</apex:page>
And here is my 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 ();
}
    public void saveObjects(){
         ProgramArea.PA_Code__c = 'P12';
         insert ProgramArea;
         ApprenticeObj.Programme_area__c = ProgramArea.Id;
         ApprenticeObj.Date_of_Birth__c = date.parse('12/08/2000');
         insert ApprenticeObj;
         ComponentsObj.Apprentice__c = ApprenticeObj.Id;
         Qual.Course_Code__c = '5363hdg';
         Qual.Qual_Aim__c = 'QualAim';
         Qual.Qualification_Type__c = 'Competency';
         insert Qual;
         ComponentsObj.Apprenticeship_Qualifications__c = Qual.Id;
         insert ComponentsObj;
    }
}


Any help is much appreciated thanks
 
What are the ways to call a function on the Page Layout apart from the constructor calling.

Kindly help me on this.

Thanks.
Hi All,

I am a Certified Salesforce Developer.I work at AppPerfect Corporation.
AppPerfect provides a wide range of Salesforce services to automate business processes, build application services, implement security and provide integration with external systems.

Our Services are as follows:
. Build a complete secure data model with field level security.
. Help you automate your business by providing expertise in various aspects of process automation.
. Force.Com Development.
. Extend The Salesforce Platform.
. Make Every Application Mobile - Instant Available Runtime,Custom App Development , Heroku etc .
. Data Integration - Connect To Data Sources,Extend access with powerful API’s,Cloud-To-Cloud Integration etc.

Please write to us at salesforce@appperfect.com with your requirements and we can setup a quick call to discuss.

Best Regards, 
Siddharth S. 
AppPerfect Corp.
salesforce@appperfect.com
408-252-4100
http://www.appperfect.com/services/salesforce/
Salesforce Development & Operations Experts
 

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.