function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KabbKabb 

can some please explain this APEX Code

CustomObject__c =:SessionInvoice.Id

 

 

Vinita_SFDCVinita_SFDC

Hello,

 

This code is syntactically incorrect. CustomObject__c is name of custom object and SessionInvoice.Id represents id of the SessionInvoice. SessionInvoice would be instance of an object.

 

Pelase share complete code for better understanding.

KabbKabb

 String stage = sessionStages.get(index);
                SessionInvoice = [select Id, Name, Address__c, Mailed_to__c, Service_Provider__r.Preferred_Payment_Method__c, Invoice_Date_Time__c, BSB__c, Account_Number__c, Account_Name__c, Telephone__c, Mobile__c, Service_Provider__r.Name, Provider_Contact__c, Facilitator_Telephone_Health_Coach__r.Name, Service_Provider__r.ABN__c, Group__r.Name from Invoice__c where Group__c =:gid and Session_Call__c = :stage order by createddate DESC limit 1];
                InvoiceItems = [select Id, Name, Participant_Name__r.Participant_ID_pc__pc, Participant_Name__r.Name, Unit_Price__c, Total__c, GST__c, Cost_Code__c, DA_Vic_Use_Only__c from Invoice_Item__c where Invoice__c =:SessionInvoice.Id and Status__c = 'Ready to be Invoiced'];

SFDC Integration.ax1901SFDC Integration.ax1901

But, where did you use CustomObject__c =:SessionInvoice.Id ?

There r 2 chances.

1) CustomObject__c is a field and you are trying to pass the Id of the SessionInvoice object record.

2) CustomObject__c is relationship field in an object and you are trying to map the session to that object.