• Rohit kumar singh 1
  • NEWBIE
  • 50 Points
  • Member since 2017

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 8
    Replies
trigger Customer_After_Insert on APEX_Customer__c (after update)
{
(*)List InvoiceList = new List();
for (APEX_Customer__c objCustomer: Trigger.new)
{
if (objCustomer.APEX_Customer_Status__c == 'Active')
{
APEX_Invoice__c objInvoice = new APEX_Invoice__c();
(*)objInvoice.APEX_Status__c = 'Pending';
(*) InvoiceList.add(objInvoice);
}
}
}
Can SomeOne Explain me the code flow speciall the "(*)"->Points
Hi everyone,

I am trying to complete the challenge for the "Create Custom Objects and Fields" module as follows:

Create a custom object with 'Trail' as the Label and Object Name. The resulting API name will need to be 'Trail__c'.
The Name field for Trail must be a Text type (not Auto Number).
Add a custom field to Trail of the 'Text Area (Long)' type, which has the field name and label 'Description' and a resulting API name of 'Description__c'. The field should have the default character length of 32,768.
Add a custom field to Trail of the 'Number' type (length of 3 and 0 decimal places), which has the field name and label 'Distance' and a resulting API name of 'Distance__c'.
Add a custom field to Trail of the 'Date' (not 'Date/Time') type, which has the field label 'Last Inspection Date' and name 'Last_Inspection_Date' and a resulting API name of 'Last_Inspection_Date__c'.

I did everything I am supposed to and for whatever reason, it keeps telling me when I click on "check challenge" that it doesn't see the Trail__c object I created (I also figured out the hard way that it adds the __c part automatically and that I didn't have to write it out manually). I tried deleting everything and redoing it, signing out of everything and signing back in and nothing works.  

If you know what to do, I'd really appreciate your advice!

Lisa
How to track the implementation of the trigger.new and trigger.old I am not getting a clear picture on this   . Anyone explain this example making the differences clear.  

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

Thanks and Regard
Rohit kumar singh