• roysmith601.3493067652527424E1
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 28
    Replies

I create custom object ="opptyProduct" on opportunity object .I create five (5) fields on custom object = optty Product and the fileds description is below:
Field # 1:Application Received By(which is lookup(user)field)
field #2 : Closing Stage (pick list field; option is received, complete )
field # 3: Closing Stage Owner ((which is lookup(user)field)

Field # 4: Application Received (which is date field)
Field # 5: Processing  (which is date field)


I have the following requirments :

 

Requirments #1:
If “Application Received By” not null
then
condition # 1 : set Closing Stage = recieved
and 

condition # 2 : set Closing Stage Owner = Application Received By

 

Requirments #2:
If processing  not null
then
condition # 1 : set Closing Stage = complete
and 

condition # 2 : set Closing Stage Owner = blank



Examples:

Example # 1:

When prcoess = 10/19/12 then Closing Stage = closing and Closing Stage Owner = blank (null).

 

Example # 2:

When user edit the same record from example # 1.

When Application Received by = steve then Application Received = 10/19/12, Closing Stage = recieved and Closing Stage Owner = steve.

 

Example # 3:

When user edit the  same record  from example # 2 .

When prcoess = 10/20/12 then Closing Stage = closing and Closing Stage Owner = blank (null) and no change to

Application Received by = steve then Application Received = 10/19/12 record.

 

Example # :4

 When user edit the same record  from example # 3.

When prcoess = blank (null) then desire result; Closing Stage = recieved ;Application Received by = steve then  Application Received = 10/19/12 record.

 

I am nre to salesforce and I don’t know that how to write trigger.

Please help me.

Thanks

 

 

 

Hi,
I have question about workflow and Trigger.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)

Field # 2: Application Received (which is date filed)
Field # 3 : Closing Stage (pick list field; option s are  received, closing)
Field # 4: Closing Stage Owner ((which is text field)

Field # 5: Process (which is date field)


Requirment # 1:

The reuirment is that

 If the “processing” field not Null (date picked by user)

 Then

Set

Condition # 1:  “closing stage = closing”

And

Condition # 2: “closing stage owner = null (blank field)”.


Requirment # 2:

The reuirment is that:
If Application Received By not null (user selects some name of the user in the field)
Then

Set

condition # 1: Application Received = todays date (date when user pick enter this record )

condition # 2 : Closing Stage = recieved
and 

condition # 3 : Closing Stage Owner = Application Received By

Example: If  Application Received By = steve then according to workflow it should update the Application Received =  todays date(10/19/12) ,Closing Stage = recieved and Closing Stage Owner =steve


I create workflow for both of the requirments  and i am able to satisfy the requirment #1 and 2 .  when i select the requirment # 2 first then working fine and if I edit the record and change it to requirment # 1 and this satify the reuirment but the problem is that if I remove the the date from Processing date filed nad levae the field blank then the Closing satge field should chagne from “Closing “to “received” but its not going   . 
I am new to salesforce and I don’t know that how to complete this requirment. Do I have to modify my workflow orcreate new workflow or do something else (trigger).If I have to create trigger then please help me for this because I don’t know that how to create trigger

thanks

Hi,
I have question about workflow and Trigger.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)

Field # 2: Application Received (which is date filed)
Field # 3 : Closing Stage (pick list field; option s are  received, closing)
Field # 4: Closing Stage Owner ((which is text field)

Field # 5: Process (which is date field)


Requirment # 1:

The reuirment is that

 If the “processing” field not Null (date picked by user)

 Then

Set

Condition # 1:  “closing stage = closing”

And

Condition # 2: “closing stage owner = null (blank field)”.


Requirment # 2:

The reuirment is that:
If Application Received By not null (user selects some name of the user in the field)
Then

Set

condition # 1: Application Received = todays date (date when user pick enter this record )

condition # 2 : Closing Stage = recieved
and 

condition # 3 : Closing Stage Owner = Application Received By

Example: If  Application Received By = steve then according to workflow it should update the Application Received =  todays date(10/19/12) ,Closing Stage = recieved and Closing Stage Owner =steve


