• Heese
  • NEWBIE
  • 0 Points
  • Member since 2007

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



Hi all,

I am trying to update two objects by inserting new records and updating existing records but am having trouble.  

Account is the Master Object of the Custom Object named Invoices.  
So on the Invoices Object there is a lookup (Master-Detail)Account.  

Here is the scenario, each week I receive a spreadsheet containing all accounts (person Accounts) along with invoices.  So i need to create a new account if it doesn't exist and then create a new invoice if it doesn't exist. If it does exist then i simply need to update the account and invoice.  

The fields on the Invoices object are pubId(an external ID), Price, Total

I am having a very difficult time updating these records.  I am able to update/create new records for the Accounts (Import Person accounts through the UI) but I am having a hard time importing the Invoices.  No matter what I've tried it doesn't seem to create new Invoices.  Is it because I am working with Person Accounts??

Is there a better way to do this?  I have access to DemandTools and the DataLoader.  Thanks in advance.

  • July 11, 2011
  • Like
  • 0

Hi all,

 

I need a bit of some help creating a trigger.   Contacts and accounts are being created using the API.  Upon insert a contact and an account are created with the following data:

 

Account Owner (defaulting to the api account)

Account Record Type (In this case "Enterprise'")

Account Name

 

Contact Owner (defaulting to the api account)

Contact Name

Contact MailingState

Contact MailingCity

 

What I need to do is create a trigger to perform the following.  After insert, check if Account BillingState, AccountBillingCity are null and Account Record Type is named  "Enterprise" or the 15digitid.  If so, populate AccountBillingState with the Contact Mailing State and populate AccountBillingCity with the ContactMailing City

 

I hope this makes sense.  Thank you in advance.  

  • July 08, 2011
  • Like
  • 0

I am trying to come up with a solution to prevent bad data from being saved.  I am working with Contracts and I have a custom field called AdID.  It's a text field and a Unique Identifier.  What I want to do is prevent a user from saving a contract record if the time falls between a current one with the same AdId.  For example

 

 

contract abc from 2011-04-01 to 2011-05-01 with AdId123 with contract amount $100
contract xyz from 2011-04-15 to 2011-05-01 with AdId123 with contract amount $200.

 

 

I would want a Validation Rule to prevent the saving of contract xyz since the dates overlap and contain the same AdId.  I can't think of a good way to do this.  Any help is greatly appreciated

  • May 20, 2011
  • Like
  • 0

Hi all,

 

I'm looking for some guidance on how to modify this trigger.  I downloaded the App Exchange App "Custom Object Lead Conversion" by Hi-Soft and I need to slightly edit the code to fit my use case.  What I've noticed is the Trigger does not bring over multiple records of the Custom Object when it's converted.  It seems to bring only the 1st record while disregarding the rest.  I am not a programmer so any help would be great.  Below is the unmodified code from the Trigger.  Thanks in advance

 

 

trigger UpdateCustomeObject_Trigger on Lead (before update) {
//This trigger will associate a Custom Object record with the contact and opportunity associated to the 
//lead after it has been converted.
//The Custom Object is associated to an opportunity only if an opportunity record exist on the Lead.
    for (Integer i = 0; i < Trigger.new.size(); i++){
        if (Trigger.new[i].IsConverted == true && Trigger.old[i].isConverted == false){
            Set<Id> leadIds = new Set<Id>();
            for (Lead lead : Trigger.new) 
                leadIds.add(lead.Id);
            
            Map<Id, CustomObject__c> entries = new Map<Id, CustomObject__c>([select Contact__c, Opportunity__c, Account__c, Lead__c from CustomObject__c where lead__c in :leadIds]);        
            if(!Trigger.new.isEmpty()) {
                for (Lead lead : Trigger.new)  {
                    for (CustomObject__c CustomObject : entries.values()) {
                        if (CustomObject.Lead__c == lead.Id) {
                            CustomObject.contact__c = lead.ConvertedContactId;
                            CustomObject.opportunity__c = lead.ConvertedOpportunityId;
                            CustomObject.account__c = lead.ConvertedAccountId;
                            update CustomObject;
                            break;
                        }
                    }
                }
            }
        }
    }

}

 

 

  • January 27, 2011
  • Like
  • 0

I have a lookup field on contracts to an opportunity.  Is there a way that I can write a validation rule that requires an opportunity to have a contract that is "Activated' prior to marking the opportunity as Closed/Won?

 Thanks 

  • November 20, 2009
  • Like
  • 0

