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
rayzhurayzhu 

How to attach a file while creating a new custom record?

I am new and learning salesforce.

 

I created a custom object with attachment related list. However I found that there is no section for attachment when I create a new record, although I can add attachments after I saved the record.

 

Thanks in advance.

 

imuino2imuino2

Well attachments are not directly related with your object. You first need to create a new record and then create the attachment.

Attachments have one parameter to relate each one with your object. Once you inserted a new record of your object, you have to create an attachment, to relate it to your object you just need to put your record id on attachment's ParentId, this field is the one that relates the attachment with your current object record.

 

Ignacio.

gv007gv007

The attachment option you can see in the objects page layout if you selected attachments and notes option at the time of object creation think you missed that.

 

 

Deployed

Object Creation Options (Available only when custom object is first created):

Add Notes and Attachments related list to default page layout
SMasterSMaster

Hi Sir,

 

Please provide me the code for this....

gv007gv007

please check that at the time of object creation did you selected notes&attachment relatated list check box then only you can see after creating the record otherwise u won,t see it.