I create workflow for both of the requirments  and i am able to satisfy the requirment #1 and 2 .  when i select the requirment # 2 first then working fine and if I edit the record and change it to requirment # 1 and this satify the reuirment but the problem is that if I remove the the date from Processing date filed nad levae the field blank then the Closing satge field should chagne from “Closing “to “received” but its not going   . 
I am new to salesforce and I don’t know that how to complete this requirment. Do I have to modify my workflow orcreate new workflow or do something else (trigger).If I have to create trigger then please help me for this because I don’t know that how to create trigger

thanks

Hi,
I have question about workflow.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)
field #2 : Closing Stage (pick list field; option is recieved)
field # 3: Closing Stage Owner ((which is lookup(user)field)

I have the requirment that :
If Application Received By not null
then
condition # 1 : set 
Closing Stage = recieved
and 

condition # 2 : set Closing Stage Owner = Application Received By

Example: If  
Application Received By = steve then according to workflow it should update the Closing Stage = recieved and Closing Stage Owner =steve

I create workflow for this and i am able to satisfy the condition # 1  but I am not to create work field update for condition # 2. 
I am new to salesforce and could anyone of you help.

thanks

Hi,
I have question about workflow.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)
field #2 : Closing Stage (pick list field; option is recieved)
field # 3: Closing Stage Owner ((which is lookup(user)field)

I have the requirment that :
If Application Received By not null
then
condition # 1 : set 
Closing Stage = recieved
and 

condition # 2 : set Closing Stage Owner = Application Received By

Example: If  
Application Received By = steve then according to workflow it should update the Closing Stage = recieved and Closing Stage Owner =steve

I create workflow for this and i am able to satisfy the condition # 1  but I am not to create work field update for condition # 2. 
I am new to salesforce and could anyone of you help.

thanks

Hi,
I have question about workflow.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)
field #2 : Closing Stage (pick list field; option is recieved)
field # 3: Closing Stage Owner ((which is lookup(user)field)

I have the requirment that :
If Application Received By not null
then
condition # 1 : set Closing Stage = recieved
and 
condition # 2 : set Closing Stage Owner = Application Received By

Example: If  Application Received By = steve then according to workflow it should update the Closing Stage = recieved and Closing Stage Owner =steve

I create workflow for this and i am able to satisfy the condition # 1  but I am not to create work field update for condition # 2. 
I am new to salesforce and could anyone of you help.

thanks

Hi,

I create a custom object "opp product"  and the reuirment is below:

field # 1: Process (which is flied date)

field # 2 : closing stage (which is pick list )

field # 3 : closing stage owner  (which is lookup field on oppportunity)

field # 3 : App recieved by  (which is lookup field on user)

 

the requirment is that if the processing filed had  date picked and closing stage = app recv then closing stage owner  should be App recieved by .

I am not sure that how to write a validation rule for this.

please help me and i am new to salesforce.

thanks

Hi,

I create a custom object "opp product"  and the reuirment is below:

field # 1: Process (which is flied date)

field # 2 : closing stage (which is pick list )

field # 3 = closing stage owner  (which is lookup field on oppportunity)

the reuirment is that if the processing filed had no date picked and closing stage = close complete then closing stage owner  should be null.

I am not sure that how to write a validation rule for this.

please help me and i am new to salesforce.

thanks

 

I have to add record type to my record. for example, if user click on event and we have 4 record type but we want to this functionlaity to work for only one event record.

 

I enter the if statement but i am getting the following error:

Error: Compile Error: Variable does not exist: t.Subject at line 4 column 5

 

my trigger is as follow:

 

trigger eventafter on Event (after insert,after update) {
List<Opportunity> opps = new List<Opportunity>{};

if (t.Subject != null && t.WhatId.getSObjectType() == Opportunity.sObjectType && t.RecordType.Name = 'Opportunity Event')


if(trigger.isInsert)
{
for (Event t : trigger.new)
{
if (t.Subject != null && t.WhatId.getSObjectType() == Opportunity.sObjectType)
{
opps.add(new Opportunity(Id = t.WhatId, StageName = t.Subject));
}
}
}
else
{
for(Event t : trigger.new)
{
if(t.Subject != null
&& t.WhatId.getSObjectType() == Opportunity.sObjectType
&& t.Subject != trigger.oldMap.get(t.Id).Subject)
{
opps.add(new Opportunity(Id = t.WhatId, StageName = t.Subject));
}

}
}

if(opps != null && !opps.isEmpty()){
Database.update(opps);
}
}

 

 Please help that why i am getting this error and how can i reslove this.Also,If i have to use this for Bulk record then how can i use that in my current trigger.

i m new to salesforce so please help me

thanks

 

Hi,

I create trigger on Event Object and this will do the following: If user try to create new event on the related list on opportunity record then If user select anything on Primary focus(picklist) field in event while create new event then after user save the record then it will translate that picklist selected option to stage field in opportunity record.

For example: if user select primary focus = phone then opportuntiy stage hould be update with phone.I have different recprd type on event and opportunities and i want this trigger to be work on selected record types.

here is my trigger but it working but not updating the opportunity stage with what i select while creating event.

please help me figuring this out.

thanks

trigger eventafter on Event (after update) {
List<Opportunity> opps = new List<Opportunity>{};
 
for (Event  t : trigger.new)
{
 
// if the event is related to an Opportunity and the Stage has changed
if (t.Primary_Focus__c != null) {
      List<opportunity> o = [Select Id, StageName From Opportunity Where Id = :t.WhatId];
      if (o.size() >0 ) {
        o[0].StageName = t.Primary_Focus__c;
      }
      opps.add(o[0]);
   }
 
if(opps != null && !opps.isEmpty()){
Database.update(opps);
}
}
}

Hi, 
I am new to salesforce and i have requirment that only current profiles can crate new account record. Example; If i have profile = Test and i want to create new Account on account object then if test profile dont have permission to create new Account then as soon i try to click to "New" button then massage should dsiplay that " you dont have permission to create new account record".
but if i have profile = Admin then becasue admin have permission to create account then he/she should be able to create new account.

 I want the functionality that as soon people who have dont  access to create new account, when they click on "New"  Button on account object then erro should  popup saying that you dont have permission to create new account.
I am not sure that how can i fulfill this requrment or what steps should i need to take.
Please help me 
thanks

Hi,
I am new to salesforce.I have create custom picklist field:"stage" on Event object and requirment is that when user update the event in activity related list on opportuntiy object then the field "Stage" on opportunity object should update on the user selection in event object so whatever option in picklict on stage field in event, it should update the stage field in opportunity object.

For example: if user select stage = Negotiation in event object then opportunity object “stage" will update with Negotiation.

i try to create workflow but it wont help.
Please help me
thanks

 

Hi,
I am new to salesforce.I have create custom picklist field:"stage" on Event object and requirment is that when user update the event in activity related list on opportuntiy object then the field "Stage" on opportunity object should update on the user selection in event object so whatever option in picklict on stage field in event, it should update the stage field in opportunity object.

For example: if user select stage = Negotiation in event object then opportunity object “stage" will update with Negotiation.

i try to create workflow but it wont help.
Please help me
thanks

 

Hi, 
I am new to salesforce and i have requirment that only current profiles can crate new account record. Example; If i have profile = Test and i want to create new Account on account object then if test profile dont have permission to create new Account then as soon i try to click to "New" button then massage should dsiplay that " you dont have permission to create new account record".
but if i have profile = Admin then becasue admin have permission to create account then he/she should be able to create new account.
I am not sure that how can i fulfill this requrment or what steps should i need to take.
please help me 
thanks

Hi, 
I am new to salesforce and i have requirment that only current profiles can crate new account record. Example; If i have profile = Test and i want to create new Account on account object then if test profile dont have permission to create new Account then as soon i try to click to "New" button then massage should dsiplay that " you dont have permission to create new account record".
but if i have profile = Admin then becasue admin have permission to create account then he/she should be able to create new account.
I am not sure that how can i fulfill this requrment or what steps should i need to take.
please help me 
thanks

 

 

Hi,
I have a requirment that when user try to create account with “New” button then the system should only check user profile and if the user profile = Administrator then it only let admin to create new account otherwise it should throw a error that “you don’t hacve permission”

I am confused that how I am going to solve this requirment.

please help me because i am new to salesforce.
thanks