Can someone point me in the right direction for writing a trigger that updates a field on the Account Record if a contract is expired?  

 

For instance if a contract is current (start and end date are within current date) it would update the field to say current.  If the contract end date is a date in the past and there are no other current contracts it would update the field to "lapsed"

 

Thanks in advance 

  • November 03, 2009
  • Like
  • 0
I have a custom object that is a child of the Contract Object.  I need to write a validation rule that looks at a field on the contract called Agency which is a lookup field to accounts.  If it is filled out there needs to be an entry for the custom object called insertion order which has fields amount, date, name.  Thanks
  • September 24, 2009
  • Like
  • 0

I have a custom field on the Account Object called Account Status.  It has three values, Current, Lapsed, null. 

 

I am trying to create a workflow rule that looks at all of the contracts within an account and evaluates the start and end dates.  If the latest contract end date is a date in the past it would update Account Status to "Lapsed"

 

Any help is greatly appreciated.  Thanks

  • September 10, 2009
  • Like
  • 0
How do i prevent users from editing the campaign history on a contact record.  I don't want them to be able to edit or delete the information.  Thanks
  • July 24, 2009
  • Like
  • 0

Is there a way to create  a custom report that lists all of the primary contacts in the account role along with opportunities?  I am having a hard trouble finding a way. 

 

What I need is to create a report that Lists the account, Contact Name, Account Role, Opportunities in account, and custom info from the opportunities.  

 

Thanks

  • July 21, 2009
  • Like
  • 0
I want to send a mass email to all of my contacts in my accounts but I want to limit it to only the ones marked as primary in the contact role.  Is there any way to do this?
  • July 20, 2009
  • Like
  • 0

I need to improve the quality of our data.  A lot of our reps are creating and completing activities without relating it to the proper record.  Is there an easy way to calculate a formula that divides the number of those describes activities with the total count.

 

Number of Unrelated Activities marked as closed/Total number of Completed.

 

Thanks

  • July 09, 2009
  • Like
  • 0
How to do i prevent a group of users from Transferring a Lead to another user without all of the fields filled in? 
  • July 07, 2009
  • Like
  • 0

I'm using Salesforce Enterprise Edition. 

 

I am trying to create  a workflow rule that automatically updates the Type Field on a Task to Email, when an email is sent through salesforce.  My workflow criteria is  when Type does not contain Meeting, LVM, Call (basically null) and Status equals complete.  No matter what I cannot get it to run.  Every email sent through salesforce has no type.  Please help

  • July 02, 2009
  • Like
  • 0
Hi,

I need help writing a validation rule. 

I have an custom account field (picklist) named XYZ.  I would like to create a validation rule for an opporuntity related to the account.
So if an opportunity is created and a picklist value other than N/A is selected it would require the user to type a hyphen into the Opportunity Name. 

I saw this from a list of validation rules.  FIND( " - ", Name ) = 0

Logically it sounds like this.  If ISPICKVAL XYZ_c <> N/A Then require "-"

Thanks in advance
  • May 08, 2008
  • Like
  • 0
Can someone please help me with a data validation rule.  I need a rule that requires All of Field1, Field2, & Field 3 if the Probability Field is greater than 66%. 

Thanks for the help. 
  • October 04, 2007
  • Like
  • 0
I'm having trouble creating a Data Validation Rule.  I need a rule that basically says if a certain field is selected another field must have no value. 

For instance.  If a stage named NotSigned is selected the Amount field must be empty. 

Thanks in advance.


  • September 21, 2007
  • Like
  • 1
I'm having trouble creating a Data Validation Rule.  I need a rule that basically says if a certain field is selected another field must have no value. 

For instance.  If a stage named NotSigned is selected the Amount field must be empty. 

Thanks in advance.


  • September 21, 2007
  • Like
  • 1



Hi all,

I am trying to update two objects by inserting new records and updating existing records but am having trouble.  

Account is the Master Object of the Custom Object named Invoices.  
So on the Invoices Object there is a lookup (Master-Detail)Account.  

Here is the scenario, each week I receive a spreadsheet containing all accounts (person Accounts) along with invoices.  So i need to create a new account if it doesn't exist and then create a new invoice if it doesn't exist. If it does exist then i simply need to update the account and invoice.  

The fields on the Invoices object are pubId(an external ID), Price, Total

