Skip to main content
Rohit kumar singh が「#Apex」で質問
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
3 件の回答
  1. 2017年2月1日 2:12
    hi Rohit,

    You are right, those are custom objects. 

    The tutorial should have written List<apex_invoice__c> InvoiceList to avoid confusion.

    Let us do a reverse engineering here.

    From what we see in the code, there are two custom objects: apex_invoice__c, APEX_Customer__c.

    ※ APEX_Customer__c has the following fields:

    APEX_Customer_Status__c (picklist: you can put selection like 'Active', 'Not Active' ...)

    ※ apex_invoice__c has the following fields:

    - APEX_Status__c (picklist: you can put selection like 'Pending', 'Approved' ...)

    Then lastly is the 'insert InvoiceList' which will now store all the invoice data to the database...

     
0/9000