Hi,
I have a requirment that when user try to create account with “New” button then the system should only check user profile and if the user profile = Administrator then it only let admin to create new account otherwise it should throw a error that “you don’t hacve permission”

I am confused that how I am going to solve this requirment.

please help me
thanks

Hi,
I have create custom picklist field:"stage" on activity object and requirment is that when user update the activity then the field "Stage" on opportunity object should update on the user selection in activity object. for example: if user select stage = Negotiation in activity object then opportunity object  stage will update with Negotiation.
i try to create workflow but i wont help.
please help me
thanks

Hi,
I have create custom picklist field:"stage" on activity object and requirment is that when user update the activity then the field "Stage" on opportunity object should update on the user selection in activity object. for example: if user select stage = Negotiation in activity object then opportunity object  stage will update with Negotiation.
i try to create workflow but i wont help.
please help me
thanks

Hi,
I create new date field on opportunity object and i want this field to be first filled by user while creating new opportunity record and then after that this field should be locked and i create the vaidation rule for this on new created fields and rule like this:

validation rule on opportunity object and here is the syntax :

AND( 
ISCHANGED( Original_Close_Date__c ), 
NOT( ISBLANK( PRIORVALUE( Original_Close_Date__c ) ) ) 
)

But when i test as user then i am still able to change the new field on already creted record..
any idea please help me
thanks

Hi,
I have question about workflow and Trigger.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)

Field # 2: Application Received (which is date filed)
Field # 3 : Closing Stage (pick list field; option s are  received, closing)
Field # 4: Closing Stage Owner ((which is text field)

Field # 5: Process (which is date field)


Requirment # 1:

The reuirment is that

 If the “processing” field not Null (date picked by user)

 Then

Set

Condition # 1:  “closing stage = closing”

And

Condition # 2: “closing stage owner = null (blank field)”.


Requirment # 2:

The reuirment is that:
If Application Received By not null (user selects some name of the user in the field)
Then

Set

condition # 1: Application Received = todays date (date when user pick enter this record )

condition # 2 : Closing Stage = recieved
and 

condition # 3 : Closing Stage Owner = Application Received By

Example: If  Application Received By = steve then according to workflow it should update the Application Received =  todays date(10/19/12) ,Closing Stage = recieved and Closing Stage Owner =steve


I create workflow for both of the requirments  and i am able to satisfy the requirment #1 and 2 .  when i select the requirment # 2 first then working fine and if I edit the record and change it to requirment # 1 and this satify the reuirment but the problem is that if I remove the the date from Processing date filed nad levae the field blank then the Closing satge field should chagne from “Closing “to “received” but its not going   . 
I am new to salesforce and I don’t know that how to complete this requirment. Do I have to modify my workflow orcreate new workflow or do something else (trigger).If I have to create trigger then please help me for this because I don’t know that how to create trigger

thanks

Hi,
I have question about workflow.I create a custom object ="Product" on opportunity object .I create three (3) fields on custom object = Product and the filed description is below:
Field # 1:Application Received By(which is lookup(user)field)
field #2 : Closing Stage (pick list field; option is recieved)
field # 3: Closing Stage Owner ((which is lookup(user)field)

I have the requirment that :
If Application Received By not null
then
condition # 1 : set 
Closing Stage = recieved
and 

condition # 2 : set Closing Stage Owner = Application Received By

Example: If  
Application Received By = steve then according to workflow it should update the Closing Stage = recieved and Closing Stage Owner =steve

I create workflow for this and i am able to satisfy the condition # 1  but I am not to create work field update for condition # 2. 
I am new to salesforce and could anyone of you help.

thanks

Hi,

I create a custom object "opp product"  and the reuirment is below:

field # 1: Process (which is flied date)

field # 2 : closing stage (which is pick list )

field # 3 : closing stage owner  (which is lookup field on oppportunity)

field # 3 : App recieved by  (which is lookup field on user)

 

the requirment is that if the processing filed had  date picked and closing stage = app recv then closing stage owner  should be App recieved by .

I am not sure that how to write a validation rule for this.

please help me and i am new to salesforce.

thanks

Hi,

I create trigger on Event Object and this will do the following: If user try to create new event on the related list on opportunity record then If user select anything on Primary focus(picklist) field in event while create new event then after user save the record then it will translate that picklist selected option to stage field in opportunity record.

For example: if user select primary focus = phone then opportuntiy stage hould be update with phone.I have different recprd type on event and opportunities and i want this trigger to be work on selected record types.

here is my trigger but it working but not updating the opportunity stage with what i select while creating event.

please help me figuring this out.

thanks

trigger eventafter on Event (after update) {
List<Opportunity> opps = new List<Opportunity>{};
 
for (Event  t : trigger.new)
{
 
// if the event is related to an Opportunity and the Stage has changed
if (t.Primary_Focus__c != null) {
      List<opportunity> o = [Select Id, StageName From Opportunity Where Id = :t.WhatId];
      if (o.size() >0 ) {
        o[0].StageName = t.Primary_Focus__c;
      }
      opps.add(o[0]);
   }
 
if(opps != null && !opps.isEmpty()){
Database.update(opps);
}
}
}

Hi, 
I am new to salesforce and i have requirment that only current profiles can crate new account record. Example; If i have profile = Test and i want to create new Account on account object then if test profile dont have permission to create new Account then as soon i try to click to "New" button then massage should dsiplay that " you dont have permission to create new account record".
but if i have profile = Admin then becasue admin have permission to create account then he/she should be able to create new account.

 I want the functionality that as soon people who have dont  access to create new account, when they click on "New"  Button on account object then erro should  popup saying that you dont have permission to create new account.
I am not sure that how can i fulfill this requrment or what steps should i need to take.
Please help me 
thanks

Hi,
I am new to salesforce.I have create custom picklist field:"stage" on Event object and requirment is that when user update the event in activity related list on opportuntiy object then the field "Stage" on opportunity object should update on the user selection in event object so whatever option in picklict on stage field in event, it should update the stage field in opportunity object.

For example: if user select stage = Negotiation in event object then opportunity object “stage" will update with Negotiation.

i try to create workflow but it wont help.
Please help me
thanks

 

Hi,
I have create custom picklist field:"stage" on activity object and requirment is that when user update the activity then the field "Stage" on opportunity object should update on the user selection in activity object. for example: if user select stage = Negotiation in activity object then opportunity object  stage will update with Negotiation.
i try to create workflow but i wont help.
please help me
thanks

Hi I created a custom object called Win_Loss_Analysis__c within the opportunity and am trying to create a trigger that will automatically create a new analysis after the Opportunity is Stage is set to closedwon. The Field name of the stage field is: StageName.

 

Can someone please guide me in the right direction on how will this appex trigger look or how to get it started I really apreciate it, I'm new to Apex and am trying to learn. The object Win_Loss_Analysis__c has multiple page layouts and record types so basically when a user sets the opportunity stage to close lost we have a required dependent field called Loss Analysis with three values (Price, Product feature, relationship) based on the value they choose we have pagelayouts tied to record types that determine which values will show.

 

I just want the Win_Loss_Analysis__c to automatically create when these fields are updated based on the choices the user picked and then we will have workflow tied to the Win_Loss_Analysis__c to send an email to the opportunity owner reminding them to complete the Win_Loss_Analysis__c.

 

Any help will be appreciated, thank you

Hi. I'm looking to create some Apex code that changes the record type of an opportunity to 'Multi' when brands/products from more than one Product Family are added to a single opportunity.

 

So the workflow is this:

 

1. User clicks New button to create a new opportunity

2. User chooses a record type for that opty -- Media, Events, etc.

3. User fills in opportunity info and chooses various products/brands to attach to that opty. Each brand/product has a Product Family.

4. Apex code is triggered when brands/products are added to the opty that are from more than one Product Family (not necessarily just two or more products, which could all be from the same Product Family) -- this would trigger the record type for that opty to be a) changed to Multi and b) the record type set to read-only. (optional) If the products/brands for that opty are changed again, the record type would revert to the original record type.

 

I'm not an Apex developer and I'm not sure where to start here. I'm hoping someone can point me in the right direction. Thanks in advance.

 

On the standard CampaignMember object, I have a custom lookup field that I am trying to populate....It links to the Lead object and is called "SFDC_Lead__c".

 

