-
ChatterFeed
-
0Best Answers
-
2Likes Received
-
0Likes Given
-
17Questions
-
3Replies
Getting the following error when i am saving the apex class
Hi ,
I am getting the following compile error when saving the apex class
Compile Error: Invalid type: parkService.parksImplPort at line 3 column 1
And find below code:
public class ParkLocator{
public static String[] country(String country){
parkService.parksImplPort park= new parkService.parksImplPort();
String[] parksname = park.byCountry(country);
return parksname;
}
}
I am getting the following compile error when saving the apex class
Compile Error: Invalid type: parkService.parksImplPort at line 3 column 1
And find below code:
public class ParkLocator{
public static String[] country(String country){
parkService.parksImplPort park= new parkService.parksImplPort();
String[] parksname = park.byCountry(country);
return parksname;
}
}
- Bhupathi Yadav
- April 30, 2019
- Like
- 0
- Continue reading or reply
Super badge challenge error
Hi,
I'm getting the following error when checking challenge for 'Improve Navigation in the Sales App and Create a Chatter Group' step.
--> I tried by creating new playground and new DE to check challenge still i am getting same error
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FLIDMDVS
I'm getting the following error when checking challenge for 'Improve Navigation in the Sales App and Create a Chatter Group' step.
--> I tried by creating new playground and new DE to check challenge still i am getting same error
Challenge Not yet complete... here's what's wrong:
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FLIDMDVS
- Bhupathi Yadav
- April 28, 2019
- Like
- 0
- Continue reading or reply
When i am updating long text fields values through apex first value its taking as null
Any resason why its taking as null.
Code whre i am hard coding the value:
Code whre i am hard coding the value:
- Bhupathi Yadav
- February 18, 2019
- Like
- 0
- Continue reading or reply
Custom label code coverage in test class
I am using few custom labels in in my class i have to cover code coverage for that
/* fetch required properties from custom labels*/\
Storefront=System.Label.RLWS_CL_EmbTrack_Storefront;
LOGO=System.Label.RLWS_CF_Logo;
UniversalLogo=System.Label.RLWS_CF_Universal_Logo;
UniversalLogoPrice=System.Label.RLWS_CF_Universal_Logo_Price;
currencies = [Select label from RLWS_Obj_Currency__mdt Limit 100];
Can you please tel how to cover this area
/* fetch required properties from custom labels*/\
Storefront=System.Label.RLWS_CL_EmbTrack_Storefront;
LOGO=System.Label.RLWS_CF_Logo;
UniversalLogo=System.Label.RLWS_CF_Universal_Logo;
UniversalLogoPrice=System.Label.RLWS_CF_Universal_Logo_Price;
currencies = [Select label from RLWS_Obj_Currency__mdt Limit 100];
Can you please tel how to cover this area
- Bhupathi Yadav
- July 11, 2018
- Like
- 0
- Continue reading or reply
Getting Error when i try cal apex method from process builderError like:
Error element myRule_1_A1 (FlowActionCall).
An Apex error occurred: System.DmlException: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: [objectId]: [objectId]
An Apex error occurred: System.DmlException: Process failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, missing required field: [objectId]: [objectId]
- Bhupathi Yadav
- May 15, 2018
- Like
- 0
- Continue reading or reply
I am getting System.NullPointerException: Attempt to de-reference a null object when i try to run test class
This is mycode
Public class OrderApprvlUtility
{
@InvocableMethod
public static void submitForApproval(List<ccrz__E_Order__c> ordids)
{
set<id> orderidsset=new set<id>();
for(ccrz__E_Order__c Ordr:ordids)
{
orderidsset.add(Ordr.id);
}
system.debug(' Inside approval--->' +ordids);
List<ccrz__E_Order__c> orderList=[select id,createdDate,ccrz__OrderStatus__c,ccrz__Account__r.ccrz__E_AccountGroup__c,(select ccrz__Product__r.RLWS_CF_RL_Merch_Division__c from ccrz__E_OrderItems__r ORDER BY CREATEDDATE ASC LIMIT 1) from ccrz__E_Order__c where id =:orderidsset];
system.debug(' Inside approval-AFTER -->' +orderList);
Map<Id,String> orderItemsMerchDiv = new Map<Id,String>();
Set<Id> accountGrpIds= new Set<Id>();
//[0].ccrz__E_OrderItems__r
List<String> merchString=new List<String>();
Map<Id,ccrz__E_Order__c> orderDateMap = new Map<Id,ccrz__E_Order__c>();
for(ccrz__E_Order__c cc: orderList)
{
system.debug(' cc.ccrz__E_OrderItems__r' +cc.ccrz__E_OrderItems__r +' status '+cc.ccrz__OrderStatus__c);
if(null!= cc.ccrz__E_OrderItems__r && cc.ccrz__E_OrderItems__r.size()>0){
orderItemsMerchDiv.put(cc.id, cc.ccrz__E_OrderItems__r[0].ccrz__Product__r.RLWS_CF_RL_Merch_Division__c);
orderDateMap.put(cc.id,cc);
accountGrpIds.add(cc.ccrz__Account__r.ccrz__E_AccountGroup__c);
}
}
// system.debug('#######:' +merchString);
List<ccrz__E_AccountGroupPriceList__c> Acgplst = [select ccrz__AccountGroup__c,RLWS_CF_Account_Executive__r.id, RLWS_CF_Account_Executive__r.name,RLWS_CF_Merch_Div__c from ccrz__E_AccountGroupPriceList__c where RLWS_CF_Merch_Div__c =:orderItemsMerchDiv.values() and ccrz__AccountGroup__c=:accountGrpIds ];
// system.debug([select RLWS_CF_Account_Executive__r.name from ccrz__E_AccountGroupPriceList__c where RLWS_CF_Merch_Div__c ='merchString']);
Map<String,Id> merchDIVAEMaP= new Map<String,Id>();
System.debug('Merch div:' +Acgplst );
for(ccrz__E_AccountGroupPriceList__c accGrp : Acgplst){
merchDIVAEMaP.put(accGrp.RLWS_CF_Merch_Div__c+'!'+accGrp.ccrz__AccountGroup__c, accGrp.RLWS_CF_Account_Executive__r.id);
}
System.debug('Account Executive:' +merchDIVAEMaP);
Map<id,String> orderids=new Map<id,String>();
Approval.ProcessSubmitRequest req ;
Approval.ProcessResult result;
List<Task> taskList = new List<Task>();
Task taskObj;
ccrz__E_Order__c ordObj;
String orderKey;
for(Id OrderId :orderDateMap.keySet())
{
//orderids.put(Ordr.id,Ordr.Name);
req= new Approval.ProcessSubmitRequest();
req.setComments('Submiting for Approval');
req.setObjectId(OrderId);
ordObj = orderDateMap.get(OrderId);
orderKey = orderItemsMerchDiv.get(OrderId)+'!'+ordObj.ccrz__Account__r.ccrz__E_AccountGroup__c;
req.setNextApproverIds(new Id[] {merchDIVAEMaP.get(orderKey)});
result = Approval.process(req);
// ordObj = new ccrz__E_Order__c(Id=orderId);
// orderDateMap.get(orderId).RLWS_CF_Order_Approver__c = merchDIVAEMaP.get(orderItemsMerchDiv.get(orderId));
taskObj = createTaskForApproval(merchDIVAEMaP.get(orderKey), ordObj.id,ordObj.createdDate);
taskList.add(taskObj);
}
if(!taskList.isEmpty()){
Database.DMLOptions dmlo = new Database.DMLOptions();
dmlo.EmailHeader.triggerUserEmail = true;
Database.insert(taskList, dmlo);
}
}
private static Task createTaskForApproval(Id assignId,Id orderId,DateTime orderCreatedDate){
Integer taskDays = Integer.valueOf(RLWS_Obj_Task_Duration__c.getInstance('Task Duration').RLWS_CF_Task_Due_Date_duration__c);
Integer reminderHrs = Integer.valueOf(RLWS_Obj_Task_Duration__c.getInstance('Task Duration').RLWS_CF_Task_Reminder_Hours__c);
Task taskObj = new Task();
taskObj.OwnerId = assignId;
taskObj.WhatId = orderId;
taskObj.IsReminderSet = true;
taskObj.ReminderDateTime = orderCreatedDate.addHours(reminderHrs);
taskObj.Subject = 'Task to Approve Order';
taskObj.Priority = 'Medium';
taskObj.Status = 'Not Started';
taskObj.Type = 'Email';
taskObj.RLWS_CF_From_Order__c = True;
taskObj.ActivityDate=Date.valueOf(orderCreatedDate.addDays(taskDays));
taskObj.Description = 'Task for Approve Order';
// taskObj.RLWS_CF_Task_Type__c ='From Order';
return taskObj;
}
}
Note: New to Apex coding
Can you please help to cover this in test class
my test class
@isTest
public class RLWS_Cls_OrderApprvlUtility_Test {
static testMethod void myTest() {
List<account> accts;
Account a = new Account(Name='TestAccount');
accts.add(a);
//Create an Task Record
Task taskObj = new Task();
taskObj.OwnerId = UserInfo.getUserId();
taskObj.IsReminderSet = true;
taskObj.Subject = 'Task to Approve Order';
taskObj.Priority = 'Medium';
taskObj.Status = 'Not Started';
taskObj.Type = 'Email';
taskObj.ActivityDate=Date.today().addDays(7);
taskObj.Description = 'Task for Approve Order';
insert taskObj ;
List<ccrz__E_Order__c> ordersToCreate= new List<ccrz__E_Order__c>();
ccrz__E_Order__c orderRecord = new ccrz__E_Order__c ();
/* orderRecord.ccrz__BuyerLastName__c = 'Test1';
orderRecord.ccrz__OrderStatus__c= 'Order Submitted';
ordersToCreate.add(orderRecord);
insert ordersToCreate;
*/
for(Integer i=6;i<=100;i++)
{
orderRecord=new ccrz__E_Order__c(ccrz__BuyerLastName__c='Test1',ccrz__OrderStatus__c='Order Submitted');
ordersToCreate.add(orderRecord);
}
insert ordersToCreate;
test.startTest();
//RLWS_Cls_OrderApprvlUtility Ordersubmit = new RLWS_Cls_OrderApprvlUtility ();
RLWS_Cls_OrderApprvlUtility.submitForApproval(ordersToCreate);
test.stopTest();
}
}
Public class OrderApprvlUtility
{
@InvocableMethod
public static void submitForApproval(List<ccrz__E_Order__c> ordids)
{
set<id> orderidsset=new set<id>();
for(ccrz__E_Order__c Ordr:ordids)
{
orderidsset.add(Ordr.id);
}
system.debug(' Inside approval--->' +ordids);
List<ccrz__E_Order__c> orderList=[select id,createdDate,ccrz__OrderStatus__c,ccrz__Account__r.ccrz__E_AccountGroup__c,(select ccrz__Product__r.RLWS_CF_RL_Merch_Division__c from ccrz__E_OrderItems__r ORDER BY CREATEDDATE ASC LIMIT 1) from ccrz__E_Order__c where id =:orderidsset];
system.debug(' Inside approval-AFTER -->' +orderList);
Map<Id,String> orderItemsMerchDiv = new Map<Id,String>();
Set<Id> accountGrpIds= new Set<Id>();
//[0].ccrz__E_OrderItems__r
List<String> merchString=new List<String>();
Map<Id,ccrz__E_Order__c> orderDateMap = new Map<Id,ccrz__E_Order__c>();
for(ccrz__E_Order__c cc: orderList)
{
system.debug(' cc.ccrz__E_OrderItems__r' +cc.ccrz__E_OrderItems__r +' status '+cc.ccrz__OrderStatus__c);
if(null!= cc.ccrz__E_OrderItems__r && cc.ccrz__E_OrderItems__r.size()>0){
orderItemsMerchDiv.put(cc.id, cc.ccrz__E_OrderItems__r[0].ccrz__Product__r.RLWS_CF_RL_Merch_Division__c);
orderDateMap.put(cc.id,cc);
accountGrpIds.add(cc.ccrz__Account__r.ccrz__E_AccountGroup__c);
}
}
// system.debug('#######:' +merchString);
List<ccrz__E_AccountGroupPriceList__c> Acgplst = [select ccrz__AccountGroup__c,RLWS_CF_Account_Executive__r.id, RLWS_CF_Account_Executive__r.name,RLWS_CF_Merch_Div__c from ccrz__E_AccountGroupPriceList__c where RLWS_CF_Merch_Div__c =:orderItemsMerchDiv.values() and ccrz__AccountGroup__c=:accountGrpIds ];
// system.debug([select RLWS_CF_Account_Executive__r.name from ccrz__E_AccountGroupPriceList__c where RLWS_CF_Merch_Div__c ='merchString']);
Map<String,Id> merchDIVAEMaP= new Map<String,Id>();
System.debug('Merch div:' +Acgplst );
for(ccrz__E_AccountGroupPriceList__c accGrp : Acgplst){
merchDIVAEMaP.put(accGrp.RLWS_CF_Merch_Div__c+'!'+accGrp.ccrz__AccountGroup__c, accGrp.RLWS_CF_Account_Executive__r.id);
}
System.debug('Account Executive:' +merchDIVAEMaP);
Map<id,String> orderids=new Map<id,String>();
Approval.ProcessSubmitRequest req ;
Approval.ProcessResult result;
List<Task> taskList = new List<Task>();
Task taskObj;
ccrz__E_Order__c ordObj;
String orderKey;
for(Id OrderId :orderDateMap.keySet())
{
//orderids.put(Ordr.id,Ordr.Name);
req= new Approval.ProcessSubmitRequest();
req.setComments('Submiting for Approval');
req.setObjectId(OrderId);
ordObj = orderDateMap.get(OrderId);
orderKey = orderItemsMerchDiv.get(OrderId)+'!'+ordObj.ccrz__Account__r.ccrz__E_AccountGroup__c;
req.setNextApproverIds(new Id[] {merchDIVAEMaP.get(orderKey)});
result = Approval.process(req);
// ordObj = new ccrz__E_Order__c(Id=orderId);
// orderDateMap.get(orderId).RLWS_CF_Order_Approver__c = merchDIVAEMaP.get(orderItemsMerchDiv.get(orderId));
taskObj = createTaskForApproval(merchDIVAEMaP.get(orderKey), ordObj.id,ordObj.createdDate);
taskList.add(taskObj);
}
if(!taskList.isEmpty()){
Database.DMLOptions dmlo = new Database.DMLOptions();
dmlo.EmailHeader.triggerUserEmail = true;
Database.insert(taskList, dmlo);
}
}
private static Task createTaskForApproval(Id assignId,Id orderId,DateTime orderCreatedDate){
Integer taskDays = Integer.valueOf(RLWS_Obj_Task_Duration__c.getInstance('Task Duration').RLWS_CF_Task_Due_Date_duration__c);
Integer reminderHrs = Integer.valueOf(RLWS_Obj_Task_Duration__c.getInstance('Task Duration').RLWS_CF_Task_Reminder_Hours__c);
Task taskObj = new Task();
taskObj.OwnerId = assignId;
taskObj.WhatId = orderId;
taskObj.IsReminderSet = true;
taskObj.ReminderDateTime = orderCreatedDate.addHours(reminderHrs);
taskObj.Subject = 'Task to Approve Order';
taskObj.Priority = 'Medium';
taskObj.Status = 'Not Started';
taskObj.Type = 'Email';
taskObj.RLWS_CF_From_Order__c = True;
taskObj.ActivityDate=Date.valueOf(orderCreatedDate.addDays(taskDays));
taskObj.Description = 'Task for Approve Order';
// taskObj.RLWS_CF_Task_Type__c ='From Order';
return taskObj;
}
}
Note: New to Apex coding
Can you please help to cover this in test class
my test class
@isTest
public class RLWS_Cls_OrderApprvlUtility_Test {
static testMethod void myTest() {
List<account> accts;
Account a = new Account(Name='TestAccount');
accts.add(a);
//Create an Task Record
Task taskObj = new Task();
taskObj.OwnerId = UserInfo.getUserId();
taskObj.IsReminderSet = true;
taskObj.Subject = 'Task to Approve Order';
taskObj.Priority = 'Medium';
taskObj.Status = 'Not Started';
taskObj.Type = 'Email';
taskObj.ActivityDate=Date.today().addDays(7);
taskObj.Description = 'Task for Approve Order';
insert taskObj ;
List<ccrz__E_Order__c> ordersToCreate= new List<ccrz__E_Order__c>();
ccrz__E_Order__c orderRecord = new ccrz__E_Order__c ();
/* orderRecord.ccrz__BuyerLastName__c = 'Test1';
orderRecord.ccrz__OrderStatus__c= 'Order Submitted';
ordersToCreate.add(orderRecord);
insert ordersToCreate;
*/
for(Integer i=6;i<=100;i++)
{
orderRecord=new ccrz__E_Order__c(ccrz__BuyerLastName__c='Test1',ccrz__OrderStatus__c='Order Submitted');
ordersToCreate.add(orderRecord);
}
insert ordersToCreate;
test.startTest();
//RLWS_Cls_OrderApprvlUtility Ordersubmit = new RLWS_Cls_OrderApprvlUtility ();
RLWS_Cls_OrderApprvlUtility.submitForApproval(ordersToCreate);
test.stopTest();
}
}
- Bhupathi Yadav
- April 20, 2018
- Like
- 0
- Continue reading or reply
- Bhupathi Yadav
- February 20, 2017
- Like
- 0
- Continue reading or reply
What is the use of Scope Parameter in Batch Apex
What is the use of Scope Parameter in Batch Apex?
- Bhupathi Yadav
- December 15, 2016
- Like
- 0
- Continue reading or reply
I have a SOQL query Like: SELECT id,Name from Account ,While Querying Records from Account Objects it's taking more time How to reduce time?
I have a SOQL query Like: SELECT id,Name from Account ,
While Querying Records from Account Objects it's taking more time How to reduce time?
While Querying Records from Account Objects it's taking more time How to reduce time?
- Bhupathi Yadav
- December 15, 2016
- Like
- 0
- Continue reading or reply
Sending bulk emails using batch apex
I want to send bulk emails (like 10000) using batch apex .
Is there an limitation while sending mails using Messaging.SingleEmailMessage.
If it is not, then tel me which is the the way to achieve this?
Is there an limitation while sending mails using Messaging.SingleEmailMessage.
If it is not, then tel me which is the the way to achieve this?
- Bhupathi Yadav
- September 10, 2016
- Like
- 0
- Continue reading or reply
what is use of collections?
Iam new to customization, I want to know In which situation we can go with List,set and map.
- Bhupathi Yadav
- August 23, 2016
- Like
- 2
- Continue reading or reply
- Bhupathi Yadav
- August 21, 2016
- Like
- 0
- Continue reading or reply
- Bhupathi Yadav
- August 19, 2016
- Like
- 0
- Continue reading or reply
Wrapper class_example
public class wrapper_on_account
{
List<wrapperaccount1> wrapaccount=new List<wrapperaccount1>();
List<account> selectedaccountlst=new List<account>();
public List<wrapperaccount1> getAccounts()
{
for(Account a :[select Id, Name, AccountNumber, Phone from Account limit 5])
wrapaccount.add(new wrapperaccount1(a));{I need Explination for this line}
//How it works
return wrapaccount;
}
{
List<wrapperaccount1> wrapaccount=new List<wrapperaccount1>();
List<account> selectedaccountlst=new List<account>();
public List<wrapperaccount1> getAccounts()
{
for(Account a :[select Id, Name, AccountNumber, Phone from Account limit 5])
wrapaccount.add(new wrapperaccount1(a));{I need Explination for this line}
//How it works
return wrapaccount;
}
- Bhupathi Yadav
- July 28, 2016
- Like
- 0
- Continue reading or reply
Compile Error: Variable does not exist: Name at line 6 column 5
This is Simple Apex class
When iam creating account associated contact, Opportunity also create. This code Excuted successfully when it was created, after few days i used it with some modification then it shows the error like 'Variable does not exist: Name'
Public class Acc_Con_Opp_Create
{
public Account Creation()
{
Account acc=new Account();
acc.Name='Poel';
acc.NaicsDesc='uagtt';
insert acc;
Contact cc=new Contact();
cc.AccountId=acc.Id;
cc.LastName='John Paul';
insert cc;
Opportunity opp=new Opportunity();
opp.AccountId=acc.Id;
opp.StageName='Stage';
// Date d=Date.newinstance('2015,11,20');
opp.CloseDate=system.Today();
opp.Name='Apex created Opportunity';
insert opp;
return acc;
}
}
When iam creating account associated contact, Opportunity also create. This code Excuted successfully when it was created, after few days i used it with some modification then it shows the error like 'Variable does not exist: Name'
Public class Acc_Con_Opp_Create
{
public Account Creation()
{
Account acc=new Account();
acc.Name='Poel';
acc.NaicsDesc='uagtt';
insert acc;
Contact cc=new Contact();
cc.AccountId=acc.Id;
cc.LastName='John Paul';
insert cc;
Opportunity opp=new Opportunity();
opp.AccountId=acc.Id;
opp.StageName='Stage';
// Date d=Date.newinstance('2015,11,20');
opp.CloseDate=system.Today();
opp.Name='Apex created Opportunity';
insert opp;
return acc;
}
}
- Bhupathi Yadav
- July 12, 2016
- Like
- 0
- Continue reading or reply
Compile Error: Variable does not exist: name
My scnario was when iam inserting account record automatically associated contact also should insert:
But iam getting error like ;Variable does not exist: name' but i have field Name on account
trigger account_trigger on Account (after insert,after update)
{
if(Trigger.isInsert)
{
List<Contact> ct = new List <Contact>();
for(Account acc : trigger.new)
{
Contact c = new Contact(LastName=acc.name,AccountId=acc.id,MailingStreet=acc.BillingStree,
Phone=acc.Phone);
ct.add(c);
}
insert ct;
}
}
But iam getting error like ;Variable does not exist: name' but i have field Name on account
trigger account_trigger on Account (after insert,after update)
{
if(Trigger.isInsert)
{
List<Contact> ct = new List <Contact>();
for(Account acc : trigger.new)
{
Contact c = new Contact(LastName=acc.name,AccountId=acc.id,MailingStreet=acc.BillingStree,
Phone=acc.Phone);
ct.add(c);
}
insert ct;
}
}
- Bhupathi Yadav
- July 12, 2016
- Like
- 0
- Continue reading or reply
what is use of collections?
Iam new to customization, I want to know In which situation we can go with List,set and map.
- Bhupathi Yadav
- August 23, 2016
- Like
- 2
- Continue reading or reply
Custom label code coverage in test class
I am using few custom labels in in my class i have to cover code coverage for that
/* fetch required properties from custom labels*/\
Storefront=System.Label.RLWS_CL_EmbTrack_Storefront;
LOGO=System.Label.RLWS_CF_Logo;
UniversalLogo=System.Label.RLWS_CF_Universal_Logo;
UniversalLogoPrice=System.Label.RLWS_CF_Universal_Logo_Price;
currencies = [Select label from RLWS_Obj_Currency__mdt Limit 100];
Can you please tel how to cover this area
/* fetch required properties from custom labels*/\
Storefront=System.Label.RLWS_CL_EmbTrack_Storefront;
LOGO=System.Label.RLWS_CF_Logo;
UniversalLogo=System.Label.RLWS_CF_Universal_Logo;
UniversalLogoPrice=System.Label.RLWS_CF_Universal_Logo_Price;
currencies = [Select label from RLWS_Obj_Currency__mdt Limit 100];
Can you please tel how to cover this area
- Bhupathi Yadav
- July 11, 2018
- Like
- 0
- Continue reading or reply
Compile Error: Variable does not exist: name
My scnario was when iam inserting account record automatically associated contact also should insert:
But iam getting error like ;Variable does not exist: name' but i have field Name on account
trigger account_trigger on Account (after insert,after update)
{
if(Trigger.isInsert)
{
List<Contact> ct = new List <Contact>();
for(Account acc : trigger.new)
{
Contact c = new Contact(LastName=acc.name,AccountId=acc.id,MailingStreet=acc.BillingStree,
Phone=acc.Phone);
ct.add(c);
}
insert ct;
}
}
But iam getting error like ;Variable does not exist: name' but i have field Name on account
trigger account_trigger on Account (after insert,after update)
{
if(Trigger.isInsert)
{
List<Contact> ct = new List <Contact>();
for(Account acc : trigger.new)
{
Contact c = new Contact(LastName=acc.name,AccountId=acc.id,MailingStreet=acc.BillingStree,
Phone=acc.Phone);
ct.add(c);
}
insert ct;
}
}
- Bhupathi Yadav
- July 12, 2016
- Like
- 0
- Continue reading or reply