• ericszulc
  • NEWBIE
  • 175 Points
  • Member since 2009

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

Hi,

 

I have a visualforce page with one of those salesforce multiselect controls on it where you pick from the left hand box and place the desired options into the right hand box.

 

There is an html label on the control and I need to know what to specify in the "for" attribute for the label. Since the control consists of four different html elements (x_unselected, x_right_arrow, x_left_arrow and x_selected), which one should I associate with the label? Or is it impossible to associate a label with this kind of control?

 

Thanks

 

  • December 15, 2011
  • Like
  • 0

Hi, need your help.

 

I have this Trigger, when i save i get an error. Not able to understand what am i doing wrong? My object API name is Document_ID_c

------------------------

 

trigger UpdateCaseStausonDoc on Dispute_New__c (after update) {
 List<Document_ID_c> openlineitems =
           [SELECT j.id FROM Document_ID_c j 
                WHERE J.Reference_Key1__c IN:Trigger.new
           FOR UPDATE];
.
.
.
---------------------------

Save error: sObject type 'Document_ID_c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Hello,

Can someone please help me with my criteria?

 

I am trying to create a workflow that will send an email only when the contact status = active and when the profile is not = to "non-us sales"

And company_level__c or general_access__c are changed.

 

However, when I test the formula as I have it listed below, it will fire even when the contact status is = to inactive but only when I make edits to the general_access__c text field.

Do I need to include an OR in between the 2 ISCHANGED commands?

 

 

IF (ISNULL($Profile.CreatedDate), false, true) &&
ISPICKVAL(Contact_Status__c , "Active") &&
NOT ($Profile.Name = "non-us sales") &&
ISCHANGED(Company_Level__c) ||
ISCHANGED (General_Access_Notes__c)

 

Your help is appreciated!

 

~Rox

 

Hi,

 

If anyone has experience with dynamic Apex and SendEmailMmessage, i would appreciate some help on a quick question. I am looking to create a Dynamic APEX Query within a SingleEmailMessage and having trouble getting the query to populate the list, and also how to associate the results of the query with the toAddresses string. So far I have the two parts of my class below. Any advice on how to put them together?

 

List<sObject> L = Database.query(' SELECT Member_Email__c FROM Attendee__c WHERE Dining_paid__c = false 

LIMIT 100'

 

String[] toAddresses = new String[] {'bobfossil@hotmail.com'};  

 

Thanks,

 

Bob

Hi,

 

Can someone please give me a hand on the test method for this piece of APEX.

 

Any help would be much appreciated.

 

I have made a start in red below.

 

Thanks

 

Ross

 

 

public class TimeEntry {

    public List<Time_Slot__c> slots {get; set;}
    
    public TimeEntry(){        
        slots = new List<Time_Slot__c>();
        slots.add(new Time_Slot__c());
    }

    public void addrow() {
        slots.add(new Time_Slot__c());
    }
           
    public void removerow(){
        Integer i = slots.size();
        slots.remove(i-1);
    }
           
    public PageReference save() {
        insert slots;
        PageReference home = new PageReference('/a00/o');
        home.setRedirect(true);
        return home;
    }
    
    public static testMethod void TimeEntry() {

    //setup test data  
    Time_Slot__c T = new Time_Slot__c();
    insert t;
    
    //test main controller action 
    List<Time_Slot__c> slots;
          
    }       
}

 

 

Hi!

 

I'm creating a (what I think should be) simple APEX trigger to set an Account record type to a custom Lead field when a Lead is converted to a Contact and a new Account is created. 

 

 

trigger LeadConvert on Lead (after update) {
    if (Trigger.new.size() == 1) {
        if (Trigger.old[0].isConverted == false && Trigger.new[0].isConverted == true) {
            if (Trigger.new[0].ConvertedAccountId != null) {            
                // update the new account type
                Account a = [Select a.Id, a.Type, a.RecordType.Id, a.RecordType.Name From Account a Where a.Id = :Trigger.new[0].ConvertedAccountId];
                a.RecordType.Id = [Select Id from RecordType where Name = :Trigger.new[0].Company_Type__c and SobjectType = 'Account'].Id;
                update a;
            }
        }
    }
}

 Unfortunately, when I try this trigger in the sandbox, I get this error:

 

Error: System.DmlException: Update failed. First exception on row 0 with id 00QQ0000005ZPRUMA4; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadConvert: execution of AfterUpdate caused by: System.SObjectException: Field is not writeable: RecordType.Id Trigger.LeadConvert: line 7, column 17: [] (System Code) External entry point

 

I would appreciate any insight on how to change this seemingly immutable field.

 

 

Thanks!

I have a custom object related to another custom object. When a particular field is updated on the parent object I would like to update a corresponding field on a child object.

 

I am new to Apex coding so might need a bit of hand holding.

 

Essentialy I need to:

 

1. Establish the trigger to happen when an object is updated

2. Get the value for a particular field

3. Evaluate that value  and fire off the next process if a criteria is met. (I think I can handle this one)

4. Reference the child object (? By sorting through all of that child object type where the parent ID field is equal to the parent record ?)

5. Update a field

 

OR (if I am looking to create a new related list item in the child object)

 

5.  Create a new related child object  pre-setting the field values.

 

I'm sure if I had something more then a very redimentary understanding of APEX I could probably figure this out, I thank you in advance for helping by providing me (or pointing me to) relevant examples that I can adapt to meet my needs.

Hello all,

 

I have the scenario where I'd like to have a constant value across all records in an object while being able to update that value frequently.

 

For instance, Let's say I have 3 records in Object A with a field called "value".

 

Record 1) Value:0;

Record 2) Value:5;