I'm trying to create a trigger that populates this fields with the value from the standard campaignmember field "Lead".  This is what I have so far, although it doesn't work:

 

trigger SetCampaignMemberLeadField on CampaignMember (before insert, before update) {    for (CampaignMember a : Trigger.new) {        a.SFDC_Lead__c = a.Lead.Id;    }}

 

I have written a simple trigger that populates a custom lookup field on the Contact object with the Data from a Standard lookup field on the Account object.

 

I am having some issue testing this trigger as everytime I try to create a dummy contact to test on I get an error.

 

Here is the trigger:

 

trigger PopulatePracticeContact on Contact (before update, before insert) { //Set of Account Ids Set<Id> AccountIds = new Set<Id>(); for (Contact contactNew : Trigger.new) { AccountIds.add(contactNew.AccountId); //A set of Accounts } Map<Id, Account> pAccounts = new Map<Id, Account>([SELECT a.id, a.parentid, a.Name FROM Account a WHERE a.id IN :AccountIds]); for(Contact fcon : Trigger.New){ fcon.Related_Practice_Account__c = pAccounts.get(fcon.AccountId).ParentId; } }

 

 

Here is what I have started for the Test Class... I am not really sure how to test this anyway, so any suggestions would be greatly appreciated.

 

public with sharing class PopulatePracticeContactTest {

  static testMethod void PopulatePracticeContactTest(){

 

Account pAcc1 = new Account(Name = 'TestAccount1', BillingState = 'MN', Practice_ID__c = '1234', Operational_status__c = 'Prospect', recordTypeId = '012700000009R7B');

insert pAcc1;

Account fAcc1 = new Account(Name = 'TestAccount2', BillingState = 'OH', Facility_ID__c = '4321', Operational_status__c ='Pending', recordTypeId = '012700000009R7G', ParentId = pAcc1.id);

insert fAcc1;

 

Contact pCon1 = new Contact(LastName = 'TestContact1', AccountId = pAcc1);

insert pCon1;

Contact fCon1 = new Contact(LastName = 'TestContact2', AccountId = fAcc1);  insert fCon1;

 

}

}

 

The error that I get is this:

 

Save error: Invalid initial expression type for field Contact.AccountId, expecting: Id PopulatePracticeContactTest.cls 

 

Update: I didn't review this before I posted it - I did make a copy/paste error I just pasted the trigger twice.  The test class that I actually started writing is now added.

Message Edited by MSVRad on 09-08-2009 06:44 AM
  • September 03, 2009
  • Like
  • 0

I am trying to pre-populate a custom lookup field on the Contact object with an account. This Account is the parent of the Account in the standard "Account Name" field on the Contact page. Facility is a child account, Practice is a parent account.

 

Here is what I have. It does not work - this is probably the 5th version of this trigger I have tried writing. I have logged a case with premier support - it has been escalated but I have not heard anything back.

 

Any Suggestions would be greatly appreciated.

trigger PopulatePracticeContact on Contact (before insert, before update) { //Set of Account Ids Set<Id> FacilityAccountIds = new Set<Id>(); for (Contact contactNew : Trigger.new) { //Facility Record Type == 012700000009R7G, always Child Account if(contactNew.Account.parentId != null && contactNew.Account.RecordTypeId == '012700000009R7G') { FacilityAccountIds.add(contactNew.AccountId); //A set of Facility Accounts } } Contact [] con = Trigger.new; con = [SELECT c.Id, c.Name, c.Related_Practice_Account__c, c.AccountId FROM Contact c WHERE c.AccountId IN :FacilityAccountIds]; Account [] pAccounts; pAccounts = [SELECT a.id, a.parentid, a.Name, (SELECT id, AccountId, Related_Practice_Account__c, Related_Practice__c FROM Contacts WHERE AccountId IN :FacilityAccountIds) FROM Account a WHERE a.id IN :FacilityAccountIds]; if(con.size()> 0){ if((con[0].AccountId == pAccounts[0].Id) && (pAccounts[0].ParentId != null)){ pAccounts[0].ParentId = con[0].Related_Practice_Account__c; } update con[0]; } }

 

  • August 19, 2009
  • Like
  • 0