• Automate Process
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hello All,

I am new to visualforce programming and here I am stuck with something that looked pretty simple to me earlier(Well its not now obviously).
I am trying to use the inputs entered in two inputfields in my visualforce page, do some string operations(trim)/Concatenate, and use the resulting string as a value in a third inputbox. The auto-population of the field will happen when the third textbox gets the focus.

I thought this would be pretty simple to capture the values using javascript but unfortunatey, could not get away with a solution.

Appreciate any pointers towards a solution.

Regards,
Sudip
Hi Team,

I am new to visualforce coding. I was tyrying to do some customization on the case object but whenever I am trying to save the record into the object its throwing me: System.NullPointerException: Attempt to de-reference a null object" error. Any help in this regard is much appreciated.
Below goes by VF page code:
 
<apex:page StandardController="Case" extensions="detailsController" showHeader="False" sidebar="False">
    <apex:form >
    <apex:pagemessages ></apex:pagemessages>
        <apex:pageBlock id="pb" >
            <apex:pageBlockSection title="Please fill in the below details">
                <apex:inputField value="{!c.user_fname__c}"/>
                <apex:inputField value="{!c.user_lname__c}"/>
                <apex:inputField value="{!c.user_alias__c}"/>
                <apex:inputField value="{!c.user_email__c}"/>
                <apex:inputField value="{!c.user_CommunityNickname__c}"/>
                <apex:inputField value="{!c.user_role__c}" required="True"/>
                <apex:inputField value="{!c.user_license__c}" required="True"/>
                <apex:inputField value="{!c.user_profile__c}" required="True"/>
                <apex:inputField value="{!c.user_EmailEncodingKey__c}" required="True"/>
            </apex:pageblocksection>
        </apex:pageBlock>
        <center>
        <apex:commandButton value="Save" action="{!saveRec}"/>
        <apex:commandButton value="Reset All" action="{!resetAll}" immediate="True"/>
        <apex:commandButton value="Cancel & Back to Previous" action="{!returnBack}" immediate="true"/>
        </center>
    </apex:form>
</apex:page>

and the detailsController is as below:
 
<apex:page StandardController="Case" extensions="detailsController" showHeader="False" sidebar="False">
    <apex:form >
    <apex:pagemessages ></apex:pagemessages>
        <apex:pageBlock id="pb" >
            <apex:pageBlockSection title="Please fill in the below details">
                <apex:inputField value="{!c.user_fname__c}"/>
                <apex:inputField value="{!c.user_lname__c}"/>
                <apex:inputField value="{!c.user_alias__c}"/>
                <apex:inputField value="{!c.user_email__c}"/>
                <apex:inputField value="{!c.user_CommunityNickname__c}"/>
                <apex:inputField value="{!c.user_role__c}" required="True"/>
                <apex:inputField value="{!c.user_license__c}" required="True"/>
                <apex:inputField value="{!c.user_profile__c}" required="True"/>
                <apex:inputField value="{!c.user_EmailEncodingKey__c}" required="True"/>
            </apex:pageblocksection>
        </apex:pageBlock>
        <center>
        <apex:commandButton value="Save" action="{!saveRec}"/>
        <apex:commandButton value="Reset All" action="{!resetAll}" immediate="True"/>
        <apex:commandButton value="Cancel & Back to Previous" action="{!returnBack}" immediate="true"/>
        </center>
    </apex:form>
</apex:page>


 
Hi Team,

I am new to visualforce coding. I was tyrying to do some customization on the case object but whenever I am trying to save the record into the object its throwing me: System.NullPointerException: Attempt to de-reference a null object" error. Any help in this regard is much appreciated.
Below goes by VF page code:
 
<apex:page StandardController="Case" extensions="detailsController" showHeader="False" sidebar="False">
    <apex:form >
    <apex:pagemessages ></apex:pagemessages>
        <apex:pageBlock id="pb" >
            <apex:pageBlockSection title="Please fill in the below details">
                <apex:inputField value="{!c.user_fname__c}"/>
                <apex:inputField value="{!c.user_lname__c}"/>
                <apex:inputField value="{!c.user_alias__c}"/>
                <apex:inputField value="{!c.user_email__c}"/>
                <apex:inputField value="{!c.user_CommunityNickname__c}"/>
                <apex:inputField value="{!c.user_role__c}" required="True"/>
                <apex:inputField value="{!c.user_license__c}" required="True"/>
                <apex:inputField value="{!c.user_profile__c}" required="True"/>
                <apex:inputField value="{!c.user_EmailEncodingKey__c}" required="True"/>
            </apex:pageblocksection>
        </apex:pageBlock>
        <center>
        <apex:commandButton value="Save" action="{!saveRec}"/>
        <apex:commandButton value="Reset All" action="{!resetAll}" immediate="True"/>
        <apex:commandButton value="Cancel & Back to Previous" action="{!returnBack}" immediate="true"/>
        </center>
    </apex:form>
</apex:page>

and the detailsController is as below:
 
<apex:page StandardController="Case" extensions="detailsController" showHeader="False" sidebar="False">
    <apex:form >
    <apex:pagemessages ></apex:pagemessages>
        <apex:pageBlock id="pb" >
            <apex:pageBlockSection title="Please fill in the below details">
                <apex:inputField value="{!c.user_fname__c}"/>
                <apex:inputField value="{!c.user_lname__c}"/>
                <apex:inputField value="{!c.user_alias__c}"/>
                <apex:inputField value="{!c.user_email__c}"/>
                <apex:inputField value="{!c.user_CommunityNickname__c}"/>
                <apex:inputField value="{!c.user_role__c}" required="True"/>
                <apex:inputField value="{!c.user_license__c}" required="True"/>
                <apex:inputField value="{!c.user_profile__c}" required="True"/>
                <apex:inputField value="{!c.user_EmailEncodingKey__c}" required="True"/>
            </apex:pageblocksection>
        </apex:pageBlock>
        <center>
        <apex:commandButton value="Save" action="{!saveRec}"/>
        <apex:commandButton value="Reset All" action="{!resetAll}" immediate="True"/>
        <apex:commandButton value="Cancel & Back to Previous" action="{!returnBack}" immediate="true"/>
        </center>
    </apex:form>
</apex:page>


 
Hi can any one explain this code .If required please simplify the code also.

trigger emailCheck on Employee__c (before update) 
{
    Map<Id,Employee__c> o = new Map<Id,Employee__c>();
    o = trigger.oldMap;
    for(Employee__c n : trigger.new)
    {
        Employee__c old = new Employee__c();
        old = o.get(n.Id);
        if(n.Email__c != old.Email__c)
        {
            n.Email__c.addError('Email cannot be changed');
        }
    }
}