• aspicciati
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

To preface this question - I know that paid for versions of apps like Jitterbit, Informatica, etc can provide this.  But it seems the only thing they don't allow for in the free versions is either 1. scheduling or 2. saving error and success files to standard names based on process, so that they can be used automatically in the following tasks.  These seem like such basic requests that I have a hard time considering paying huge amounts for full versions of apps just to get this one small additional feature.

What I'm looking to do is the following:

  1. Do a field update to an object (say, 10,000 records) based on an External ID.  For this purpose, the object is a child to Account.
  2. Take the error file (say, 2,000 records from step 1), and query it against another External ID in the system.  So, for example, I want to see if the account's external ID exists or not in our system, as that could be one reason that the update did not occur.
  3. Take the success file that I get from Step 2 to pull some information on the accounts that were in the system, to help determine why the field in step 1 was unable to be updated.

So, long story short, be able to schedule all of these tasks after one another, using the success or failure rows of the previous job/task.

Does anyone know of a 3rd party app that does this for free?  Or any way to do this perhaps using the regular data loader and some combination of the command line and/or 3rd party apps?

Thanks in advance!  I'm going to cross post this in both the customer community and the dev community, as I'm not really sure which this should be on.

Not sure if this is proper etiquette in the forums, but I have a continuation on a previous problem that I think should be a quick fix.  I replied to my past post, but it didnt get bumped to the top, so I'm making a new posting.  Any help in explaining would be great.

 

I am trying to do the same as here (http://boards.developerforce.com/t5/Apex-Code-Development/Stuck-writing-a-basic-trigger-to-update-ownership-of-a-record/m-p/493187), except to have any tasks (autocreated via workflow on a new case) also reassigned.  I am getting a "Save error: Invalid foreign key relationship: Task.WhatId" error on line 9.  Is this because of a similar problem that sfdcfox described in #2 above, whereas the value doesn't exist yet in a trigger?  If so, how do I get the value populated so that I can reference against it?  Or does the "WhatId" field work differently than a regular reference field?

 

Thanks so much!!  And also, for next time, should this be a new thread or is there a way to bump an existing thread to the top of the forum?  Do I need to uncheck the "Solution" that I had marked?

 

public with sharing class TaskClass {

	public static void updateTaskOwner (List<Task> tasks) {
	
    	  // map of opportunities
 			map<id,opportunity> opps = new map<id,opportunity>();
  			// obtain opportunity ids
  			for(Task t:tasks) {
    			opps.put(t.WhatId.opportunity__c,null);
  			}
  			// don't include null id
  			opps.remove(null);
  			// query all opps and place in map
  			opps.putAll([select id,impuser__c from opportunity where id in :opps.keyset()]);
  			// assign owner for each non-null value
  			for(Task t:tasks) {
    			if(opps.containskey(t.WhatId.opportunity__c) && opps.get(t.WhatId.opportunity__c).impuser__c != null) {
      				t.ownerid = opps.get(t.WhatId.opportunity__c).impuser__c;
    			}
  			}
	}
}

 

Really easy problem (I hope!).  This is my first real trigger/class that I'm writing from scratch, so please bear with the n00b-iness :)

 

Here is what I want the code to do:

I have created a lookup relationship on case object to opportunity.  On the opportunity, I have a custom lookup to a user, called ImpUser.  When a case is created by a user from the opportunity page (via a custom button), I want it to be automatically assigned to whoever is being referenced in ImpUser.  That's it!

 

Here is my code:

 

Trigger:

trigger CaseTrigger on Case (before insert, before update) {
if(trigger.isInsert){
//creates list of cases that activated trigger called "cases"
case[] cases = Trigger.new;
//calls CaseClass Class and ReassignCase method, passing in the list
CaseClass.ReassignCase (cases);
} else return;
}

 

Class:

public with sharing class CaseClass {

public static void ReassignCase (case [] cases) {
List<case> newCases = [SELECT Id, Opportunity__r.ImpUser__r.Id, Opportunity__r.ImpUser__c FROM Case];

for(Case c :cases) {
if (c.Opportunity__r.ImpUser__c != null) {
c.OwnerId = c.Opportunity__r.ImpUser__c;
c.Subject = 'Found';
}
else c.Subject = 'Not Found';
}
}

}

 

Error:


When I create a case, it is giving me an error saying that I cannot assign a null value to the owner.  This is why I put in the if statement, and now it is just changing the subject to "Not Found" for all of the cases.  This leads me to believe the problem is with how I defining the owner, and thus the list...?  Because when I hardcode a User Id instead of the variable, it will assign the case correctly.  I honestly think that I just don't understand how to use the list...

 

Any help would be greatly appreciated!  Thanks in advance.

Not sure if this is proper etiquette in the forums, but I have a continuation on a previous problem that I think should be a quick fix.  I replied to my past post, but it didnt get bumped to the top, so I'm making a new posting.  Any help in explaining would be great.

 

I am trying to do the same as here (http://boards.developerforce.com/t5/Apex-Code-Development/Stuck-writing-a-basic-trigger-to-update-ownership-of-a-record/m-p/493187), except to have any tasks (autocreated via workflow on a new case) also reassigned.  I am getting a "Save error: Invalid foreign key relationship: Task.WhatId" error on line 9.  Is this because of a similar problem that sfdcfox described in #2 above, whereas the value doesn't exist yet in a trigger?  If so, how do I get the value populated so that I can reference against it?  Or does the "WhatId" field work differently than a regular reference field?

 

Thanks so much!!  And also, for next time, should this be a new thread or is there a way to bump an existing thread to the top of the forum?  Do I need to uncheck the "Solution" that I had marked?

 

public with sharing class TaskClass {

	public static void updateTaskOwner (List<Task> tasks) {
	
    	  // map of opportunities
 			map<id,opportunity> opps = new map<id,opportunity>();
  			// obtain opportunity ids
  			for(Task t:tasks) {
    			opps.put(t.WhatId.opportunity__c,null);
  			}
  			// don't include null id
  			opps.remove(null);
  			// query all opps and place in map
  			opps.putAll([select id,impuser__c from opportunity where id in :opps.keyset()]);
  			// assign owner for each non-null value
  			for(Task t:tasks) {
    			if(opps.containskey(t.WhatId.opportunity__c) && opps.get(t.WhatId.opportunity__c).impuser__c != null) {
      				t.ownerid = opps.get(t.WhatId.opportunity__c).impuser__c;
    			}
  			}
	}
}

 

Hi there,

 

I'm hoping you can offer some guidance.

 

My boss would like for me to setup a workflow that sends out an email when our maintenance renewals are about to expire. This is usually not a problem if the alert goes to the Account owner, but he wants the following:

 

  • 4 months prior to expiration, email notification to the Account Manager (Account Owner)
  • 3 months prior to expiration. email notification to manager of Account Manager
  • 2 months prior to expiration, email notification to Sales Director (manager of AM manager)
  • 1 month prior to expiration, email notification to Sales Director and Senior Director (manager of Sales Director)
  • 1 week prior to expiration, email to my boss and another individual (not currently in SFDC)

Is there any way that I can create this workflow in SFDC?

 

Thanks!

 

Brian

Really easy problem (I hope!).  This is my first real trigger/class that I'm writing from scratch, so please bear with the n00b-iness :)

 

Here is what I want the code to do:

I have created a lookup relationship on case object to opportunity.  On the opportunity, I have a custom lookup to a user, called ImpUser.  When a case is created by a user from the opportunity page (via a custom button), I want it to be automatically assigned to whoever is being referenced in ImpUser.  That's it!

 

Here is my code:

 

Trigger:

trigger CaseTrigger on Case (before insert, before update) {
if(trigger.isInsert){
//creates list of cases that activated trigger called "cases"
case[] cases = Trigger.new;
//calls CaseClass Class and ReassignCase method, passing in the list
CaseClass.ReassignCase (cases);
} else return;
}

 

Class:

public with sharing class CaseClass {

public static void ReassignCase (case [] cases) {
List<case> newCases = [SELECT Id, Opportunity__r.ImpUser__r.Id, Opportunity__r.ImpUser__c FROM Case];

for(Case c :cases) {
if (c.Opportunity__r.ImpUser__c != null) {
c.OwnerId = c.Opportunity__r.ImpUser__c;
c.Subject = 'Found';
}
else c.Subject = 'Not Found';
}
}

}

 

Error:


When I create a case, it is giving me an error saying that I cannot assign a null value to the owner.  This is why I put in the if statement, and now it is just changing the subject to "Not Found" for all of the cases.  This leads me to believe the problem is with how I defining the owner, and thus the list...?  Because when I hardcode a User Id instead of the variable, it will assign the case correctly.  I honestly think that I just don't understand how to use the list...

 

Any help would be greatly appreciated!  Thanks in advance.