You need to sign in to do that
Don't have an account?
Stavros McGillicuddy
Unexpected identifier error when copying one field to another
On my Opportunity object: I have created six custom fields
AVSFQB__Generate_Object__c (picklist)
AVSFQB__Quickbooks_Id__c (text 50 - External ID)
AVSFQB__QuickBooks_ItemType__c (picklist)
Sample_Generate__c (text 100)
Sample_Quickbooks_ID__c (text 50)
Sample_QuickBooks_ItemType__c (text 100)
I have also created a custom button Process_Sample_Sent
I would like to click the button and move the field contents:
AVSFQB__Generate_Object__c to Sample_Generate__c
AVSFQB__Quickbooks_Id__c to Sample_Quickbooks_ID__c
AVSFQB__QuickBooks_ItemType__c to Sample_QuickBooks_ItemType__c
On the custom button, I have selected:
Display type - Detail Page Button
Behavior - Execute JavaScript
Content Source - OnClick JavaScript
I am trying to get this code to work with one set of fields before I add the others
This code produces an "Unexpected identifier error"
AVSFQB__Generate_Object__c (picklist)
AVSFQB__Quickbooks_Id__c (text 50 - External ID)
AVSFQB__QuickBooks_ItemType__c (picklist)
Sample_Generate__c (text 100)
Sample_Quickbooks_ID__c (text 50)
Sample_QuickBooks_ItemType__c (text 100)
I have also created a custom button Process_Sample_Sent
I would like to click the button and move the field contents:
AVSFQB__Generate_Object__c to Sample_Generate__c
AVSFQB__Quickbooks_Id__c to Sample_Quickbooks_ID__c
AVSFQB__QuickBooks_ItemType__c to Sample_QuickBooks_ItemType__c
On the custom button, I have selected:
Display type - Detail Page Button
Behavior - Execute JavaScript
Content Source - OnClick JavaScript
I am trying to get this code to work with one set of fields before I add the others
This code produces an "Unexpected identifier error"
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} var record = new sforce.SObject("Opportunity__c"); record.Id = ("Opportunity__c.Id"); record.Sample_Generate__c = {!Opportunity.AVSFQB__Generate_Object__c}; var result = sforce.connection.update([record]); // check the result here window.location.reload();
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
var record = new sforce.SObject(Opportunity);
record.Id = ("Opportunity.Id");
record.Sample_Generate__c = {!Opportunity.AVSFQB__Generate_Object__c};
var result = sforce.connection.update([record]); // check the result here window.location.reload();
Let me know if it doesn't work
Thank you for your response.
Unfortunately this didn't work. I get the same error.. "A problem with the OnClick JavaScript for this button or link was encountered: Unexpected identifier."
Thanks