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
Mahesh KGMahesh KG 

how to attach a file to an account in java

Hi Team,

Can you please help me with the code for attaching a pdf file to the account i create.

i am creating account with the below code.

 @HttpPost
    global static ID createAccount(String name,String parent, String accountMgr,String setUpFee) {
        Account restAcc = new Account(
                                      Name=name,
                                      ParentId=parent,
                                      Account_Manager__c=accountMgr, 
                                      Account_Set_up_Fee__c=setUpFee
                                    );
        insert restAcc;
                                    
        return restAcc.Id;

    } 

i need to attach a pdf file to the above created account. i will be using java for creating the account.


Thanks in advance
Mahesh KGMahesh KG
Any update on this?