I want to take argument as Interger, Map<Interger, Interger> and Insert the new Account Records according to the 1st args value then i want to insert Contacts under the Accounts those are inserted using second arg like if {1=>3} like for acc 1 there 3 con
Actually i want to pass two argument in my method one is integer and the other one is map<Integer, integer> , then i have to insert records in account by using first argument like i inser 3 records in my account now by the map i want to pass the key as account number and the value as contact ...{1=>3} or {2=>5} just for example i take this when during execution when i pass account = 1 as key then 3 contacts add to 1 account ..same like for others
Actuallly i am new to salesforce and i cant understand how i do this..i make a custom object of name error log and make 4 custom fields in that namly 1.Parent Record Id and Parent Record Name of text type and Error Details of Type Long Text Area and the last one is Parent Record which is a Formula Field: URL.. Now i have to pass two arguments in my method one is list<Account > and other is list<contact> ..now what i am doing in my account list i am populated some record but what i need that like i am populating 10 records then some them are populated with id but some of them not..so as we know that every record has id then how can i poluatated record without id .....then after poplating theste records i have to Update that records where Id is populated and insert the records where Id is not populated. (Use Database.upsert ) ... now at last i have to Check the Database.upsert result and if there is any error with any of the record then it create a new record of Error Log (custom object) for each error. and in my list of contact i have to hold the new contact records and these contact i have to add to those account which are success...like i have 2 contact in my list<contact> then these 2 contact add to all account record like i have 4 succes account record after database.upsert the 2 contact add to each and at last they became 8....then how can i polate record and cause error by which i save these error to my custom object ..for every new error a new record is added .. Can you please help me in this
Hi,
you can start like this.
Please mark it as the Best Answer if it helps you.
Thank You
All Answers
Hi,
why are you using this Map<Interger, Interger>
Your questions are not clear
so please explain with example
are you passing argument from other method?
Hi,
you can start like this.
Please mark it as the Best Answer if it helps you.
Thank You
Now i have to pass two arguments in my method one is list<Account > and other is list<contact> ..now what i am doing in my account list i am populated some record but what i need that like i am populating 10 records then some them are populated with id but some of them not..so as we know that every record has id then how can i poluatated record without id .....then after poplating theste records i have to Update that records where Id is populated and insert the records where Id is not populated. (Use Database.upsert ) ... now at last i have to Check the Database.upsert result and if there is any error with any of the record then it create a new record of Error Log (custom object) for each error.
and in my list of contact i have to hold the new contact records and these contact i have to add to those account which are success...like i have 2 contact in my list<contact> then these 2 contact add to all account record like i have 4 succes account record after database.upsert the 2 contact add to each and at last they became 8....then how can i polate record and cause error by which i save these error to my custom object ..for every new error a new record is added ..
Can you please help me in this