I am having a very difficult time updating these records.  I am able to update/create new records for the Accounts (Import Person accounts through the UI) but I am having a hard time importing the Invoices.  No matter what I've tried it doesn't seem to create new Invoices.  Is it because I am working with Person Accounts??

Is there a better way to do this?  I have access to DemandTools and the DataLoader.  Thanks in advance.

  • July 11, 2011
  • Like
  • 0

Hi all,

 

I need a bit of some help creating a trigger.   Contacts and accounts are being created using the API.  Upon insert a contact and an account are created with the following data:

 

Account Owner (defaulting to the api account)

Account Record Type (In this case "Enterprise'")

Account Name

 

Contact Owner (defaulting to the api account)

Contact Name

Contact MailingState

Contact MailingCity

 

What I need to do is create a trigger to perform the following.  After insert, check if Account BillingState, AccountBillingCity are null and Account Record Type is named  "Enterprise" or the 15digitid.  If so, populate AccountBillingState with the Contact Mailing State and populate AccountBillingCity with the ContactMailing City

 

I hope this makes sense.  Thank you in advance.  

  • July 08, 2011
  • Like
  • 0

Hi all,

 

I'm looking for some guidance on how to modify this trigger.  I downloaded the App Exchange App "Custom Object Lead Conversion" by Hi-Soft and I need to slightly edit the code to fit my use case.  What I've noticed is the Trigger does not bring over multiple records of the Custom Object when it's converted.  It seems to bring only the 1st record while disregarding the rest.  I am not a programmer so any help would be great.  Below is the unmodified code from the Trigger.  Thanks in advance

 

 

trigger UpdateCustomeObject_Trigger on Lead (before update) {
//This trigger will associate a Custom Object record with the contact and opportunity associated to the 
//lead after it has been converted.
//The Custom Object is associated to an opportunity only if an opportunity record exist on the Lead.
    for (Integer i = 0; i < Trigger.new.size(); i++){
        if (Trigger.new[i].IsConverted == true && Trigger.old[i].isConverted == false){
            Set<Id> leadIds = new Set<Id>();
            for (Lead lead : Trigger.new) 
                leadIds.add(lead.Id);
            
            Map<Id, CustomObject__c> entries = new Map<Id, CustomObject__c>([select Contact__c, Opportunity__c, Account__c, Lead__c from CustomObject__c where lead__c in :leadIds]);        
            if(!Trigger.new.isEmpty()) {
                for (Lead lead : Trigger.new)  {
                    for (CustomObject__c CustomObject : entries.values()) {
                        if (CustomObject.Lead__c == lead.Id) {
                            CustomObject.contact__c = lead.ConvertedContactId;
                            CustomObject.opportunity__c = lead.ConvertedOpportunityId;
                            CustomObject.account__c = lead.ConvertedAccountId;
                            update CustomObject;
                            break;
                        }
                    }
                }
            }
        }
    }

}

 

 

  • January 27, 2011
  • Like
  • 0

Can someone point me in the right direction for writing a trigger that updates a field on the Account Record if a contract is expired?  

 

For instance if a contract is current (start and end date are within current date) it would update the field to say current.  If the contract end date is a date in the past and there are no other current contracts it would update the field to "lapsed"

 

Thanks in advance 

  • November 03, 2009
  • Like
  • 0

I have a custom field on the Account Object called Account Status.  It has three values, Current, Lapsed, null. 

 

I am trying to create a workflow rule that looks at all of the contracts within an account and evaluates the start and end dates.  If the latest contract end date is a date in the past it would update Account Status to "Lapsed"

 

Any help is greatly appreciated.  Thanks

  • September 10, 2009
  • Like
  • 0
How do i prevent users from editing the campaign history on a contact record.  I don't want them to be able to edit or delete the information.  Thanks
  • July 24, 2009
  • Like
  • 0

Is there a way to create  a custom report that lists all of the primary contacts in the account role along with opportunities?  I am having a hard trouble finding a way. 

 

What I need is to create a report that Lists the account, Contact Name, Account Role, Opportunities in account, and custom info from the opportunities.  

 

Thanks

  • July 21, 2009
  • Like
  • 0
How to do i prevent a group of users from Transferring a Lead to another user without all of the fields filled in? 
  • July 07, 2009
  • Like
  • 0

Is there a way to show in the Contact object that a contact is the primary contact listed in an attached opportunity?

 

-Thanks