• Matthew Hampton
  • NEWBIE
  • 5 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 37
    Replies

Hello:

 

I have to custom objects - Fiber_Qualified_Address__c and IPTV_Qualified_Address__c. What I would like to do is the following:

 

Build a trigger where when I create a new record on IPTV_Qualified_Address__c, it checks to ensure that the address does not exist on Fiber_Qualified_Address__c.

 

Both objects contain the fields Street_Address__c, Loc__c, and Zip_Code__c so a concatenation of those fields would be the string to look for.

 

If there is a match after insert of ITPV_Qualified_Address__c, I would like the record deleted. I will be inserting upwards of 2,000 records at a time into IPTV_Qualified_Address__c using the data loader so I would need it bulkified.

 

Can anyone please help?

 

Thanks!

 

Matt

Can anyone take a look at the code written below and help me re-write it so that I avoid getting the error message "Duplicate ID in list at Line 23, Column 69".

 

 

trigger FiberUpdate on Fiber_Qualified_Address__c (after insert, after update) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Fiber_Qualified_Address__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Subscriber__c> gpon = [select id, name, fiber_address__c, street_address__c, loc__c, zip_code__c from Subscriber__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0) 
        { List<Subscriber__c> toUpdate=new List<Subscriber__c>(); 
        Map<ID, String> FQAID = new Map<ID, String>(); 
        for(Subscriber__c FQAID2: gpon) { Map<String, Subscriber__c> FQAMap = new Map<String, Subscriber__c>(); 
        for(Subscriber__c foa: gpon) { FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa); } 
        for(Fiber_Qualified_Address__c s: Trigger.new) { if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c)) 
        { Subscriber__c cand = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c); 
        cand.fiber_address__c = s.id; toUpdate.add(cand); } } update toUpdate; }
}
}

 

Any help you can provide is appreciated.

 

Thanks in advance,

 

Matt

All:

 

I have the following trigger written:

 

trigger FiberUpdate on Fiber_Qualified_Address__c (after insert, after update) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Fiber_Qualified_Address__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Subscriber__c> gpon = [select id, name, fiber_address__c, street_address__c, loc__c, zip_code__c from Subscriber__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0) 
        { List<Subscriber__c> toUpdate=new List<Subscriber__c>(); 
        Map<ID, String> FQAID = new Map<ID, String>(); 
        for(Subscriber__c FQAID2: gpon) { Map<String, Subscriber__c> FQAMap = new Map<String, Subscriber__c>(); 
        for(Subscriber__c foa: gpon) { FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa); } 
        for(Fiber_Qualified_Address__c s: Trigger.new) { if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c)) 
        { Subscriber__c cand = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c); 
        cand.fiber_address__c = s.id; toUpdate.add(cand); } } update toUpdate; }
}
}

 

and the following test class:

 

@isTest
private class testfiber{
static testmethod void testmy(){
Subscriber__c obj1 = new Subscriber__c();
obj1.street_address__c ='testadd';
obj1.loc__c = 'testloc';
obj1.zip_code__c = '87483';
insert obj1;

Fiber_Qualified_Address__c obj = new Fiber_Qualified_Address__c();
obj.street_address__c ='testadd';
obj.loc__c = 'testloc';
obj.zip_code__c = '87483';
insert obj;
}
}

 

I built them both in Sandbox, tested them out, acheived what I wanted, depoloyed to production, now I am getting an error:

 

System.QueryException: Non-selective query against large object type (more than 100,000 rows) . Consider an index filter.

 

Can anyone help me re-work the code or test coverage to avoid this error?

 

What I need the code to do is:

 

1. After update or insert of records in Fiber_Qualified_Address__c, take three fields (street_address__c, loc__c and zip_code__c) and lookup to see if there is a record in Subscriber__c that has the same three values in the same three fields.

 

2. If there is a match, create a lookup relationship in field Fiber_Address__c on Subscriber__c with Fiber_qualified_address__c

 

3. If there is no match, do nothing.

 

4. I would be inserting/updating anywhere from 100-1000 fiber qualified addresses at a time.

 

Thanks in advance for any help.

 

Matt

If anyone can help me with this code before I chuck my mouse and keyboard across the room I would appreciate.

 

I have the following code written, tested and deploye don customer object Subscriber__c:

 

trigger SubUpdate on Subscriber__c (before insert) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Subscriber__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Fiber_Qualified_Address__c> gpon = [select id,name, street_address__c, loc__c, zip_code__c from Fiber_Qualified_Address__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0)

        {
                Map<ID, String> FQAID = new Map<ID, String>();
                for(Fiber_Qualified_Address__c FQAID2: gpon)
                {
                Map<String, Fiber_Qualified_Address__c> FQAMap = new Map<String, Fiber_Qualified_Address__c>();
                for(Fiber_Qualified_Address__c foa: gpon)
                {
                            FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa);
                }
                for(Subscriber__c s: Trigger.new)
                {
                            if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c))
                            s.fiber_address__c = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c).Id;
                            }
             }
}
}

 

Long story short, the code takes three pieces of information from the subscriber record, looks to see if there is a matching record on custom object Fiber_Qualified_Addressess__c and if there is, creates a lookup relationship on subscriber. This is done everytime I update or insert new subscriber records.

 

What I need to do now is take the code and tweak it slightly so that it works on Fiber_Qualified_Addresses__c. What I need is the code to work and create the same relationship after insertion of new Fiber_Qualified_Addresses__c records. I have spent three hours so far today working on this with no luck. Any help would be greatly appreciated.

 

Thanks,

 

Matt

I have the following apex trigger written in my Sandbox:

 

trigger SubUpdate on Subscriber__c (before insert) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Subscriber__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Fiber_Qualified_Address__c> gpon = [select id,name, street_address__c, loc__c, zip_code__c from Fiber_Qualified_Address__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];
        if(gpon.size()>0)
        {
                Map<ID, String> FQAID = new Map<ID, String>();
                for(Fiber_Qualified_Address__c FQAID2: gpon)
                {
                Map<String, Fiber_Qualified_Address__c> FQAMap = new Map<String, Fiber_Qualified_Address__c>();
                for(Fiber_Qualified_Address__c foa: gpon)
                {
                            FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa);
                }
                for(Subscriber__c s: Trigger.new)
                {
                            if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c))
                            s.fiber_address__c = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c).Id;
                            }
             }
}
}
The code is accepted and works fine on the couple of examples that I have tried. However, I cannot get test coverage written to cover this trigger. Can anyone help, offer suggestions? Would be greatly appreciated.
Thanks,
Matt

 

I have the following extremely basic code written in my sandbox:

 

trigger SubUpdate on Subscriber__c (before insert) {
list<Fiber_Qualified_Address__c> gpon = [select id,name, street_address__c, loc__c, zip_code__c from Fiber_Qualified_Address__c where street_address__c=:Trigger.new[0].street_address__c
and loc__c=:Trigger.new[0].loc__c
and zip_code__c=:Trigger.new[0].zip_code__c
];

if(gpon.size()>0)

{

Trigger.new[0].fiber_address__c = gpon[0].id;
}}

 

The issue I am having is that when I insert new records, I use the Apex Data Loader and am sometimes inserting hundreds or thousands of records at a time. What am I missing here so that the trigger fires on all records and not just the first record in the batch? I am still fairly green on code writing.


Any help is appreciated.

 

Matt

All:

 

I have the following scenario (and I believe the only way to get what I need is APEX but if there is a better way, please let me know).

 

I have four custom objects - Qualified Addresses, Billed Accounts, Cable Accounts, Internet Accounts and Voice Accounts.

 

Cable Accounts is related to Billed Accounts, Internet Accounts is related to Billed Accounts and Voice Accounts is related to Billed Accounts.

 

Billed Accounts is related to Qualified Addresses.

 

I want to be able to report on Qualified Addresses with Cable Accounts, Internet Accounts and Voice Accounts. I tried related each of those directly to Qualified Addresses but still had the same issues. Is the only way to correct this to write code updating Billed Accounts with informaion from the three related objects?

 

Please let me know if you need any more clarity on the question.

Guys:

 

I am very very green when it comes to Apex Classes/Triggers. I have developed the following code in my sandbox and tested it out and it works when I do tests on the objects:

 

 

trigger FiberQualification on GPON_Address__c (after insert, after update) {
list<Household_Address__c> gpon = [select id,name, fiber_video_eligible__c, property_owner__c, fiber_internet_eligible__c, complex_location__c from Household_Address__c where name=:Trigger.new[0].name];
if(gpon.size()>0)
{
gpon[0].fiber_video_eligible__c = Trigger.new[0].fiber_video_eligible__c;
gpon[0].fiber_internet_eligible__c = Trigger.new[0].fiber_internet_eligible__c;
gpon[0].complex_location__c = Trigger.new[0].complex_location1__c;
gpon[0].property_owner__c = Trigger.new[0].property_owner1__c;
update gpon;
}
}

 

