• Matt Hampton
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 8
    Replies

I have the following:

 

sObject Resweep__c is the Parent in a Lookup Relationship with Site__c

sObject Site__c is the Parent in a Lookup Relationship with Video_Qualified_Address__c

sObject Video_Qualified_Address__c is the parent in a Lookup relationship with Subscriber__c

 

I need to write VF code to pull Video_Qualified_Address__c and Subscriber__c fields into a pageblocktable where Resweep__c.Site__c = Video_Qualified_Address__c.Site__c

 

I tried to use the code from your previous reply as a guide but I am having trouble with the condition that Site__c on the Resweep__c record = Site__c on the Video_Qualified_Address__c record.

 

I am at a total loss here. Still new to Apex Classes. I can get the VF compnent if I can get some assitance on the extension. Any help would be greatly appreciated.

 

 

Thanks,

 

Matt

 

 

I have created a VF page that has a custom button as a part of it. When I click the custom button, I want the new page to open in a new window. When I am logged in, this works. When other uses are logged in and the button is clicked, it opens the new page like it is embedded in the VF page.

 

Here is my code:

 

<apex:page standardcontroller="Wire_Center__c" tabStyle="Sites__c" extensions="RFMDU">
    <apex:pageBlock >
                <apex:pageBlockTable value="{!Sites}" var="zip" width="100%" columns="5">
                <apex:column id="c7">
                    <apex:form >
                    <apex:commandButton value="Assign" onclick="javascript&colon;openPopUpWindow;return false" action="/a1E/e?CF00NC0000005bqW8={!zip.name}&CF00NC0000005bqW8_lkid={!zip.id}"/>
                    </apex:form>
                </apex:column>                
                <apex:column id="c5" headerValue="MDU">
                    <apex:outputLink value="/{!zip.Id}" target="_top">{!zip.Name}</apex:outputLink>
                </apex:column>
                    <apex:column id="c4" headerValue="Last Resweep">
                        <apex:outputField value="{!zip.Date_of_Last_Resweep__c}"/>
                </apex:column>
                    <apex:column id="c3" headerValue="Current Penetration">
                        <apex:outputField value="{!zip.Current_Penetration__c}"/>  
                </apex:column>
                    <apex:column id="c2" headerValue="Non-Video Doors">
                        <apex:outputField value="{!zip.Non_Video_Doors__c}"/>                      
                </apex:column>          
                </apex:pageBlockTable> 
    </apex:pageBlock>
</apex:page>

Any thoughts?

 

Thanks in advance,

 

Matt

I have the following:

 

sObject Resweep__c is the Parent in a Lookup Relationship with Site__c

sObject Site__c is the Parent in a Lookup Relationship with Video_Qualified_Address__c

sObject Video_Qualified_Address__c is the parent in a Lookup relationship with Subscriber__c

 

I need to write VF code to pull Video_Qualified_Address__c and Subscriber__c fields into a pageblocktable where Resweep__c.Site__c = Video_Qualified_Address__c.Site__c

 

I tried to use the code from your previous reply as a guide but I am having trouble with the condition that Site__c on the Resweep__c record = Site__c on the Video_Qualified_Address__c record.

 

I am at a total loss here. Still new to Apex Classes. I can get the VF compnent if I can get some assitance on the extension. Any help would be greatly appreciated.

 

Thanks,

 

Matt

Hello:

 

I cannot figure out what to do here. Here is my situation:

 

I have a custom obeject Zip_Code__c that is in a Master-Detail with custom object Sites__c. The relationship name is References__r.

 

Sites__c has five different record types and what I want to do is create related lists for each RecordType individually. I am attempting to do this through Visualforce. Below is my VF page and extension.

 

<apex:page standardcontroller="Zip_Code__c" extensions="RFMDU">
    <apex:pageBlock >
                <apex:pageBlockTable value="{!Zip_Code__c.Releases__r}" var="zip" width="100%" columns="5">
                <apex:column id="c5" headerValue="MDU">
                    <apex:outputField value="{!zip.Name}"/>
                </apex:column>
                    <apex:column id="c4" headerValue="Units">
                        <apex:outputField value="{!zip.Units__c}"/>  
                </apex:column>
                    <apex:column id="c3" headerValue="Account Manager">
                        <apex:outputField value="{!zip.Account_Manager__c}"/>  
                </apex:column>
                    <apex:column id="c2" headerValue="Release Date">
                        <apex:outputField value="{!zip.Released_To_Sales__c}"/>  
                </apex:column>
                    <apex:column id="c1" headerValue="Zip Code">
                        <apex:outputField value="{!zip.Zip_Code__c}"/>   
                </apex:column>
                </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

