• Beth at King Arthur Flour
  • NEWBIE
  • 0 Points
  • Member since 2012

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

 I have a trigger that needs to use a specific account id and a specific user id. Instead of hardwiring the IDs in the trigger I want to store the values in a custom setting and reference them in the trigger.

I created a list custom setting CS_Constants and a field called SF_ID. Then I added two data sets to the list.
Name: CSAccount
SF_ID: 001J000000FpzyZIAR

Name: CSSupervisor
SF_ID: 005A0000001BBFuIAO

I am having trouble using the values in the trigger.

Here is what I tried in a method call to create contact:

...
OwnerID=CS_Constants__c.getInstance('CSAccount'),
...

and I get this error:
Error: Compile Error: Invalid initial expression type for field Contact.OwnerId, expecting: Id at line 38 column 53

How do I make this work the way I need?

Thanks,
Beth

 I have a trigger that needs to use a specific account id and a specific user id. Instead of hardwiring the IDs in the trigger I want to store the values in a custom setting and reference them in the trigger.

I created a list custom setting CS_Constants and a field called SF_ID. Then I added two data sets to the list.
Name: CSAccount
SF_ID: 001J000000FpzyZIAR

Name: CSSupervisor
SF_ID: 005A0000001BBFuIAO

I am having trouble using the values in the trigger.

Here is what I tried in a method call to create contact:

...
OwnerID=CS_Constants__c.getInstance('CSAccount'),
...

and I get this error:
Error: Compile Error: Invalid initial expression type for field Contact.OwnerId, expecting: Id at line 38 column 53

How do I make this work the way I need?

Thanks,
Beth