• olansi china
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
<apex:page controller="Registrationcontroller" id="theRepeat" sidebar="false" showHeader="true">
    <apex:form >
        <apex:pageBlock id="pg1" >
            <apex:messages />
            <apex:pageBlockSection columns="1" >
                <apex:inputField label="FirstName" value="{!reg1.FirstName__c}"/>
                <apex:inputField label="LastName" value="{!reg1.LastName__c}"/>
                <apex:inputField label="Email" value="{!reg1.Email__c}"/>
                <apex:inputField label="HoTel Commands" value="{!hotel.Hotel_Commands__c}"/>
                <apex:inputField label="Air Commands" value="{!air.Air_Commands__c}"/>
                <apex:inputField label="CheckInDate" value="{!hotel.Check_In_Date__c}"/>
                <apex:inputField label="CheckOutDate" value="{!hotel.Check_Out_Date__c}"/>
                <apex:inputField label="Arrival" value="{!air.Arrival__c}"/>
                <apex:inputField label="Departure" value="{!air.Departure__c}"/>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton value="save" action="{!saveaction}" rerender="pg1,theTable" />
                
            </apex:pageBlockButtons> 
        </apex:pageBlock>
        <apex:pageBlock >
            <apex:dataTable value="{!registerlist}" var="regvalue" id="theTable" width="100%">
                <apex:facet name="caption">Registration List</apex:facet>
                <apex:column headerValue="Reg ID"><apex:outputText value="{!regvalue.Name}" /> </apex:column>
                <apex:column headerValue="FirstName"><apex:outputText value="{!regvalue.FirstName__c}" /> </apex:column>
                <apex:column headerValue="LastName"><apex:outputText value="{!regvalue.LastName__c}" /> </apex:column>
                <apex:column headerValue="Email"><apex:outputText value="{!regvalue.Email__c}" /> </apex:column>
                <apex:repeat value="{!regvalue.Hotels__r}" var="c">
                    <apex:column headerValue="Hotel ID"> <apex:outputText value="{!c.Name}"/></apex:column>
                    <apex:column headerValue="CheckInDate"> <apex:outputText value="{!c.Check_In_Date__c}"/></apex:column>
                    <apex:column headerValue="CheckOutDate"><apex:outputText value="{!c.Check_Out_Date__c}"/></apex:column>
                    <apex:column headerValue="Hotel Commands"><apex:outputText value="{!c.Hotel_Commands__c}"/></apex:column>
                    
                </apex:repeat>
                <apex:repeat value="{!regvalue.AirTravels__r}" var="d">
                    <apex:column headerValue="Air ID"><apex:outputText value="{!d.Name}"/></apex:column>
                    <apex:column headerValue="Arrival"><apex:outputText value="{!d.Arrival__c}"/></apex:column>
                    <apex:column headerValue="Departure"><apex:outputText value="{!d.Departure__c}"/></apex:column>
                    <apex:column headerValue="Air Commands"><apex:outputText value="{!d.Air_Commands__c}"/></apex:column>
                    
                </apex:repeat>
                
                
                <apex:column >
                    <apex:commandLink value="Edit" action="{!editfunction}" rerender="pg1">
                        <apex:param name="cid" value="{!regvalue.id}" assignto="{!editid}"/>
                        <apex:param name="cid1" value="{!regvalue.id}" assignto="{!editid1}"/>
                        <apex:param name="cid2" value="{!regvalue.id}" assignto="{!editid2}"/>
                        
                    </apex:commandLink> || 
                    <apex:commandLink value="Delete" action="{!deletefunction}" rerender="pg1,theTable">
                        <apex:param name="cid" value="{!regvalue.id}" assignto="{!editid}"/>
                        <apex:param name="cid1" value="{!regvalue.id}" assignto="{!editid1}"/>
                        <apex:param name="cid2" value="{!regvalue.id}" assignto="{!editid2}"/>
                    </apex:commandLink> 
                </apex:column>
            </apex:dataTable>
        </apex:pageBlock>
    </apex:form>         
</apex:page>



public class Registrationcontroller {
    public Registration1__c reg1 {get;set;}
    public String editid {get;set;}
    public String editid1 {get;set;}
    public String editid2 {get;set;}
    public Hotel__c hotel {get;set;}
    public AirTravel__c air {get;set;}
    
