• Kuen
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hey all,

 

Wondering if it's possible to set a picklistEntry as "selected" programmatically. I know usually a user will be doing this, however, I want to do this programmatically because I'm sending an email to salesforce, and the value is already there.

 

Scenario: Send an email to salesforce that will create a custom object. The email will have the field for picklist as well as the picklistEntry.value() in a string format. ie. "Programming Languages: PHP, JS, RoR" I have it splitting up into "Programming Languages" and "PHP" "JS" "RoR".

 

Inside salesforce, there is a multipicklist(multi-select) for Programming Languages, for PHP, JS, RoR and more.

How do I make sure that the custom object field "Programming_Languages" will have PHP, JS, RoR selected and not the other ones?

 

Thanks.

  • November 08, 2010
  • Like
  • 0

Hey all,


I'm pretty new to SalesForce and their Apex language. I've been reading some documentation and tried the integration between Google and SalesForce.

 

I'm wondering is it possible to emulate an auth token from google to SalesForce or at least just sign in using code?

I'm trying to read a google spreadsheet and then fill up a SalesForce object automatically. The user login will always be the same for this spreadsheet, so I have the credentials required to login. I am working off of the sample that requires a visualforce, and I'm wondering how would I automatically do the session id token that the google spreadsheet API requires.

 

Any ideas?

 

Cheers

  • October 27, 2010
  • Like
  • 0

Anyone have any idea as to why it would say it can't find the Account, which I have linked to an external id?

 

Here's the error message. 

 

 

Contact  = {'LastName': u'Test', 'Account': 1L, 'type': 'Contact', 'FirstName': u'Akira', 'u_id__c': 2L}
beatbox.upsert('u_id__c',Contact)

 

[{'fields': [], 'message': 'The external foreign key reference does not reference a valid entity: Account', 'statusCode': 'INVALID_FIELD'}]"

 

Anyone have any idea? I have confirmed that there is an Account field, and the Account field, which is a foreign key field to Account, has an external Id that has the same ID as the one i'm providing it. Any suggestions on how to tackle this?

 

  • September 24, 2010
  • Like
  • 0

Hey all, I currently have a weird problem. When I use the upsert command, it gives me an error that it's expecting 2 arguments when it got 0, however, I have given it 2 arguments and can't see where the error is happening.

ERROR: instancemethod expected at least 2 arguments, got 0

 

The code below is where it errors. beatbox is the beatbox object, that's already been logged in. The up_param is the salesforce matching, and the objects is a list of dictionaries that contain the information to upload. They all have data.

 

 

results = beatbox.upsert(up_param, objs)

 

 

Is there some form of documentation for this (it sometimes works, it sometimes doesn't)? I wasn't the one who wrote the code, and thus have been hacking away at identifying the problem and have narrowed it down to this. I am using python 2.6 and beatbox 19 incase this matters.

 

EDIT: Identified the error to be python side. The copy can't copy some instance (Account) and that is why it's a problem. Now time to figure out ways to make it work.

 

After stepping through it says there's an error in sObjectsCopy=copy.deepcopy(sObjects). Now I'm completely stumped...

 

Any help would be appreciated.

 

Thanks,

 

Kuen

  • September 22, 2010
  • Like
  • 0

Hey all,

 

I have a trigger in place that changes a custom field in account to auto fill a value if nothing exists. However, this only affects new/updated accounts... How would I do this for existing accounts? How could I activate the trigger to affect all accounts OR is there a better way to mass update existing 'blank' data?

 

I tried to create a trigger to view all 3000 accounts, however I reached limits so I couldn't do a simple after update/after insert trigger that just selects all accounts and edits the value and updates it. Here is the code,

 

 

trigger Run_Once_To_Fix on Account (after insert, after update) {
    list<Account> accs = [SELECT Id, Name, Zendesk__Zendesk_Organization__c 
        FROM Account WHERE Zendesk__Zendesk_Organization__c = '' LIMIT 100];
    
    for (Integer i = 0; i < accs.size(); i++)
        {
            accs[i].Zendesk__Zendesk_Organization__c = accs[i].Name;
        }
    
    if (accs.size() > 1) {
        update accs;
    }
}

 

 

Any ideas on how I can achieve what I want it to do?

 

Thanks

 

Kuen

  • September 03, 2010
  • Like
  • 0

Hey all,

 

I have a question,

 

When before I tried to change the before insert/before update to after insert and after update, it would give me a readonly error. Am I doing something wrong to get it working? As a work around (kind of) I changed it to "before insert, before update" and it appears to work; however, whenever the account's custom field is set to something, it still changes the field to the name regardless of whether or not it is set.

 

Any hints or tips or suggestions to know what exactly is wrong here?

 

Thanks

 

Kuen

 

 

trigger zendeskAutoFill on Account (before insert, before update) {
for (Account a: trigger.new) {
             if (a.Zendesk__Zendesk_Organization__c != '') {
                    a.Zendesk__Zendesk_Organization__c = a.Name;
              }
         }

 

  • September 02, 2010
  • Like
  • 0

Hey all,

 

Wondering if it's possible to set a picklistEntry as "selected" programmatically. I know usually a user will be doing this, however, I want to do this programmatically because I'm sending an email to salesforce, and the value is already there.

 

Scenario: Send an email to salesforce that will create a custom object. The email will have the field for picklist as well as the picklistEntry.value() in a string format. ie. "Programming Languages: PHP, JS, RoR" I have it splitting up into "Programming Languages" and "PHP" "JS" "RoR".

 

Inside salesforce, there is a multipicklist(multi-select) for Programming Languages, for PHP, JS, RoR and more.

How do I make sure that the custom object field "Programming_Languages" will have PHP, JS, RoR selected and not the other ones?

 

Thanks.

  • November 08, 2010
  • Like
  • 0

Hey all, I currently have a weird problem. When I use the upsert command, it gives me an error that it's expecting 2 arguments when it got 0, however, I have given it 2 arguments and can't see where the error is happening.

ERROR: instancemethod expected at least 2 arguments, got 0

 

The code below is where it errors. beatbox is the beatbox object, that's already been logged in. The up_param is the salesforce matching, and the objects is a list of dictionaries that contain the information to upload. They all have data.

 

 

results = beatbox.upsert(up_param, objs)

 

 

Is there some form of documentation for this (it sometimes works, it sometimes doesn't)? I wasn't the one who wrote the code, and thus have been hacking away at identifying the problem and have narrowed it down to this. I am using python 2.6 and beatbox 19 incase this matters.

 

EDIT: Identified the error to be python side. The copy can't copy some instance (Account) and that is why it's a problem. Now time to figure out ways to make it work.

 

After stepping through it says there's an error in sObjectsCopy=copy.deepcopy(sObjects). Now I'm completely stumped...

 

Any help would be appreciated.

 

Thanks,

 

Kuen

  • September 22, 2010
  • Like
  • 0

Hey all,

 

I have a question,

 

When before I tried to change the before insert/before update to after insert and after update, it would give me a readonly error. Am I doing something wrong to get it working? As a work around (kind of) I changed it to "before insert, before update" and it appears to work; however, whenever the account's custom field is set to something, it still changes the field to the name regardless of whether or not it is set.

 

Any hints or tips or suggestions to know what exactly is wrong here?

 

Thanks

 

Kuen

 

 

trigger zendeskAutoFill on Account (before insert, before update) {
for (Account a: trigger.new) {
             if (a.Zendesk__Zendesk_Organization__c != '') {
                    a.Zendesk__Zendesk_Organization__c = a.Name;
              }
         }

 

  • September 02, 2010
  • Like
  • 0