public class RFMDU {

    //private final Sites__c sites;
    
    private List<Sites__c> sites = new List<Sites__c>();

    public RFMDU(Apexpages.StandardController controller) {
      String zipCodeId = controller.getId();

 sites = [SELECT ID, RecordTypeID FROM Sites__c 
                  WHERE Zip_Code__c = :zipCodeId
                  AND RecordTypeId='012C0000000GEJzIAO'];
    }

    public List<Sites__c> getsites() {
        return sites;
    }

    public PageReference save() {
        update sites;
        return null;
    }
}

 

What I am trying to acomplish is for this pageblockTable to display only related objects with RecordTypeID=012C0000000GEJzIAO. I am at a loss. Can anyone help me out here? Is my Controller not written correctly? Am I missing something in my VF code?

 

Thanks in advance,

 

Matt

Hello:

 

I have embedded a table into Custom Object Zip_Code__c however when the table shows up on the UI, it is not the same format/color scheme as the object. I know this isn't a huge deal to some, but I would like the VF component to look like it was integrated seamlessly. 

 

Here is my code (code works great):

 

<apex:page standardcontroller="Zip_Code__c" tabStyle="Zip_Code__c">
    <apex:pageBlock tabStyle="Zip_Code__c">
        <apex:pageBlockSection columns="1">
            <apex:outputPanel >
                <apex:dataTable value="{!Zip_Code__c}" var="zip" width="100%" columns="5">
                <apex:column id="c5">
                        <b>
                        <apex:outputLabel value="RF"/>
                        </b>
                        <br></br>
                        <br></br>
                        <b>
                        <apex:outputLabel value="IPTV-C"/>
                        <br></br>
                        <br></br>
                        </b>
                        <b>
                        <apex:outputLabel value="IPTV-F"/>
                        </b>
                        <br></br>
                        <br></br>
                        <b>
                        <apex:outputLabel value="Total"/>
                        </b>
                    </apex:column>
                    <apex:column id="c4" headerValue="Addresses">
                        <apex:outputField value="{!zip.RF_Addresses__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Addresses__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Addresses__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Addresses__c}"/>
                    </apex:column>
                    <apex:column id="c3" headerValue="Subscribers">
                        <apex:outputField value="{!zip.RF_Subs__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Subs__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Subs__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Subs__c}"/>
                    </apex:column> 
                    <apex:column id="c2" headerValue="Non-Video Doors">
                        <apex:outputField value="{!zip.RF_Doors__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Doors__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Doors__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Doors__c}"/>
                    </apex:column>     
                    <apex:column id="c1" headerValue="Penetration">
                        <apex:outputField value="{!zip.RF_Penetration__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Penetration__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Penetration__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Penetration__c}"/>
                    </apex:column>                
                </apex:dataTable>
            </apex:outputPanel>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

 The data table is gray with a blue line on the top. What I can do to get the format to match that of the custom object?

 

Any help is greatly appreciated.

 

Thanks,

 

Matt

Hello:

 

I am trying to develop a Visualforce page where I am inseting a new section of a related object into the record if a certain criteria is met.

 

I have a custom sObject (Zip_Code__C) that is in a Master-Detail with sObject Sites__c where Zip_Code__c is the parent object.

 

Site__c has multiple record types so I want to break up the related lists into sections based on record type.

 

The controller I am tyring to write is:

 

public class MyController {

    private final Sites__C sites;

    public MyController() {
        sites = [SELECT Name, Units__c FROM Sites__c
                   WHERE Zip_Code__c = :ApexPages.currentPage().getParameters().get('id')
                   AND RecordTypeID='012C0000000GEK4'];
    }

    public sites__c getsites() {
        return sites;
    }

    public PageReference save() {
        update sites;
        return null;
    }
}

 

 

By doing this, it would insert a table into the record itself rather than create a related list. 

 

My Visialforce code is:

 