    public Registrationcontroller()
    {
        reg1 = new Registration1__c();
        hotel = new Hotel__c();
        air = new AirTravel__c();
    }
    public List<Registration1__c> getregisterlist(){
        List<Registration1__c> listreg= new List<Registration1__c>();
        listreg=[SELECT Id, Name, FirstName__c, LastName__c, Email__c, (SELECT Id,Name, Check_In_Date__c, Check_Out_Date__c, Hotel_Commands__c FROM Hotels__r),
                 (SELECT Id,Name, Arrival__c, Departure__c, Air_Commands__c FROM AirTravels__r) FROM Registration1__c];
        return listreg;
    }
    public void editfunction() {
        system.debug('editfunction inside===>'+editid);
        system.debug('editfunction inside===>'+editid1);
        system.debug('editfunction inside===>'+editid2);
        reg1=[SELECT Id,Name, FirstName__c, LastName__c, Email__c
              FROM Registration1__c where id=:editid];
        
        
        List<Hotel__c> hotel2=[SELECT Id,Name, Check_Out_Date__c, Check_In_Date__c, Hotel_Commands__c FROM Hotel__c where id=:editid1];
        List<AirTravel__c> air2=[SELECT Id,Name, Arrival__c, Departure__c, Air_Commands__c FROM AirTravel__c where id=:editid2];
        
    }
    public void deletefunction() {
        system.debug('editfunction inside===>'+editid);
        
        List<Registration1__c>  reg2=[SELECT Id, Name, FirstName__c, LastName__c, Email__c
                                      FROM Registration1__c where id=:editid];
        List<Hotel__c> hotel1=[SELECT Id,Name, Check_Out_Date__c, Check_In_Date__c, Hotel_Commands__c FROM Hotel__c where id=:editid1];
        List<AirTravel__c> air1=[SELECT Id,Name, Arrival__c, Departure__c, Air_Commands__c FROM AirTravel__c where id=:editid2];
        
        delete reg2;
        delete hotel1;
        delete air1;
        ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO,'Record deleted successfully'));
    }
    
    
    public void saveaction()
    {
        system.debug('saveaction inside===>'+reg1);
        try{
            upsert reg1;
            if(reg1.Id !=null){
                ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.INFO,'Record saved successfully'));
                
                if(hotel != null)
                {
                    hotel.Registration1__c = reg1.id;
                    upsert hotel;
                }
                if(air != null)
                {
                    air.Registration1__c = reg1.id;
                    upsert air;
                }
                
            } else
            {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.SEVERITY.ERROR,'Record not saved')); 
            }
            reg1 = new Registration1__c();
            hotel = new Hotel__c();
            air = new AirTravel__c();
        }
        Catch(Exception e)  
        {
            System.debug(e.getMessage());
        }
    }
}



how to showing the all values in my record can anyone helpme
Modify an AppExchange dashboard
Maria Jimenez is looking for reports and dashboards on AppExchange to track her team's transition to Lightning Experience. Install the AppExchange Dashboard Pack for Sales, Marketing and Service package into your Trailhead Playground and make some modifications. 

You’ll need your hands-on org username and password to complete this challenge. If you're using a Trailhead Playground, this article shows you how to find your username and reset your password. If you have trouble installing the package, follow the steps in this article.

In your Trailhead Playground, install the AppExchange Dashboard Pack for Sales, Marketing and Service.
Clone the 1-Account, Contact & Opportunity Data Quality dashboard and name it My Account and Contact Dashboard.
Add a dashboard filter on the Billing City field so that the dashboard only shows info about Accounts in London.
Save and refresh the dashboard.

I am trying to complete this challenge from past 4 hours still am not able to do it. Please help me guys! Guide me!!!!
I am having trouble completing the challenge for the "Create and Edit Lightning Components" module of the "Lightning Components Basics" trail. Here is the challenge:

Create a camping component that contains a campingHeader and a campingList component.
    The campingList component contains an ordered list of camping supplies that include Bug Spray, Bear Repellant, and Goat Food.
    The campingHeader component contains an H1 heading style with a font size of 18 points and displays 'Camping List'.

Here is my code:

camping.cmp

<aura:component >   
    <c:campingHeader/>
    <c:campingList/>
</aura:component>

campingHeader.cmp

<aura:component >
    <H1>Camping List</H1>
</aura:component>

campingHeader.css

.THIS {
}

H1.THIS {
    font-size: 18px;
}

campingList.cmp

<aura:component >
    <aura:attribute name="campingSupplies" type="List" default="['Bear Repellant', 'Bug Spray', 'Goat Food']" />
</aura:component>

When I check the challenge, I get the error message:

Challenge Not yet complete... here's what's wrong:
The component is not using the correct font size.

Any help is greatly appreciated.
Anyone else having trouble connecting to the UpWork group for Salesforce.com? I've tried everything and can't get past the screen to start a dev. org. and submit my application. *sigh*
I am getting error message while solving this challenge in Trailhead :

To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value. (Hint: you can use the ISBLANK function for this check)

Error Message is :  There was an unhandled exception. Please reference ID: HKIZNLVZ. Error: Trailhead::TrailheadTimeOut. Message: Trailhead.view: failed to get a 200 response. Made 3 attempts each resulting in a 403 or 500 failure for url challenges?key=%5B%22trailhead.challenge.validation_rules.en.us.192%22%5D.

I am not sure what went wrong here.
My Validation Rule is on Contact Object  :

  AND ( NOT(ISBLANK( Account.Name)),
( MailingPostalCode <> Account.ShippingPostalCode))

Can anyone please help with this.