Record 3) Value:50;

 

Now, let's say I want a constant that scales all values in, say, a formula field, such that the values are from 0-100. So, constant = 2.0

 

Record 1) Scaled Value:0;

Record 2) Scaled Value:10;

Record 3) Scaled Value:100;

 

Now, imagine i added a fourth record

 

Record 4) Value:100;

 

And now the constant = 1.0;

 

Record 1) Scaled Value:0;

Record 2) Scaled Value:5;

Record 3) Scaled Value:50;

Record 3) Scaled Value:100;

 

What's the smoothest way to accomplish this? I thought I might be able to change a formula definition within an Apex trigger. Thinking that's not likely. Is there a way to define a field with a constant value. Again, I'd have to be able to change via an Apex trigger or scheduled code.

 

The only solution I have so far, is to just have lookup fields to another object (object b) that contains all the constants. Change the values in this second object's records and repeatedly check every record of object A  to ensure that it's always pointing to the right record in Object b. Of course, this seems to be quite awkward.

 

Are there any other possibilities that I'm missing?

 

 

Hello All,

 

I have a bit of a quandry. Excuse me if I'm a bit out of my element while trying to describe this, but here goes... I'd like to write a generic getter setter function in apex such that I can state any variable and have a single function handle the request. And I have to be able to use the get function from visualforce -- so I can't pass in a parameter into the function, correct? For instance, let's say I have three String variables.

 

String a;

String b;

String c;

 

And I write get functions as normal.

 

String getA() {return a;}

String getB() {return b;}

String getC() {return c;}

 

All is good and works easily with visualforce. But in my case I have possibly hundreds of variables, and would prefer not to write get function for every single one. I'm envisioning something like:

 

String get(String x) {return x;}

 

But, of course, that doesn't seem to work. Is there a way to make what I've described work?

 

Thanks in advance.

e.

Hello Everyone,

 

I'm trying to make some files we uploaded into salesforce crm content downloadable or accessible by another page via Sites. For instance, say, an mp3, either downloaded or requested by mediaplayer on a webpage.

 

According to the docs 'To download a document via the API, you must export the VersionData of the document.'

 

Well... I've tried a couple variations with a visualforce page to retrieve/export the contentversion, but (as expected) no luck.

 

Does anyone have any good ideas on how to do this?

 

Thanks in advance,

e.

Hi,

 

I have a visualforce page with one of those salesforce multiselect controls on it where you pick from the left hand box and place the desired options into the right hand box.

 

There is an html label on the control and I need to know what to specify in the "for" attribute for the label. Since the control consists of four different html elements (x_unselected, x_right_arrow, x_left_arrow and x_selected), which one should I associate with the label? Or is it impossible to associate a label with this kind of control?

 

Thanks

 

  • December 15, 2011
  • Like
  • 0

Is there any wildcard or way to setup so it doesn't do an exact match.

 

I want to do a redirect anytime it hits a relative url like /detail/foo ... however if it has a querystring it ignores it  so this does nothing 