<apex:page standardController="Zip_Code__c" extensions="MyController">
<!-- the first example, below, demonstrates the use of the pageBlockTable tag to display a mash-up list of Job Application & Candidate information -->
<!-- this is important because we did not have to burn custom fields in order to pull in the candidate info for display -->
<!-- also notice that the formatting is taken care of for you when using the pageBlockTable tag -->
<apex:pageBlock >
<apex:pageBlockTable value="{!Zip_Code__c.Sites__r}" var="item">
<apex:column value="{!item.name}"/> 
<apex:column value="{!item.Units__c}"/>
</apex:pageBlockTable> 
</apex:pageBlock>
<!-- the example below demonstrates the use of the dataTable tag to display the same information as the first example above -->
<!-- notice that formatting is not handled for you when using the dataTable tag, and we need to explicitly declare column heading labels -->
</apex:page>

 

 

I am getting error Error: Unknown constructor 'MyController.MyController(ApexPages.StandardController controller).

 

Thoughts? Suggestions? Help?

 

Hello:

 

I am having some issues getting my Apex Code and Test Class deployed. I am attaching below. Any help would be appreciated as I am still new to Apex. 


There I am getting is system.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

 

Apex Code

 

trigger QualificationUpdate on Video_Qualified_Address__c (after insert) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                     for(Video_Qualified_Address__c s: Trigger.New)
                             {
                                      AddressSet.add(s.parsed_street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Fioptics_Inquiry__c> gpon = [select id, name, fiber_qualified__c, street_address__c, location__c, zip_code__c from Fioptics_Inquiry__c where street_address__c IN: AddressSet
and location__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0) 
        {Map<ID, Fioptics_Inquiry__c> toUpdate=new Map<ID, Fioptics_Inquiry__c>(); 
        Map<ID, String> FQAID = new Map<ID, String>(); 
        for(Fioptics_Inquiry__c FQAID2: gpon) {Map<String, Fioptics_Inquiry__c> FQAMap = new Map<String, Fioptics_Inquiry__c>(); 
        for(Fioptics_Inquiry__c foa: gpon) {FQAMAP.put(foa.street_address__c + '' + foa.location__c + '' + foa.zip_code__c, foa); } 
        for(Video_Qualified_Address__c s: Trigger.new) {if(FQAMAP.containsKey(s.parsed_street_address__c + '' + s.loc__c + '' + s.zip_code__c)) 
        {Fioptics_Inquiry__c cand = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c); 
        cand.fiber_qualified__c = TRUE; toUpdate.put(cand.id, cand); } } update toUpdate.values(); }

 

Test

 

@isTest
private class TestQualificationUpdate {
static testmethod void testmy(){

//Set up Video Qualified Address for each test
 
Fioptics_Inquiry__c sub1 = new Fioptics_Inquiry__c ();
Sub1.Name='Test Subscriber 1';
Sub1.Street_Address__c='123 MAIN ST';
Sub1.Location__c='APT 1';
Sub1.Zip_Code__c='45202';
insert sub1;

Video_Qualified_Address__c vqa1 = new Video_Qualified_Address__c();
vqa1.RecordTypeID='012C0000000GELv';
vqa1.Name='123 MAIN ST 45202 /APT1';
vqa1.Street_Address__c='123 MAIN ST';
vqa1.Parsed_Street_Address__c='123 MAIN ST';
vqa1.Loc__c='APT 1';
vqa1.Zip_Code__c='45202';
insert vqa1;

Fioptics_Inquiry__c subs1 = [SELECT ID, Fiber_Qualified__c FROM Fioptics_Inquiry__c where id=:sub1.id];
Video_Qualified_Address__c addy1 = [SELECT ID FROM Video_Qualified_Address__c where id=:vqa1.id];

system.assertequals(subs1.Fiber_Qualified__c, TRUE);

Fioptics_Inquiry__c sub2 = new Fioptics_Inquiry__c ();
Sub2.Name='Test Subscriber 2';
Sub2.Street_Address__c='456 MAIN ST';
Sub2.Zip_Code__c='45202';
insert sub2;

Video_Qualified_Address__c vqa2 = new Video_Qualified_Address__c();
vqa2.RecordTypeID='012C0000000GELv';
vqa2.Name='456 MAIN ST 45202';
vqa2.Parsed_Street_Address__c='456 MAIN ST';
vqa2.Zip_Code__c='45202';
insert vqa2;

Fioptics_Inquiry__c subs2 = [SELECT ID, Fiber_Qualified__c FROM Fioptics_Inquiry__c where id=:sub2.id];
Video_Qualified_Address__c addy2 = [SELECT ID FROM Video_Qualified_Address__c where id=:vqa2.id];

system.assertequals(subs2.Fiber_Qualified__c, TRUE);


Fioptics_Inquiry__c sub3 = new Fioptics_Inquiry__c ();
Sub3.Name='Test Subscriber 3';
Sub3.Street_Address__c='123 MAIN ST';
Sub3.Location__c='APT 1';
Sub3.Zip_Code__c='45202';
insert sub3;

Video_Qualified_Address__c vqa3 = new Video_Qualified_Address__c();
vqa3.RecordTypeID='012C0000000GELv';
vqa3.Name='321 MAIN ST 45202 /APT1';
vqa3.Parsed_Street_Address__c='321 MAIN ST';
vqa3.Loc__c='APT 1';
vqa3.Zip_Code__c='45202';
insert vqa3;

Fioptics_Inquiry__c subs3 = [SELECT ID, Fiber_Qualified__c FROM Fioptics_Inquiry__c where id=:sub3.id];
Video_Qualified_Address__c addy3 = [SELECT ID FROM Video_Qualified_Address__c where id=:vqa3.id];

system.assertequals(subs3.Fiber_Qualified__c, FALSE);

 Thanks in advance for any help you can provide.

 

I have the following:

 

sObject Resweep__c is the Parent in a Lookup Relationship with Site__c

sObject Site__c is the Parent in a Lookup Relationship with Video_Qualified_Address__c

sObject Video_Qualified_Address__c is the parent in a Lookup relationship with Subscriber__c

 

I need to write VF code to pull Video_Qualified_Address__c and Subscriber__c fields into a pageblocktable where Resweep__c.Site__c = Video_Qualified_Address__c.Site__c

 

I tried to use the code from your previous reply as a guide but I am having trouble with the condition that Site__c on the Resweep__c record = Site__c on the Video_Qualified_Address__c record.

 

I am at a total loss here. Still new to Apex Classes. I can get the VF compnent if I can get some assitance on the extension. Any help would be greatly appreciated.

 

 

Thanks,

 

Matt

 

 

Hello:

 

I cannot figure out what to do here. Here is my situation:

 

I have a custom obeject Zip_Code__c that is in a Master-Detail with custom object Sites__c. The relationship name is References__r.

 

Sites__c has five different record types and what I want to do is create related lists for each RecordType individually. I am attempting to do this through Visualforce. Below is my VF page and extension.

 

<apex:page standardcontroller="Zip_Code__c" extensions="RFMDU">
    <apex:pageBlock >
                <apex:pageBlockTable value="{!Zip_Code__c.Releases__r}" var="zip" width="100%" columns="5">
                <apex:column id="c5" headerValue="MDU">
                    <apex:outputField value="{!zip.Name}"/>
                </apex:column>
                    <apex:column id="c4" headerValue="Units">
                        <apex:outputField value="{!zip.Units__c}"/>  
                </apex:column>
                    <apex:column id="c3" headerValue="Account Manager">
                        <apex:outputField value="{!zip.Account_Manager__c}"/>  
                </apex:column>
                    <apex:column id="c2" headerValue="Release Date">
                        <apex:outputField value="{!zip.Released_To_Sales__c}"/>  
                </apex:column>
                    <apex:column id="c1" headerValue="Zip Code">
                        <apex:outputField value="{!zip.Zip_Code__c}"/>   
                </apex:column>
                </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 

public class RFMDU {

    //private final Sites__c sites;
    
    private List<Sites__c> sites = new List<Sites__c>();

    public RFMDU(Apexpages.StandardController controller) {
      String zipCodeId = controller.getId();

 sites = [SELECT ID, RecordTypeID FROM Sites__c 
                  WHERE Zip_Code__c = :zipCodeId
                  AND RecordTypeId='012C0000000GEJzIAO'];
    }

    public List<Sites__c> getsites() {
        return sites;
    }

    public PageReference save() {
        update sites;
        return null;
    }
}

 

What I am trying to acomplish is for this pageblockTable to display only related objects with RecordTypeID=012C0000000GEJzIAO. I am at a loss. Can anyone help me out here? Is my Controller not written correctly? Am I missing something in my VF code?

 

Thanks in advance,

 

Matt

Hello:

 

I have embedded a table into Custom Object Zip_Code__c however when the table shows up on the UI, it is not the same format/color scheme as the object. I know this isn't a huge deal to some, but I would like the VF component to look like it was integrated seamlessly. 

 

Here is my code (code works great):

 

<apex:page standardcontroller="Zip_Code__c" tabStyle="Zip_Code__c">
    <apex:pageBlock tabStyle="Zip_Code__c">
        <apex:pageBlockSection columns="1">
            <apex:outputPanel >
                <apex:dataTable value="{!Zip_Code__c}" var="zip" width="100%" columns="5">
                <apex:column id="c5">
                        <b>
                        <apex:outputLabel value="RF"/>
                        </b>
                        <br></br>
                        <br></br>
                        <b>
                        <apex:outputLabel value="IPTV-C"/>
                        <br></br>
                        <br></br>
                        </b>
                        <b>
                        <apex:outputLabel value="IPTV-F"/>
                        </b>
                        <br></br>
                        <br></br>
                        <b>
                        <apex:outputLabel value="Total"/>
                        </b>
                    </apex:column>
                    <apex:column id="c4" headerValue="Addresses">
                        <apex:outputField value="{!zip.RF_Addresses__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Addresses__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Addresses__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Addresses__c}"/>
                    </apex:column>
                    <apex:column id="c3" headerValue="Subscribers">
                        <apex:outputField value="{!zip.RF_Subs__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Subs__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Subs__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Subs__c}"/>
                    </apex:column> 
                    <apex:column id="c2" headerValue="Non-Video Doors">
                        <apex:outputField value="{!zip.RF_Doors__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Doors__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Doors__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Doors__c}"/>
                    </apex:column>     
                    <apex:column id="c1" headerValue="Penetration">
                        <apex:outputField value="{!zip.RF_Penetration__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_C_Penetration__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.IPTV_F_Penetration__c}"/>
                        <br></br>
                        <br></br>
                        <apex:outputField value="{!zip.Total_Penetration__c}"/>
                    </apex:column>                
                </apex:dataTable>
            </apex:outputPanel>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

 The data table is gray with a blue line on the top. What I can do to get the format to match that of the custom object?

 

Any help is greatly appreciated.

 

Thanks,

 

Matt

Hello:

 

I am trying to develop a Visualforce page where I am inseting a new section of a related object into the record if a certain criteria is met.

 

I have a custom sObject (Zip_Code__C) that is in a Master-Detail with sObject Sites__c where Zip_Code__c is the parent object.

 

Site__c has multiple record types so I want to break up the related lists into sections based on record type.

 

The controller I am tyring to write is:

 

public class MyController {

    private final Sites__C sites;

    public MyController() {
        sites = [SELECT Name, Units__c FROM Sites__c
                   WHERE Zip_Code__c = :ApexPages.currentPage().getParameters().get('id')
                   AND RecordTypeID='012C0000000GEK4'];
    }

    public sites__c getsites() {
        return sites;
    }

    public PageReference save() {
        update sites;
        return null;
    }
}

 

 

By doing this, it would insert a table into the record itself rather than create a related list. 

 

My Visialforce code is:

 

<apex:page standardController="Zip_Code__c" extensions="MyController">
<!-- the first example, below, demonstrates the use of the pageBlockTable tag to display a mash-up list of Job Application & Candidate information -->
<!-- this is important because we did not have to burn custom fields in order to pull in the candidate info for display -->
<!-- also notice that the formatting is taken care of for you when using the pageBlockTable tag -->
<apex:pageBlock >
<apex:pageBlockTable value="{!Zip_Code__c.Sites__r}" var="item">
<apex:column value="{!item.name}"/> 
<apex:column value="{!item.Units__c}"/>
</apex:pageBlockTable> 
</apex:pageBlock>
<!-- the example below demonstrates the use of the dataTable tag to display the same information as the first example above -->
<!-- notice that formatting is not handled for you when using the dataTable tag, and we need to explicitly declare column heading labels -->
</apex:page>

 

 

I am getting error Error: Unknown constructor 'MyController.MyController(ApexPages.StandardController controller).

 

Thoughts? Suggestions? Help?