2

Here is the field I am trying to update, the far left is the picklist I am wanting to update. the field on the left is another picklist. both lists have the same values.

As you can see below I have tried a number of approaches. Is this possibly a limitation with the Javascript button?

Any help would be appreciated.

Example 1

00N5000000AIfdn = {!TEXT($User.New_Business_Admin__c)};

  • Error: Invalid or unexpected token error

Example 2

app.New_Business_Admin2__c = {!TEXT($User.New_Business_Admin__c)};

  • Error: Unexpected Token ; (I am not missing one nor do I have duplicates)

Example 3

app.New_Business_Admin2__c = '{!$User.New_Business_Admin__c}';

  • Error: Field New_Business_Admin__c is a picklist field. Picklist fields are only supported in certain functions.

Example 4

00N5000000AIfdn = {!$User.New_Business_Admin__c};

  • Error: Field New_Business_Admin__c is a picklist field. Picklist fields are only supported in certain functions
2

You forgot the quotes, as well as not encoding unsafe characters:

app.New_Business_Admin2__c = "{!JSENCODE(TEXT($User.New_Business_Admin__c))}";

This answer presumes you're trying to use the AJAX Toolkit (e.g. sforce.connection.update) to update the record via JavaScript.

  • You nailed it, that worked. I could have sworn I tried that too. Thank you very much!! – Cameron Houser Dec 5 '17 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.