• ChristineVW
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 9
    Replies
I have two custom objects, Development Requests and Jobs.  I need changes on a Job record to trigger changes to a picklist field on a related Development Request.  In turn, a limited number of field changes on a Development Request record should trigger changes to a picklist field on a related Case. 

Since Cases are chained to Development Requests, and Development Requests are chained to Jobs  -  through two separate lookup relationships - can I just create two "before update" triggers, one on the Job object, and one on the Development Request object?  Is there anything wrong with that?  It seems weird to have a field change caused by a trigger to instigate the firing of another "before update" trigger. 


My trigger on a Task is failing to do anything because according to the debug log, t.AccountId is null.  The tasks that cause this trigger to fire do have Accounts associated to them.  I have no idea what to do next because otherwise the code shown here and everything in the rest of my Trigger seems to work fine. 

Tasks have a WhatId and an AccountId field, since on a Task there is a Related To dropdown.  If it were related to some other object, it would have a WhatId and, say, a ContactId.  I just noticed this but don't know how it relates to my problem.  How do I grab the ID of the Account that's related to any given task so that I can use it later?

Code:
trigger AssetUpdateServices on Task (before insert) {
for(Task t : trigger.new) {
if(t.Subject != 'Services Session') {
continue;
}
String acid = t.AccountId;
Asset[] assetList = [Select a.Total_Hours__c, a.Hours_Remaining__c, a.Status,
a.Name, a.Issuance_Date__c, a.AccountId From Asset a Where a.AccountId = :acid
Order By Issuance_Date__c];

... etc. etc.

 
I need a trigger to do the following: 

When an Activity ("log a call") is created with a numeric value in one of my custom Activity fields, a numeric field needs to be updated on an Asset.  The Activity getting created will be related to an Account, and in turn, the Account will have several related Assets. 

The trigger needs to get a list of Assets that are related to the common Account and, based on the Asset type or name, the trigger should identify the one Asset that has a numeric field that needs to be updated. 

I am having a hard time with this because while I can write a trigger to update information on the Account, how can I get the information about the related Assets so that I can update one of them?  Do I need TWO triggers, one before insert on the Activity and one before update on an Account? 

Thanks much.
I'm having difficulty with this scenario:  I have a custom button that uses onclick Javascript to create 14 custom object records.  I want each of the custom object records that is created to have a different value in the field Planned Date.  The value should be Created Date + x where x varies across the 14 records. 

Here's the code that isn't working.  (It works fine if I take out the + # and sets Planned Date to the current date for every record.)  I'm trying to add a given number of days to the day on which the record in this batch was created to determine and set the Planned Date of each record: 


var plans = [];

var plandate = new Date();

plans[0] = plandate.setDate(plandate.getDate() + 4);
plans[1] = plandate.setDate(plandate.getDate() + 10);
plans[2] = plandate.setDate(plandate.getDate() + 17);
plans[3] = plandate.setDate(plandate.getDate() + 24);
plans[4] = plandate.setDate(plandate.getDate() + 35);
plans[5] = plandate.setDate(plandate.getDate() + 14);
plans[6] = plandate.setDate(plandate.getDate() + 40) ;
plans[7] = plandate.setDate(plandate.getDate() + 40);
plans[8] = plandate.setDate(plandate.getDate() + 14);
plans[9] = plandate.setDate(plandate.getDate() + 30);
plans[10] = plandate.setDate(plandate.getDate() + 35);
plans[11] = plandate.setDate(plandate.getDate() + 50);
plans[12] = plandate.setDate(plandate.getDate() + 64);
plans[13] = plandate.setDate(plandate.getDate() + 70);

for (var i=0; i<14; i++) {
    var object = new sforce.SObject("Object__c");
...other code...
    object.Planned_Date__c = plans[i];
...other code...
I am unclear about whether Visualforce will allow an organization to make pages externally available (similar to the way Documents can be made externally available).  I see the examples of blog applications and employee / contact directories and especially for a blog wonder if it is possible to make these pages and entries visible somehow to non-users of salesforce.
Do I need apex to do this, or can an s-control accomplish it? 

I have an object called Books, to which Pages are related.  I would like to create a button on the Pages related list so that, on any Book record, I can click the button and automatically generate multiple new Pages. 

Ideally I would like to have the number and type of Pages that are created depend upon the Book's record type and so forth.  For now, though, I just want to figure out how to be able to create a button that generates 10 new Pages records related to the Book. 

Thanks in advance. 
I'm not really sure where this question belongs so I've posted it as well in the Best Practices area.

I need to create a report that will display only those Accounts at which no Cases have been reported in the past 180 days.  My attempt so far has been to create a custom Case formula field that calculates how many days ago a case was reported drawing either from the creation date or a custom field we have in which reps can enter the reported case time: 

Now() - IF(ISNULL(Data_Time_Reported__c), CreatedDate , Data_Time_Reported__c)

And called this field Last Reported Case.

Next I created a Cases with Contacts report to show me the Min and Max value of the Last Reported Case for each Contact.  However, now there is no smart way to filter the report so that it shows me only the Accounts at which all of that Account's Contacts' Last Reported Cases have a value greater than 180. 

If I run an Accounts report, I can't report on the Min or Max values in Last Reported Case, because it is a Case custom field. 

Any ideas?
I have a URL that needs to be entered into a solution.  It is 1436 characters long, and will look ridiculous in the Self Service Portal. :smileysurprised:

Since I have a few solutions that contain these very long URLs or paths, I considered creating an additional Solution custom field in which to enter a web address, but this would have a limitation of 255 characters. 

Alternatively, I could just as easily maintain these particular solutions and use <a href> tags, but this doesn't seem to be a valid option. 

Any suggestions would be greatly appreciated!
Hello,

I have two custom objects, one called Development Request and one called Job.  A Job that a user might create is not always related to a Development Request, but the creation of a Development Request almost always leads to the creation of a new Job

My users would like the ability to create a Job from a Development Request.  They have this ability now as a lookup relationship exists, but ideally, this process would also automatically copy over data from the common fields.  There are about 10 common fields. 

I see this working in something like the following way, but cannot figure out how to accomplish it: 

User creates and saves a Development Request;
On the new Development Request record screen, the user clicks on the "New" button on a Jobs related list;
The user is now creating a new Job; 10 or so of the fields should automatically contain the same information as the Development Request did, and all of this would auto-populate for the user. 

I realize that this is an involved question.  I know how to create Master-Detail and Lookup relationships, and if necessary I can make the Development Request the Master of Jobs.  Is this the solution?  If so, do I then need to use Formula fields to get the "auto-population" to occur?

Thank you in advance for any help you can give me.  :womanhappy:
I have a URL that needs to be entered into a solution.  It is 1436 characters long, and will look ridiculous in the Self Service Portal. :smileysurprised:

Since I have a few solutions that contain these very long URLs or paths, I considered creating an additional Solution custom field in which to enter a web address, but this would have a limitation of 255 characters. 

Alternatively, I could just as easily maintain these particular solutions and use <a href> tags, but this doesn't seem to be a valid option. 

Any suggestions would be greatly appreciated!
Hi guys.....I am new to salesfore.plz let me know the solution.....thanking in advance for your replies
 
Here you go with my prob
 
I have created custom object called AbcClient_c under Standard Account object.
I have  2checkbox fields on the custom object called RC1 and RC2, and a lookup field where i can select an Account.
 
My problem is that.....while creating new record or editing a record,   
If i select RC1 then RC2 should automatically be selected and i should update two fields on the Standard Account object with "XYZ" value.
 
Can any one plz suggest which method is good to do this like trigger,Outbound messages or...........
 
if possible plz give me some idea....or solution.......
 
Waiting for the reply..............
 
Waiting for the reply.....................
 
Waiting for the reply..........
  • June 11, 2008
  • Like
  • 0
I'm still in the initial phase, and can't get Eclipse working properly.
 
I did the full installation, according to the documentation, but half way through the installation I get this error
 
eclipse22714.tmp is not a valid JAR file (error in opening zip-file).
 
The installation terminates, and I tried it several times again, still receiving same error message.
 
Could someone help me ?
 
Thanks
Yes, I tried File > Print but the option is grayed out. I think the Force.com Eclipse Toolkit is disabling printing. Is there anyway to get around this?

If not, can anyone recommend a text editor that can print line numbers correctly.

Thanks,
Jason
My trigger on a Task is failing to do anything because according to the debug log, t.AccountId is null.  The tasks that cause this trigger to fire do have Accounts associated to them.  I have no idea what to do next because otherwise the code shown here and everything in the rest of my Trigger seems to work fine. 

Tasks have a WhatId and an AccountId field, since on a Task there is a Related To dropdown.  If it were related to some other object, it would have a WhatId and, say, a ContactId.  I just noticed this but don't know how it relates to my problem.  How do I grab the ID of the Account that's related to any given task so that I can use it later?

Code:
trigger AssetUpdateServices on Task (before insert) {
for(Task t : trigger.new) {
if(t.Subject != 'Services Session') {
continue;
}
String acid = t.AccountId;
Asset[] assetList = [Select a.Total_Hours__c, a.Hours_Remaining__c, a.Status,
a.Name, a.Issuance_Date__c, a.AccountId From Asset a Where a.AccountId = :acid
Order By Issuance_Date__c];

... etc. etc.

 
I'm having difficulty with this scenario:  I have a custom button that uses onclick Javascript to create 14 custom object records.  I want each of the custom object records that is created to have a different value in the field Planned Date.  The value should be Created Date + x where x varies across the 14 records. 

Here's the code that isn't working.  (It works fine if I take out the + # and sets Planned Date to the current date for every record.)  I'm trying to add a given number of days to the day on which the record in this batch was created to determine and set the Planned Date of each record: 


var plans = [];

var plandate = new Date();

plans[0] = plandate.setDate(plandate.getDate() + 4);
plans[1] = plandate.setDate(plandate.getDate() + 10);
plans[2] = plandate.setDate(plandate.getDate() + 17);
plans[3] = plandate.setDate(plandate.getDate() + 24);
plans[4] = plandate.setDate(plandate.getDate() + 35);
plans[5] = plandate.setDate(plandate.getDate() + 14);
plans[6] = plandate.setDate(plandate.getDate() + 40) ;
plans[7] = plandate.setDate(plandate.getDate() + 40);
plans[8] = plandate.setDate(plandate.getDate() + 14);
plans[9] = plandate.setDate(plandate.getDate() + 30);
plans[10] = plandate.setDate(plandate.getDate() + 35);
plans[11] = plandate.setDate(plandate.getDate() + 50);
plans[12] = plandate.setDate(plandate.getDate() + 64);
plans[13] = plandate.setDate(plandate.getDate() + 70);

for (var i=0; i<14; i++) {
    var object = new sforce.SObject("Object__c");
...other code...
    object.Planned_Date__c = plans[i];
...other code...
Do I need apex to do this, or can an s-control accomplish it? 

I have an object called Books, to which Pages are related.  I would like to create a button on the Pages related list so that, on any Book record, I can click the button and automatically generate multiple new Pages. 

Ideally I would like to have the number and type of Pages that are created depend upon the Book's record type and so forth.  For now, though, I just want to figure out how to be able to create a button that generates 10 new Pages records related to the Book. 

Thanks in advance. 
Hello,

I have two custom objects, one called Development Request and one called Job.  A Job that a user might create is not always related to a Development Request, but the creation of a Development Request almost always leads to the creation of a new Job

My users would like the ability to create a Job from a Development Request.  They have this ability now as a lookup relationship exists, but ideally, this process would also automatically copy over data from the common fields.  There are about 10 common fields. 

I see this working in something like the following way, but cannot figure out how to accomplish it: 

User creates and saves a Development Request;
On the new Development Request record screen, the user clicks on the "New" button on a Jobs related list;
The user is now creating a new Job; 10 or so of the fields should automatically contain the same information as the Development Request did, and all of this would auto-populate for the user. 

I realize that this is an involved question.  I know how to create Master-Detail and Lookup relationships, and if necessary I can make the Development Request the Master of Jobs.  Is this the solution?  If so, do I then need to use Formula fields to get the "auto-population" to occur?

Thank you in advance for any help you can give me.  :womanhappy: