• qsdunn
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 17
    Replies

Hi,

 

 

I have a custom field on task object.i have also create a report including that custom field,Now i want to search some value based on that custom field in report.

 

can any one help me for this.

 

thanks in adv.

If I create a Task and associate it with a particular Contact (using the Task's "Name" field) then that Task appears on the Activity History related list for the Contact's Account as well as on the Activity History of a problem.

 

This means that when multiple Contacts from a large organisation are all sent the same email/mail-merge then the Activity History of that Account is spammed with Tasks and users have to click the "Go To List" link to see the useful information.

 

Is there any way to stop this behaviour? If I wanted these Tasks to show up in the Account's related lists then I would relate them to the Account!!

 

Thanks

  • September 09, 2011
  • Like
  • 0

 I've got a custom object (Awards Attendance) which acts as a junction object between another custom object and Contacts. Essentially, it is used to track the bookings of specific individuals to certain events.

   

To keep them from having to flick backwards and forwards between pages, my users would like me to pull some information from the Contact record through to the page of the Awards Attendance record.

 If they just want to view the data, I can do this just fine with a text formula field on the Awards Attendance (and have set up a temporary solution which does just that).

 

 But (as the title of the post should suggest) I'm having difficulty enabling the editting of the Contact from the Awards Attendance page.

 

I created a page that looked a little like this:

 

<apex:page standardcontroller="Awards_Attendance__c">
<apex:form>
<apex:pageBlock title="Information From Contact Record" mode="inlineEdit" >
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save" id="SaveButton" />
<apex:commandButton action="resetInlineEdit()" value="Cancel" id="CancelButton" />
</apex:pageBLockButtons>
<apex:inlineeditsupport showOnEdit="SaveButton,CancelButton" resetFunction="resetInlineEdit" />
<apex:pageBlockSection>
<apex:outputField value="{!Awards_Attendance__c.contact__r.access_requirements__c}" />
<apex:outputField value="{!Awards_Attendance__c.contact__r.dietary_requirements__c}" />
<apex:outputField value="{!Awards_Attendance__c.contact__r.specific_requirements__c}" />
</apex:pageBLockSection>
</apex:PageBlock>
</apex:form>
</apex:page>

 

and added it to the page layout for Awards Attendances.

But the "Save" button doesn't save any changes to the fields, instead discarding them a display the Awards Attendance page inside itself.

   

I attributed this to the fact that the "save" method being called was that of the standard controller for the Awards Attendance not the one for the Contact.

So I put this page in the Awards Attendance page layout:

 

<apex:page standardController="Awards_Attendance__c" action="{!URLFOR($Page.Contact_Requirements_Display,awards_attendance__c.contact__c,null,true)}" >
  <h1>Redirecting to <apex:outputField value="{!awards_attendance__c.contact__C}" />...</h1>
  Please wait.
 </apex:page>

 

which then redirects to this page:

 

<apex:page standardcontroller="Contact">
<apex:form>
<apex:pageBlock title="Information From Contact Record" mode="inlineEdit" >
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save" id="SaveButton" />
<apex:commandButton action="resetInlineEdit()" value="Cancel" id="CancelButton" />
</apex:pageBLockButtons>
<apex:inlineeditsupport showOnEdit="SaveButton,CancelButton" resetFunction="resetInlineEdit" />
<apex:pageBlockSection>
<apex:outputField value="{!contact.access_requirements__c}" />
<apex:outputField value="{!contact.dietary_requirements__c}" />
<apex:outputField value="{!contact.specific_requirements__c}" />
</apex:pageBLockSection>
</apex:PageBlock>
</apex:form>
</apex:page>

 

But this doesn't work either. It looks it works (with the orange text of unsaved changes being replaced by the normal black when the "Save" button is clicked and nothing crazy happening) but the changes are not actually saved.

 

 

Does anyone see a way to fix this? Or another way to solve this problem which doesn't involve entirely remaking the Awards Attendance page in VIsualforce?

 

EDIT: I tried to put those code blocks in spoiler tags, for ease of readability, but the formatting kept going crazy when I tried to post it like that. Sorry, guys.

 

 

 

 

 

 

 

 

 

 

 

  • March 11, 2011
  • Like
  • 0

I have a custom report over Accounts, Assets and a custom object called Scores.

It's a summary report with data from the Scores being grouped (and summarised) by the name of the Account.

 

Where I'd like to go with it is: grouping the Accounts according to the numbers of Score grouped under them.

I realise the wording of that isn't very clear, so here are some diagrams.

 

I have a report that looks kinda like this:

 

                                                                     Date            Total Score

Account Name: AccountA  (Record Count 2)                               

                                                                 03/12/10              40%      

                                                                 15/08/10              30%      

Account Name: AccountB  (Record Count 1)                               

                                                                 17/08/10              55%     

Account Name: AccountC  (Record Count 2)                               

                                                                 27/09/09              25%      

                                                                 06/04/11              60%

 

And I want to juggle it around into something like this:

 

 

                                                                     Date            Total Score

Record Count: 2                                                                                

                                Account Name: AccountA                                 

                                                                 03/12/10              40%      

                                                                 15/08/10              30%      

                                Account Name: AccountC                               

                                                                 27/09/09              25%      

                                                                 06/04/11              60%     

Record Count: 1                                                                              

                               Account Name: AccountB                                

                                                                 17/08/10              55%     

 

 

If I could use a roll-up summary field on the Account (to count the child records) then I could use that to group by. However, the relationship between Account and Asset is not a Master-Detail relationship so I can't create a roll-up to do that.

I can put a custom summary field on the report, which subtotals the record counts but it can't be used to group the Accounts (because that would require it to be outside the proper context). I can't even use it to sort the Accounts which would be good enough for me (the only options are Ascending Account Name and Descending Account Name).

 

Is there any sort of work-around which can do this?

  • February 17, 2011
  • Like
  • 0

This seems like such a simple thing, I almost feel stupid for not being able to do it but I can't:

 

I've created a custom lookup field on Accounts, to Contacts, called Contact To Invoice.

I want to create a Report (for a mail merge) that pulls fields from Account plus some from the Contact linked to by Contact To Invoice (if any). If the Contact To Invoice field is null, these fields would, presumably, be blank.

 

I can create a Report on Accounts alone, which includes the Contact To Invoice field, but that only lists the name (it's also a link but that's not useful in a mail merge).

I can create a Report on Accounts with Contacts, which lists *all* Contacts belonging to the Account but can be filtered to only show the one who is also Contact To Invoice (because filter criteria can only compare fields to static values not to other fields).

I can create a Report on Contacts with Accounts which *will* show only the right Contacts but will omit any Accounts without a Contact To Invoice.

I can create Report on Accounts with Contact with Accounts but that doesn't work either and is starting to get ridiculous...

 

 

Any help guys?

 

How do I allow users using standard profiles to view a custom object?

 

Some of the users in my organisation are not able to see all the custom objects that I have created.

Trying to fix this, I've been around and checked every checkbox I could find that looked even vaguely applicable to no avail. Apart from the ones under Setting->Manager Users->Profiles because apparently the standard profiles cannot be edited.

 

Which is where I start to get confused. Because according to the documentation "users with standard profiles can't access new custom objects—you must assign them custom profiles and edit the profiles" ... but about half of my custom objects are accessible with the standard profiles.

 

So obviously there must be way to allow standard profiles access to custom objects because I've apparently already done it several times but as I'm making this up as I go along learning this as I go along I didn't realise it was impossible at the time and now can't remember how to do it again.

 

Can anyone enlighten me?

  • April 22, 2010
  • Like
  • 0

Problem in a nutshell:

 

This help page informs me that it is possible to delete an object in a trigger that's called after its insertion ("Allowed, but unnecessary. The object is deleted immediately after being inserted." )

 

However, that same page informs that it is *not* possible ("trigger.new and trigger.old cannot be used in Apex DML operations", "You cannot delete trigger.new" ).

 

When I try to run a trigger which does this, I get the following error message:

 

"Apex trigger createCustomEventTrigger caused an unexpected exception, contact your administrator: createCustomEventTrigger: execution of AfterInsert caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old: Trigger.createCustomEventTrigger: line 5, column 13"

 

 

Is it possible to use triggers to delete an object immediately after inserting it? And if so, how?

 

 

 

 

For those interest in a more detailed account of the problem: 

 

I'm currently trying to write a trigger and class so that whenever a user creates an Event (the standard one)there will be an Events__c custom object automatically created and populated with the same data and the "Related To" field of the standard Event object will be set to point to the custom Event object.

(Note, I've already written code that goes in the other direction and creates a standard Event when a custom Event is created. And yes, I'm prepared to prevent infinite loops.)

 

The problem I'm facing is getting all the necessary stages in the right order. If you can bear with me, I'll outline the different approaches I've tried, just in case one of the earlier ones has something in it that can be fixed:

 

 

I tried using a "before insert" trigger to create the new custom Event, insert it, query for it and put its ID in the standard Event's "Related To" field.

But I couldn't guarantee getting back the single, correct custom Event from my query because it didn't have any sort of unique identifying value in it.

 

So I tried using an "after insert" trigger so that the standard Event would have been assigned a Salesforce ID. I could put this ID in a hidden field when I created the custom Event, then insert it and query for it on that field, and get the custom Event's ID.

But then I can't put that ID into the standard Event because I can't modify it in an "after" trigger.

 

 

This left me with a chicken-and-egg problem, where the standard and custom events each had to be inserted before the other.

Trying to get out of it led me to my current attemplt at a solution: an "after insert" trigger on the standard Event creates the custom Event but doesn't immediately set the flag I use to prevent infinite recursion. This means that the trigger on the custom Event then creates a second standard Event with all the same data and with the "Related To" field pointing at the custom Event. All that's left to do is to delete the original standard Event and there's no need for the user to know that the Event they're looking at on the calender isn't the same one they just created.

  • March 01, 2010
  • Like
  • 0

Hi,

 

 

I have a custom field on task object.i have also create a report including that custom field,Now i want to search some value based on that custom field in report.

 

can any one help me for this.

 

thanks in adv.

I need some help..  I have a visualforce page (see code below) that I created.  What it's suppose to do is display a warning if the DFU_Status__c = Complete.  DFU_Status__c is a picklist. 

 

Any help is appericated!

 

 

<apex:page StandardController="Case" >

<script type="text/javascript"> 

if (ISPICKVAL({DFU_Status__c}, "Complete")
{
  document.write('<font size=4 color=red>Warning!</font>');
}
</script>

  
</apex:page>

 

 

I am trying to create a trigger that updates a field in the detail of a master detail relationship.

 

For example...

 

I have a custom object called Risk and I have a junction object called Risk Relationship.

 

Risk Relationship is connected to Risk by a Master Detail relationship and a lookup relationship as well.

 

Risk Relationship is the detail in both relationships.

 

Is it possible to create a trigger so that whenever a Risk is edited, a trigger is fired to create a field update in the Risk Relationship custom object?

 

Is that possible?

  • March 01, 2011
  • Like
  • 0

Suppose I have a string that contains an expression...

 

String exp = '25.4 + 10';

 

I want to take this string and use it as an expression, and get a Decimal value.  Is this possible?  How would I do this?

The formula below has no errors, yet the only time a DFS Opportunity cannot currently be saved at "Submitted to Sales Support" is when the Soft Costs rule applies. Any advice on why the rule doesn't work for the Term and Pay Method component of the formula? When either of the 3 rules (i.e. 1 or 2 or 3) apply, then the opportunity shouldn't be able to be saved at "Submtted to Sales Support".

 

OR (
AND (
$RecordType.Name = "AUS : DFS : Opportunity Record Type" ,
Soft_Costs_percentage__c>0.2,
Soft_Costs_Approved__c =FALSE,
ISPICKVAL (StageName,"Submitted to Sales Support : DFS"
),
OR (
AND (
$RecordType.Name = "AUS : DFS : Opportunity Record Type", Term_Approved__c = FALSE,
IF (
Term_mos__c >
VALUE
(
Master_Lease_Agreement__r.Term_Exc_Interim_Not_To_Exceed_Mths__c
) , TRUE,
ISPICKVAL
(
StageName,"Submitted to Sales Support : DFS"
)
)
),
OR (
AND (
$RecordType.Name = "AUS : DFS : Opportunity Record Type" , Pay_Method_Approved__c = FALSE,
ISPICKVAL ( Account.Pay_Method_M__c ,"DDR"),
ISPICKVAL (Pay_Method__c ,"INV"),
ISPICKVAL (StageName,"Submitted to Sales Support : DFS"),
OR ($RecordType.Name = "AUS : DFS : Opportunity Record Type") ,
Pay_Method_Approved__c = FALSE,
ISPICKVAL ( Account.Pay_Method_M__c ,"INV"),
ISPICKVAL (Pay_Method__c ,"DDR"),
ISPICKVAL (StageName,"Submitted to Sales Support : DFS")
)
))))

I wanted to know if Having a composite primary key was possible with Custom objects?


In my RASolution__c object,  I wanted to have Composite Primary Key  of Case number and Solution ID.  When Case number is of "lookup" type to Case Table.


I want to make sure the solution_id  of RASolution obect for each CASE remains unique.


In my custom RASolution object, I cannot make the Solution_id unique as multiple cases might have the same solution.

 

Thanks.

JH

  • December 10, 2010
  • Like
  • 0

This seems like such a simple thing, I almost feel stupid for not being able to do it but I can't:

 

I've created a custom lookup field on Accounts, to Contacts, called Contact To Invoice.

I want to create a Report (for a mail merge) that pulls fields from Account plus some from the Contact linked to by Contact To Invoice (if any). If the Contact To Invoice field is null, these fields would, presumably, be blank.

 

I can create a Report on Accounts alone, which includes the Contact To Invoice field, but that only lists the name (it's also a link but that's not useful in a mail merge).

I can create a Report on Accounts with Contacts, which lists *all* Contacts belonging to the Account but can be filtered to only show the one who is also Contact To Invoice (because filter criteria can only compare fields to static values not to other fields).

I can create a Report on Contacts with Accounts which *will* show only the right Contacts but will omit any Accounts without a Contact To Invoice.

I can create Report on Accounts with Contact with Accounts but that doesn't work either and is starting to get ridiculous...

 

 

Any help guys?

 

How do I allow users using standard profiles to view a custom object?

 

Some of the users in my organisation are not able to see all the custom objects that I have created.

Trying to fix this, I've been around and checked every checkbox I could find that looked even vaguely applicable to no avail. Apart from the ones under Setting->Manager Users->Profiles because apparently the standard profiles cannot be edited.

 

Which is where I start to get confused. Because according to the documentation "users with standard profiles can't access new custom objects—you must assign them custom profiles and edit the profiles" ... but about half of my custom objects are accessible with the standard profiles.

 

So obviously there must be way to allow standard profiles access to custom objects because I've apparently already done it several times but as I'm making this up as I go along learning this as I go along I didn't realise it was impossible at the time and now can't remember how to do it again.

 

Can anyone enlighten me?

  • April 22, 2010
  • Like
  • 0

I am trying to import account and contacts from a SQL server database. By default SalesForce wants to use the account name. What's been happening is that when the account name from my SQL database doesn't match exactly with the name in SalesForce, duplicated accounts would be created. Even a tiny discrepancy like 'INC' vs. 'INC.' would create duplicate.

 

I read from some help articals that I could use an External ID as the matching criteira. But the import wizard's matching type only has Salesforce.com ID' and 'name and Site'. I did create a customized field for Account, and specified that it should be required, unique, and is an External ID. But this option is not there. 

 

So how do I get to specify I want to import by using the External ID as the matching type?

 

Thank you!

Problem in a nutshell:

 

This help page informs me that it is possible to delete an object in a trigger that's called after its insertion ("Allowed, but unnecessary. The object is deleted immediately after being inserted." )

 

However, that same page informs that it is *not* possible ("trigger.new and trigger.old cannot be used in Apex DML operations", "You cannot delete trigger.new" ).

 

When I try to run a trigger which does this, I get the following error message:

 

"Apex trigger createCustomEventTrigger caused an unexpected exception, contact your administrator: createCustomEventTrigger: execution of AfterInsert caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old: Trigger.createCustomEventTrigger: line 5, column 13"

 

 

Is it possible to use triggers to delete an object immediately after inserting it? And if so, how?

 

 

 

 

For those interest in a more detailed account of the problem: 

 

I'm currently trying to write a trigger and class so that whenever a user creates an Event (the standard one)there will be an Events__c custom object automatically created and populated with the same data and the "Related To" field of the standard Event object will be set to point to the custom Event object.

(Note, I've already written code that goes in the other direction and creates a standard Event when a custom Event is created. And yes, I'm prepared to prevent infinite loops.)

 

The problem I'm facing is getting all the necessary stages in the right order. If you can bear with me, I'll outline the different approaches I've tried, just in case one of the earlier ones has something in it that can be fixed:

 

 

I tried using a "before insert" trigger to create the new custom Event, insert it, query for it and put its ID in the standard Event's "Related To" field.

But I couldn't guarantee getting back the single, correct custom Event from my query because it didn't have any sort of unique identifying value in it.

 

So I tried using an "after insert" trigger so that the standard Event would have been assigned a Salesforce ID. I could put this ID in a hidden field when I created the custom Event, then insert it and query for it on that field, and get the custom Event's ID.

But then I can't put that ID into the standard Event because I can't modify it in an "after" trigger.

 

 

This left me with a chicken-and-egg problem, where the standard and custom events each had to be inserted before the other.

Trying to get out of it led me to my current attemplt at a solution: an "after insert" trigger on the standard Event creates the custom Event but doesn't immediately set the flag I use to prevent infinite recursion. This means that the trigger on the custom Event then creates a second standard Event with all the same data and with the "Related To" field pointing at the custom Event. All that's left to do is to delete the original standard Event and there's no need for the user to know that the Event they're looking at on the calender isn't the same one they just created.

  • March 01, 2010
  • Like
  • 0
I know this is a developer forum but I have a simple question on field types. I am looking for a field type that allows the selection of multiple other objects to create a 1:n relationship. I see the field types Lookup Relationship and Master-Detail-Relationship, but both allow only one object to be selected. Is that right? With which field type can I accomplish the requirement to select multiple objects?