You need to sign in to do that
Don't have an account?
Fayyad Zahid
Access Case on creation with certain Fields
Hello,
I am quite new to Salesforce and Apex (however I am very familiar with Java), so any help explained in simple terms would be much appreciated.
I am trying to write an Apex Trigger that will simply get the fields (shown below) of a Case on its creation. The fields I am trying to access are:
caseRecord, caseOwner, contactName, accountName, products, priority, status, caseOrigin, customerType, date/timeOpened, ticketDesc, subject, originator, reporter, primaryVendor, secondaryVendor, vendorStatus, createdBy, lastModifiedBy
I believe some of the fields may be custom fields, so I am also wondering how I would get those fields.
I would also like to get any attachments, related cases, and comments on the case, so if someone could tell me how I can access those, that would be very helpful.
Thanks in advance to anyone who puts in the time to help answer my question!
Fayyad
I am quite new to Salesforce and Apex (however I am very familiar with Java), so any help explained in simple terms would be much appreciated.
I am trying to write an Apex Trigger that will simply get the fields (shown below) of a Case on its creation. The fields I am trying to access are:
caseRecord, caseOwner, contactName, accountName, products, priority, status, caseOrigin, customerType, date/timeOpened, ticketDesc, subject, originator, reporter, primaryVendor, secondaryVendor, vendorStatus, createdBy, lastModifiedBy
I believe some of the fields may be custom fields, so I am also wondering how I would get those fields.
I would also like to get any attachments, related cases, and comments on the case, so if someone could tell me how I can access those, that would be very helpful.
Thanks in advance to anyone who puts in the time to help answer my question!
Fayyad
To query the related records, I'd recomend checking out the Write SOQL of the Apex & Database trailhead module. (https://trailhead.salesforce.com/content/learn/modules/apex_database/apex_database_soql)
When working in Apex, you need to reference the fields by their API name. You can find the API names by going to the Salesforce setup page. The exact location in Setup will depend on whether you are using the Classic or Lightning interface.