trigger FiberQualification on GPON_Address__c (after insert, after update)

{list<Household_Address__c> gpon = [select id,name, fiber_video_eligible__c, property_owner__c, fiber_internet_eligible__c, complex_location__c from Household_Address__c where name=:Trigger.new[0].name];


if(gpon.size()>0)

{

gpon[0].fiber_video_eligible__c = Trigger.new[0].fiber_video_eligible__c;

gpon[0].fiber_internet_eligible__c = Trigger.new[0].fiber_internet_eligible__c;

gpon[0].complex_location__c = Trigger.new[0].complex_location1__c;

gpon[0].property_owner__c = Trigger.new[0].property_owner1__c;


update gpon;
}}

 

The code works great when I play around with the objects and does what I need it to do. Now I just need to get it into the Production Org. I was told to use Force.com IDE, which I am in, but now it seems I have to write a test class for this to get to 75% and I admit I have no idea how to do so.

 

If someone can use the above code and give me a very brief explanation on what code to add to meet the test requirements and to deploy I would appreciate it.

 

I have tried reading the tutorials but have thus far had no luck.

 

Thanks

All:

 

I have the following trigger built to update a field on a custom object based on a field match from a second custom object:

 

trigger HouseholdAddressUpdate on Household_Address__c (after update, after insert) {
list<GPON_Address__c> gpon = [select id,name,customer_name__c from GPON_Address__c where name=:Trigger.new[0].name];

if(gpon.size()>0)
{
gpon[0].customer_name__c = Trigger.new[0].customer_name__c;

update gpon;

}
}

This trigger is currently set to run when a record on object Household_Address__C is inserted or updated. I would like to have the trigger activated if a record on EITHER of the custom objects is inserted or updated.

 

Any help would be appreciated.

 

Thanks,

 

Matt

Hello:

 

I need help writing a basic trigger (at least I think it is basic, I am still new):

 

I have two Custom Objects:

 

Household_Address__C

GPON_Address__C

 

What I would like to do is:

 

1. From the field Name on GPON_Address__C, lookup to see if there is a matching record in Household_Address__C where the name is the same.

 

2. If there is a match, return the value from Customer_Name__c that is in Household_Address__C and put it in the Customer__c field on GPON_Address__C.

 

Long story short, I just want to do the equivelant of a VLOOKUP using GPON_Address__C.name as the reference and using Household_Address__C.name as the match and return Household_Address__C.customer_name__c.

 

Is this possible?

 

Hope this was clear, any help writing the code would be greatly appreciated.

 

Thanks,

 

Matt

Hello:

 

I am still fairly new to Apex and was wondering if what I asking below is even possible.

 

I have two custom obejcts created, one that houses all available addresses and one that I want to calculate a market penetration on, based off of the address object.

 

In GPON_Addresses_c, I have three custom fields labeled as Phone_c, Internet_c, and Video_c. Those fields either contain a 1 if the addresses has the service or is blank if the address does not have the service. The GPON_Address_c object also contains a field labeled Complex_c that identifies what commiunity/building the address resides in.

 

In Rev_Share_Calculation_c, I want each Complex_c (not in a relationship with Complex_c on the GPON_Addresses_c object) to do:

 

(a) a Record Count of the number of times the Complex_c shows up in GPON_Addresses_c

 

(b) sum the number of Phone_c, Internet_c, and Video_c from the GPON_Addresses_C

 

(c) divide the number by the record count

 

I realize this is rather complex and probably backwards way of doing this. If there is a trigger that allows me to do this or a better way to acomplish what I need, please feel free to offer suggestions. I am still a novice on this type of item.

 

Thanks,

 

Matt

 

All:

 

Been searching all day for help, new to APEX triggers, and need to know if anyone can help:

 

I have two customer objects that I am using. I need to run a lookup to pull a field value from one custom object to another.

 

I have the field "Customer Name"  in Household Addresses. I need the value from "Customer Name"  to appear in the "Household Name" field of custom object GPON Addresses, if a certain criteria is met (if the address field is a match). I have tried a VLOOKUP but since the obejcts are not related in the API I cannot get it to work. Please let me know if more detail is needed.

 

Matthew Hampton

Can anyone take a look at the code written below and help me re-write it so that I avoid getting the error message "Duplicate ID in list at Line 23, Column 69".

 

 

