You need to sign in to do that
Don't have an account?

How to pass ID for Custom Objects below 3 are custom Objects, Also can anyone help me to know how to pass IDs for Custom Objects all time
public class accconopp {
public Account_Management__c acc{get;set;}
public Contact_Management__c con{get;set;}
public Opportunity_Management__c opp{get;set;}
public accconopp()
{
acc=new Account_Management__c();
con=new Contact_Management__c();
opp=new Opportunity_Management__c();
}
/*
public pagereference Save()
{
insert acc;
con.AccountID=acc.id;
insert con;
opp.AccountID=acc.id;
insert opp;
pagereference pr=new
pagereference('/'+acc.id);
return pr;
}
*/
public pagereference cancel(){
pagereference can= new pagereference('/'+acc.id);
return can;
}
}
How to face errrors while working on custom Objects and IDs
public Account_Management__c acc{get;set;}
public Contact_Management__c con{get;set;}
public Opportunity_Management__c opp{get;set;}
public accconopp()
{
acc=new Account_Management__c();
con=new Contact_Management__c();
opp=new Opportunity_Management__c();
}
/*
public pagereference Save()
{
insert acc;
con.AccountID=acc.id;
insert con;
opp.AccountID=acc.id;
insert opp;
pagereference pr=new
pagereference('/'+acc.id);
return pr;
}
*/
public pagereference cancel(){
pagereference can= new pagereference('/'+acc.id);
return can;
}
}
How to face errrors while working on custom Objects and IDs
Please use you Account Id api name properly from the related custom object:
Setup => Object Manager => Contact Management => Fields & Relationship => Copy the Account Field Name.(Don't use the label)
Thanks,
Maharajan.C