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
ManjeetManjeet 

Lookup Field Issue in Apex

I have 2 custom object Prospect and CallMemo . CallMemo has an lookup field Prospect Ref No . now when I want to save a call Memo With a Prospect How can I put a correct value in callmemo's prospect ref no . I tried to assign prospect Id to prospect Ref no . But i got an exception .

 

public PageReference save(){
        callMemo.prospect_ref_no__c = selectedProspect.id;
        insert callMemo;

       return null;

}

 

callMemo and selectedProspect are instances of Call_Memo__c and Prospects__c respectively .

 

plzzzzzzz help...

ipsita.biswas@in.v2solutions.comipsita.biswas@in.v2solutions.com

Hi Manjeet,

If Prospect and Prospect Ref No. are two different SObjects, how can you assign Prospect.Id to Prospect Ref No?

Please clearify your problem a little more.

ManjeetManjeet

Prospect and Call Memo are 2 custom object . Prospect ref No is a lookup custom field in callMemo custom object .

i

ipsita.biswas@in.v2solutions.comipsita.biswas@in.v2solutions.com

Hi Manjeet,

Which Object does the look up field 'Prospect Ref No.' refer to?