trigger FiberUpdate on Fiber_Qualified_Address__c (after insert, after update) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Fiber_Qualified_Address__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Subscriber__c> gpon = [select id, name, fiber_address__c, street_address__c, loc__c, zip_code__c from Subscriber__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0) 
        { List<Subscriber__c> toUpdate=new List<Subscriber__c>(); 
        Map<ID, String> FQAID = new Map<ID, String>(); 
        for(Subscriber__c FQAID2: gpon) { Map<String, Subscriber__c> FQAMap = new Map<String, Subscriber__c>(); 
        for(Subscriber__c foa: gpon) { FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa); } 
        for(Fiber_Qualified_Address__c s: Trigger.new) { if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c)) 
        { Subscriber__c cand = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c); 
        cand.fiber_address__c = s.id; toUpdate.add(cand); } } update toUpdate; }
}
}

 

Any help you can provide is appreciated.

 

Thanks in advance,

 

Matt

All:

 

I have the following trigger written:

 

trigger FiberUpdate on Fiber_Qualified_Address__c (after insert, after update) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Fiber_Qualified_Address__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Subscriber__c> gpon = [select id, name, fiber_address__c, street_address__c, loc__c, zip_code__c from Subscriber__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0) 
        { List<Subscriber__c> toUpdate=new List<Subscriber__c>(); 
        Map<ID, String> FQAID = new Map<ID, String>(); 
        for(Subscriber__c FQAID2: gpon) { Map<String, Subscriber__c> FQAMap = new Map<String, Subscriber__c>(); 
        for(Subscriber__c foa: gpon) { FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa); } 
        for(Fiber_Qualified_Address__c s: Trigger.new) { if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c)) 
        { Subscriber__c cand = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c); 
        cand.fiber_address__c = s.id; toUpdate.add(cand); } } update toUpdate; }
}
}

 

and the following test class:

 

@isTest
private class testfiber{
static testmethod void testmy(){
Subscriber__c obj1 = new Subscriber__c();
obj1.street_address__c ='testadd';
obj1.loc__c = 'testloc';
obj1.zip_code__c = '87483';
insert obj1;

Fiber_Qualified_Address__c obj = new Fiber_Qualified_Address__c();
obj.street_address__c ='testadd';
obj.loc__c = 'testloc';
obj.zip_code__c = '87483';
insert obj;
}
}

 

I built them both in Sandbox, tested them out, acheived what I wanted, depoloyed to production, now I am getting an error:

 

System.QueryException: Non-selective query against large object type (more than 100,000 rows) . Consider an index filter.

 

Can anyone help me re-work the code or test coverage to avoid this error?

 

What I need the code to do is:

 

1. After update or insert of records in Fiber_Qualified_Address__c, take three fields (street_address__c, loc__c and zip_code__c) and lookup to see if there is a record in Subscriber__c that has the same three values in the same three fields.

 

2. If there is a match, create a lookup relationship in field Fiber_Address__c on Subscriber__c with Fiber_qualified_address__c

 

3. If there is no match, do nothing.

 

4. I would be inserting/updating anywhere from 100-1000 fiber qualified addresses at a time.

 

Thanks in advance for any help.

 

Matt

If anyone can help me with this code before I chuck my mouse and keyboard across the room I would appreciate.

 

I have the following code written, tested and deploye don customer object Subscriber__c:

 

trigger SubUpdate on Subscriber__c (before insert) {
Set<String> AddressSet = new Set<String>();
Set<String> LocSet = new Set<String>();
Set<String> ZipSet = new Set<String>();
                    for(Subscriber__c s: Trigger.New)
                             {
                                      AddressSet.add(s.street_address__c);
                                      LocSet.add(s.loc__c);
                                      ZipSet.add(s.zip_code__c);
                              }
                              
list<Fiber_Qualified_Address__c> gpon = [select id,name, street_address__c, loc__c, zip_code__c from Fiber_Qualified_Address__c where street_address__c IN: AddressSet
and loc__c IN: LocSet
and zip_code__c IN: ZipSet];

        if(gpon.size()>0)

        {
                Map<ID, String> FQAID = new Map<ID, String>();
                for(Fiber_Qualified_Address__c FQAID2: gpon)
                {
                Map<String, Fiber_Qualified_Address__c> FQAMap = new Map<String, Fiber_Qualified_Address__c>();
                for(Fiber_Qualified_Address__c foa: gpon)
                {
                            FQAMAP.put(foa.street_address__c + '' + foa.loc__c + '' + foa.zip_code__c, foa);
                }
                for(Subscriber__c s: Trigger.new)
                {
                            if(FQAMAP.containsKey(s.street_address__c + '' + s.loc__c + '' + s.zip_code__c))
                            s.fiber_address__c = FQAMap.get(s.street_address__c + '' + s.loc__c + '' + s.zip_Code__c).Id;
                            }
             }
}
}

 

