+ Start a Discussion
RaghubmRaghubm 

How to fetch the ID of the record using the name of the record?

I have 2 objects (Account and case), where Case record will be created from an external source which passes account number as a input, Based on the account number I need to capture Account ID and assocciate the record. Can you please suggest how to go forward for this requirement?
Best Answer chosen by Raghubm
Sam WardSam Ward
This can be achieved with a record triggered flow. 

Critria wants to be something like:

Case is created only
Account Number field on Case is not Blank

Then do a look up on the account where Case.Account Number = Account Number on the account than update the case with the Account Id

All Answers

Sam WardSam Ward
This can be achieved with a record triggered flow. 

Critria wants to be something like:

Case is created only
Account Number field on Case is not Blank

Then do a look up on the account where Case.Account Number = Account Number on the account than update the case with the Account Id
This was selected as the best answer
mukesh guptamukesh gupta
Hi Raghubm,

You need to go with REST API integration with @HttpPut.

Follow Sample code
@RestResource(urlMapping='/Account/*')
global with sharing class AccountManager {

 @httpPut
    global static Account doPutMethod(String Name, Integer AnnualRevenue){
    Map<String,String> paramsMap = RestContext.request.params;
    String accid=paramsMap.get('id');
     Account acc= new Account(Name =name, AnnualRevenue = annualrevenue, Id =accid);
    update acc;
    return acc;
    }
  
  
}



if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh

 
gfdj gfdhggfdj gfdhg
I think there is one way that they mentioned here in the post you can click (https://calculatorsbag.com/) on it and learn about the solution to fetch it.