/detail/foo?id=xxxxxxxxxxxxxxxx

 

Tried a variety of different formats but no luck.  Not sure it is possible.

 

Thanks

  • September 14, 2011
  • Like
  • 0

Hi, need your help.

 

I have this Trigger, when i save i get an error. Not able to understand what am i doing wrong? My object API name is Document_ID_c

------------------------

 

trigger UpdateCaseStausonDoc on Dispute_New__c (after update) {
 List<Document_ID_c> openlineitems =
           [SELECT j.id FROM Document_ID_c j 
                WHERE J.Reference_Key1__c IN:Trigger.new
           FOR UPDATE];
.
.
.
---------------------------

Save error: sObject type 'Document_ID_c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

I have based this code off of the VF Quote tool created by Salesforce.com Labs a couple of years back.

 

Esentially, I'm trying to take similar line items and get rid of them from the List and aggregate the quantity.  I end up with extra lines in my list for some reason.  I have a feeling it's because I'm trying to remove elements while in the loop, but I can't figure out another way to do this.

 

Any help is appreciated.

 

 

Quote_Item__c[] items = new Quote_Item__c[]{};
Quote_Item__c[] qiList = new Quote_Item__c[]{};

for(OpportunityLineItem oli:[select Maintenance_End__c, Maintenance_Start__c, quantity, unitprice, ListPrice, pricebookEntry.product2.name, pricebookEntry.product2id, pricebookEntry.product2.sort__c from opportunitylineitem where opportunityid = :opptyId order by pricebookEntry.product2.sort__c ASC]) 
{
	qiList.add(new Quote_Item__c(quantity__c = oli.quantity, unit_price__c = oli.unitprice, List_Price__c = oli.ListPrice, quote__c = renewalQuote.id, name = oli.pricebookentry.product2.name, sort__c = oli.pricebookentry.product2.sort__c, product__c = oli.pricebookentry.product2id, Maintenance_End__c = oli.Maintenance_End__c, Maintenance_Start__c=oli.Maintenance_Start__c));
}

// Iterate through working list
while(qiList.size()>0){
	Set<Id> removeAddress = new Set<Id>();
	Quote_Item__c qiTemp = qiList.get(0);
	removeAddress.add(qiTemp.Id);
	for(Quote_Item__c qi :qiList){
		If(qi.name==qiTemp.name && qi.unit_price__c==qiTemp.unit_price__c && qi.Maintenance_End__c==qiTemp.Maintenance_End__c && qi.Maintenance_Start__c==qiTemp.Maintenance_Start__c)
			{
				removeAddress.add(qi.id);
				qiTemp.Quantity__c += qi.Quantity__c;
			}
	}
	items.add(qiTemp);
	for(Id a : removeAddress){
		for(Integer i=0; i < qiList.size(); i++){
			if(a == qiList.get(i).Id)
			{
				qiList.remove(i);
			}
		}
	}
}

 

 

I am trying to add-on to one of my existing triggers and am running into the following error:

 

 

Error:Apex trigger triggerSendLayoutTask caused an unexpected exception, contact your administrator: triggerSendLayoutTask: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.triggerSendLayoutTask: line 20, column 46

 

 

Here is the code I am editing:

 

 

    List<Custom_Layout_Object__c> gen = [Select id, ready_to_submit_task__c from Custom_Layout_Object__c limit 1];
    Set<Id> gen0 = new Set<Id>();
        Map<Id, user> userMap1 = new Map<Id, user>([select id, Region__c from user where id = :UserInfo.getUserId() and isActive = true]);
       for(Custom_Layout_Object__c l2: trigger.new ){
            if (userMap1.get(l2.createdById).Region__c == 'Europe' && l2.ready_to_submit_task__c == 'Items are Attached'){
           User[] userid = [Select id from User where Name = 'Jasper Schoemaker' ];
               Task ta = new Task(whatID =trigger.new[0].Opportunity__c,ActivityDate=trigger.new[0].Requested_Date_To_Complete_Layout__c,
               subject='Lay-out Requested', ownerid=userid[0].id);
       Database.DMLOptions dmlo = new Database.DMLOptions();
         dmlo.EmailHeader.triggerUserEmail = true;
         database.insert(ta, dmlo);
       Tasks.add(ta);}

 

 

The line I have edited is:

 

            if (userMap1.get(l2.createdById).Region__c == 'Europe' && l2.ready_to_submit_task__c == 'Items are Attached'){

 

I know I need to declare the new field "l2.ready_to_submit_task__c, but am not remembering exactly how in this situation.

 How do I do this?

 

Thank you

 

2.ready_to_submit_task__c 

This ought to be simple, but I can't figure out how to do it - I want to pass an integer number from a VF page to a custom controller to use in a SOQL query.

 

Something like this-

 

     public News_Item__c[] getHeadlines() {
         String recordsCount = ApexPages.currentPage().getParameters().get('recordsCount');
         Integer irecordsCount = integer.valueof(recordsCount);
         return [select Name,
             id,
            Release_Date__c,
            Title__c,
            Synopsis__c,
            Item__c from News_Item__c order by Release_Date__c desc limit :irecordsCount];
     }

 

However, the recordsCount String/Integer needs to be set statically in the VF page so that I can call different numbers of records using the same controller method in different situations.

 

I don't seem to be able to use apex:param, because I'm not clicking any buttons or inputing anything - I just want to set the variable in the page markup.

 

Thanks in advance.

Hello,

Can someone please help me with my criteria?

 

I am trying to create a workflow that will send an email only when the contact status = active and when the profile is not = to "non-us sales"

And company_level__c or general_access__c are changed.

 

However, when I test the formula as I have it listed below, it will fire even when the contact status is = to inactive but only when I make edits to the general_access__c text field.

Do I need to include an OR in between the 2 ISCHANGED commands?

 

 

IF (ISNULL($Profile.CreatedDate), false, true) &&
ISPICKVAL(Contact_Status__c , "Active") &&
NOT ($Profile.Name = "non-us sales") &&
ISCHANGED(Company_Level__c) ||
ISCHANGED (General_Access_Notes__c)

 

Your help is appreciated!

 

~Rox

 

Hi,

 

If anyone has experience with dynamic Apex and SendEmailMmessage, i would appreciate some help on a quick question. I am looking to create a Dynamic APEX Query within a SingleEmailMessage and having trouble getting the query to populate the list, and also how to associate the results of the query with the toAddresses string. So far I have the two parts of my class below. Any advice on how to put them together?

 

List<sObject> L = Database.query(' SELECT Member_Email__c FROM Attendee__c WHERE Dining_paid__c = false 

LIMIT 100'

 

String[] toAddresses = new String[] {'bobfossil@hotmail.com'};  

 

Thanks,

 

Bob

i have a site(force.com sites) which is basically a visualforce page where in i am updating the status field on the Task. When i am accessing the page as admin its working fine but when i open a new browser and type in the url(mycompany.force.com/....), i am unable to update the status field. any ideas?

Hi,

 

In my visualforce page, once the record is submitted the user must be redirected to the record's detail. I am passing the record id to the detail page. I could do this using a standard controller. What I want to do is to display the details using custom controller. Is this possible?

 

How to display the details of the record without using the standard controller?

  • February 20, 2011
  • Like
  • 0

Hi,

 

Can someone please give me a hand on the test method for this piece of APEX.

 

Any help would be much appreciated.

 

I have made a start in red below.

 

Thanks

 

Ross

 

 

public class TimeEntry {

    public List<Time_Slot__c> slots {get; set;}
    
    public TimeEntry(){        
        slots = new List<Time_Slot__c>();
        slots.add(new Time_Slot__c());
    }

    public void addrow() {
        slots.add(new Time_Slot__c());
    }
           
    public void removerow(){
        Integer i = slots.size();
        slots.remove(i-1);
    }
           
    public PageReference save() {
        insert slots;
        PageReference home = new PageReference('/a00/o');
        home.setRedirect(true);
        return home;
    }
    
    public static testMethod void TimeEntry() {

    //setup test data  
    Time_Slot__c T = new Time_Slot__c();
    insert t;
    
    //test main controller action 
    List<Time_Slot__c> slots;
          
    }       
}

 

 

I am trying to create an online student application. The application is quite lengthy, so ideally I want to break it up into multiple pages, using a "next" button. Also, while most of the info is on the student record (PersonAccount), some info goes into custom objs with a master-detail relationship to the student record.

 

I was hoping to do this with cmsForce2, but it looks like this is too complicated for that. If anyone knows a good app or tool to do this, I would love to know. Barring that, I am assuming I am going to have to create custom Visualforce pages with custom controllers.

 

Now I have some experience creating Visualforce pages and writing some apex triggers, but nothing on this scale.

 

So, how would I

1. submit the first page to the PersonAccount (all fields are on the Contact side), retrieve the id and send it as a hidden field to the 2nd page? Would I just extend the Contact controller or do I need to write something new from scratch?

2. submit to the custom objs?

3. If the applicant quits in the middle, to rollback the changes as we do not want a half filled out application?

 

Thanks for speedy answers to any or all of the above mentioned questions and any other advice anyone can give.

  • February 17, 2011
  • Like
  • 0

Hi!

 

I'm creating a (what I think should be) simple APEX trigger to set an Account record type to a custom Lead field when a Lead is converted to a Contact and a new Account is created. 

 

 

trigger LeadConvert on Lead (after update) {
    if (Trigger.new.size() == 1) {
        if (Trigger.old[0].isConverted == false && Trigger.new[0].isConverted == true) {
            if (Trigger.new[0].ConvertedAccountId != null) {            
                // update the new account type
                Account a = [Select a.Id, a.Type, a.RecordType.Id, a.RecordType.Name From Account a Where a.Id = :Trigger.new[0].ConvertedAccountId];
                a.RecordType.Id = [Select Id from RecordType where Name = :Trigger.new[0].Company_Type__c and SobjectType = 'Account'].Id;
                update a;
            }
        }
    }
}

 Unfortunately, when I try this trigger in the sandbox, I get this error:

 

Error: System.DmlException: Update failed. First exception on row 0 with id 00QQ0000005ZPRUMA4; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadConvert: execution of AfterUpdate caused by: System.SObjectException: Field is not writeable: RecordType.Id Trigger.LeadConvert: line 7, column 17: [] (System Code) External entry point

 

I would appreciate any insight on how to change this seemingly immutable field.

 

 

Thanks!

I am trying to create a New Event and a New Task VF page but I don't know what are the syntax for Additional Information, Recurrence, Reminder and the other invitees section.

 

Does anyone have that information?

  • February 15, 2011
  • Like
  • 0

Hi everyone,

 

 

I have a trigger below for which I got help from the discussion board itself but i have not been able to completely resolve it . Below is my Scenario , error and my Trigger code . If  someone could help me please resolve this I would be grateful.

 

Thanks and Regards

 

 

Scenario :

Opportunity Line Items have Products with Product Codes which contain the Strings : FF , RT and (RT and FF). I need to update the account fields “Fit Finder Status “ and “Fit Finder Program “ related to the Opportunity which has products with these product Codes. For an Opportunity with FF string in the product code the  Fit Finder Status  is updated to  ‘Active’ and Fit Finder Program  to ‘Paying-Reg Customer’ .If another product with RT or (RT and FF) is added under the same opportunity the Fit Finder Status  is updated to  ‘Active’ and Fit Finder Program  to ‘Right Track’.

 

 

 

Error : 

FFStatus: execution of AfterUpdate caused by: System.ListException: Duplicate id in list: 001P000000FEbeqIAD: Trigger.FFStatus: line 80, column 9  

The above Id is an Account ID .

 

Trigger Code :

 

trigger FFStatus on Opportunity (after update) {

  String f ='FF';

  String r='RT';

    Set<ID> OppIDs = new Set<ID>();

    Set<ID> AcctIDs = new Set<ID>();

    for(Opportunity o:Trigger.New){

        OppIDs.add(o.id);

        AcctIDs.add(o.accountid);

    }

    Map<ID,Account> ACCTMAP = new Map<ID,Account>([select id,Fit_Finder_Status__c from Account where id in:AcctIDs]);  //create a map list of accounts with the Account ID as the key

    //Added these for debugging

    system.debug('\n\n');//puts a blank line in the debug output

    system.debug('\n\nGOT ' + OppIDs.size() + ' Unique Opportunities in this trigger.');

    system.debug('\n\nGOT ' + AcctIDs.size() + ' Unique Accounts in this trigger.');

    system.debug('\n\n');//puts a blank line in the debug output

    //end debug section 1

 

    List<Account> updACCT = new List<Account>(); //accounts in this list will get updated

    Set<Account> AcctSet = new Set<Account>();

   Map <ID,List<OpportunityLineItem>> OLIOPPMAP  = new Map <ID,List<OpportunityLineItem>> (); //create a map list of OLI with the Opportunity ID as the key, note that each opp could have more than one OLI

    for(OpportunityLineItem oli: [Select o.PricebookEntryId ,o.PricebookEntry.ProductCode,OpportunityID from OpportunityLineItem o where o.OpportunityId in :Trigger.New ]){

        if(OLIOPPMAP.containsKey(oli.OpportunityID)){

            OLIOPPMAP.get(oli.OpportunityID).add(oli);

        }else{

            OLIOPPMAP.put(oli.OpportunityID,new List<OpportunityLineItem>{oli});

        }

    }

     for (Opportunity Op :Trigger.new){

 

       if(OLIOPPMAP.containsKey(Op.id)){

            for (  OpportunityLineItem oli : OLIOPPMAP.get(Op.id) ){

                String pc;

                if(oli.PricebookEntry.ProductCode<>null){

                     pc = oli.PricebookEntry.ProductCode;

                }else{

                     pc ='';

                }

                Boolean Result = pc.Contains(f);  

                Boolean ResultR = pc.Contains(r);  

 

                if ( (Op.StageName== 'Won' || Op.StageName=='Won - Future Activation Date' ) && Result == True ){

                    Account tmpAccount = ACCTMAP.get(Op.AccountID);

                    tmpAccount.Fit_Finder_Status__c = 'Active';

                    tmpAccount.Fit_Finder_Program__c='Paying - Reg Customer';

                    AcctSet.add(tmpAccount);

                   system.debug('\n\nAcctSet has'   +AcctSet.size() + ' records');

                }

                 else if ( ((Op.StageName== 'Won' || Op.StageName=='Won - Future Activation Date' ) && ResultR == True)){

                    Account tmpAccountR  = ACCTMAP.get(Op.AccountID);

                    tmpAccountR.Fit_Finder_Status__c = 'Active';

                    tmpAccountR.Fit_Finder_Program__c='Right Track';

                  AcctSet.add(tmpAccountR);

                system.debug('\n\nAcctSet has'   +AcctSet.size() + ' records');

                    }

                  else if((Op.StageName== 'Won' || Op.StageName=='Won - Future Activation Date' ) && (ResultR == True && Result == True) ){

                     Account tmpAccountRF= ACCTMAP.get(Op.AccountID);

                     tmpAccountRF.Fit_Finder_Status__c = 'Active';

                     tmpAccountRF.Fit_Finder_Program__c='Right Track';

                    AcctSet.add(tmpAccountRF);

                    system.debug('\n\nAcctSet has'   +AcctSet.size() + ' records');

                    }

 

 

 

            }

          }

        }

     //start Debug section 2

 

       system.debug('\n\nAcctSet has'   +AcctSet.size() + ' records');

 

     // end Debug Section 2

 

     updACCT.addall(AcctSet);

 

 

     //start Debug section 3

 

     system.debug('\n\nupdACCT has ' +updACCT.size() +  ' records');

 

     //updACCT should have the same number of items as AcctSET does

 

     //end Debug Section 3

 

 try{

        update updACCT;    <<----- This the line 80 where the error refers to.

    }catch(DMLException d){

        system.debug('\n\nERROR UPDATING ACCOUNTS:  '+d.getDMLMessage(0));

    }

}

 

 

 

 

 

 

I have a custom object related to another custom object. When a particular field is updated on the parent object I would like to update a corresponding field on a child object.

 

I am new to Apex coding so might need a bit of hand holding.

 

Essentialy I need to:

 

1. Establish the trigger to happen when an object is updated

2. Get the value for a particular field

3. Evaluate that value  and fire off the next process if a criteria is met. (I think I can handle this one)

4. Reference the child object (? By sorting through all of that child object type where the parent ID field is equal to the parent record ?)

5. Update a field

 

OR (if I am looking to create a new related list item in the child object)

 

5.  Create a new related child object  pre-setting the field values.

 

I'm sure if I had something more then a very redimentary understanding of APEX I could probably figure this out, I thank you in advance for helping by providing me (or pointing me to) relevant examples that I can adapt to meet my needs.