You need to sign in to do that
Don't have an account?

identifier starts immediately after numeric literal
Hello,
I am trying to create a button that sits on the OpportunityLineItem related list on Opportunities that will create a new Price Plan record for each line item it finds. In theory this doesn't sound too hard but I keep getting an error "identifier starts immediately after numerical literal" and I can't figure out what is causing this error. I don;t see anything wrong with my syntax
{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")} var records = {!GETRECORDIDS($ObjectType.OpportunityLineItem)}; var newRecords = []; if (records[0] == null) { alert("Please select at least one row"); } else { var oppLineItemRec = sforce.connection.query("select Product2,UnitPrice,Quantity from OpportunityLineItem where id in ('"+ records +"')"); for (var n=0; n < oppLineItemRec.length; n++) { var c = new sforce.SObject("Price_Plan__c"); c.Product__c = oppLineItemRec[n].Product2; c.List_Price__c = oppLineItemRec[n].UnitPrice; c.Quantity__c = oppLineItemRec[n].Quantity; c.Account__c = {!Opportunity.AccountId}; c.Opportunity__c = {!Opportunity.Id}; newRecords.push(c); } } var result = sforce.connection.create(newRecords); window.location.reload();
Does anyone know what this error could be caused by?
Thanks
Mark
Basically It should not,
PLease mail me screenshot of error and Javascript code on gmail at balasahebwani@gmail.com
We will fixed this.
Thanks,
bForce
All Answers
Hi Mark,
Please try this one
If you find any difficulties in above JS ,feel free to revert back.
Thanks,
bForce
Hello B-Force,
Thank you very much for your contribution however the button is still producing the same error which doesn't really make any sense
Thanks
Mark
Basically It should not,
PLease mail me screenshot of error and Javascript code on gmail at balasahebwani@gmail.com
We will fixed this.
Thanks,
bForce
Thank you very much for the help bForce, the button is working now
Mark
Hi,
I have same problem. Can you please post what did you do after sending your code email to B-Force.
Thanks
Hari