Long story short, the code takes three pieces of information from the subscriber record, looks to see if there is a matching record on custom object Fiber_Qualified_Addressess__c and if there is, creates a lookup relationship on subscriber. This is done everytime I update or insert new subscriber records.

 

What I need to do now is take the code and tweak it slightly so that it works on Fiber_Qualified_Addresses__c. What I need is the code to work and create the same relationship after insertion of new Fiber_Qualified_Addresses__c records. I have spent three hours so far today working on this with no luck. Any help would be greatly appreciated.

 

Thanks,

 

Matt

I have the following extremely basic code written in my sandbox:

 

trigger SubUpdate on Subscriber__c (before insert) {
list<Fiber_Qualified_Address__c> gpon = [select id,name, street_address__c, loc__c, zip_code__c from Fiber_Qualified_Address__c where street_address__c=:Trigger.new[0].street_address__c
and loc__c=:Trigger.new[0].loc__c
and zip_code__c=:Trigger.new[0].zip_code__c
];

if(gpon.size()>0)

{

Trigger.new[0].fiber_address__c = gpon[0].id;
}}

 

The issue I am having is that when I insert new records, I use the Apex Data Loader and am sometimes inserting hundreds or thousands of records at a time. What am I missing here so that the trigger fires on all records and not just the first record in the batch? I am still fairly green on code writing.


Any help is appreciated.

 

Matt

All:

 

I have the following scenario (and I believe the only way to get what I need is APEX but if there is a better way, please let me know).

 

I have four custom objects - Qualified Addresses, Billed Accounts, Cable Accounts, Internet Accounts and Voice Accounts.

 

Cable Accounts is related to Billed Accounts, Internet Accounts is related to Billed Accounts and Voice Accounts is related to Billed Accounts.

 

Billed Accounts is related to Qualified Addresses.

 

I want to be able to report on Qualified Addresses with Cable Accounts, Internet Accounts and Voice Accounts. I tried related each of those directly to Qualified Addresses but still had the same issues. Is the only way to correct this to write code updating Billed Accounts with informaion from the three related objects?

 

Please let me know if you need any more clarity on the question.

Guys:

 

I am very very green when it comes to Apex Classes/Triggers. I have developed the following code in my sandbox and tested it out and it works when I do tests on the objects:

 

 

trigger FiberQualification on GPON_Address__c (after insert, after update) {
list<Household_Address__c> gpon = [select id,name, fiber_video_eligible__c, property_owner__c, fiber_internet_eligible__c, complex_location__c from Household_Address__c where name=:Trigger.new[0].name];
if(gpon.size()>0)
{
gpon[0].fiber_video_eligible__c = Trigger.new[0].fiber_video_eligible__c;
gpon[0].fiber_internet_eligible__c = Trigger.new[0].fiber_internet_eligible__c;
gpon[0].complex_location__c = Trigger.new[0].complex_location1__c;
gpon[0].property_owner__c = Trigger.new[0].property_owner1__c;
update gpon;
}
}

 

trigger FiberQualification on GPON_Address__c (after insert, after update)

{list<Household_Address__c> gpon = [select id,name, fiber_video_eligible__c, property_owner__c, fiber_internet_eligible__c, complex_location__c from Household_Address__c where name=:Trigger.new[0].name];


if(gpon.size()>0)

{

gpon[0].fiber_video_eligible__c = Trigger.new[0].fiber_video_eligible__c;

gpon[0].fiber_internet_eligible__c = Trigger.new[0].fiber_internet_eligible__c;

gpon[0].complex_location__c = Trigger.new[0].complex_location1__c;

gpon[0].property_owner__c = Trigger.new[0].property_owner1__c;


update gpon;
}}

 

The code works great when I play around with the objects and does what I need it to do. Now I just need to get it into the Production Org. I was told to use Force.com IDE, which I am in, but now it seems I have to write a test class for this to get to 75% and I admit I have no idea how to do so.

 

If someone can use the above code and give me a very brief explanation on what code to add to meet the test requirements and to deploy I would appreciate it.

 

I have tried reading the tutorials but have thus far had no luck.

 

Thanks