SFDC error: argument list missing closing parenthesis

I encountered an issue that states:

"Missing ) after argument list"

This problem arises when I attempt to click on a custom button within SFDC. The purpose of this button is to initiate a specific case type in both our Internal and Community environments.

Any assistance would be greatly appreciated!

{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")} 

if('{!$Site.Prefix}'!=''){ window.open('{!$Site.Prefix}/500/e?retURL=%2F500%2Fo&RecordType=0121b0000004IKZ,'_parent'); 
}else{window.open('500/e?retURL=%2F500%2Fo&RecordType=0121b0000004IKZ,'_parent');} 

var qr = sforce.connection.query("select Id from recordType where (name= 'Device Request') and sObjecttype = 'Case'");

Answer №1

Give this a shot:

{
    !REQUIRESCRIPT("/soap/ajax/28.0/connection.js")
} {
    !REQUIRESCRIPT("/soap/ajax/28.0/apex.js")
}

if ('{!$Site.Prefix}' != '') {
    window.open('{!$Site.Prefix}/500/e?retURL=%2F500%2Fo&RecordType=0121b0000004IKZ','_parent'); 
}else{
    window.open('500 / e ? retURL = % 2 F500 % 2 Fo & RecordType = 0121 b0000004IKZ', '_parent');
}

var qr = sforce.connection.query("select Id from recordType where (name= 'Device Request') and sObjecttype = 'Case'");

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to create a button with this functionality?

In the form that I have created, it is opened in a bootstrap modal style. This form contains a button that, when clicked, triggers an alert box to appear. The code snippet used for this functionality is as follows: echo "<script>"; echo "alert(&apos ...

Tips for identifying the correct selectedIndex with multiple select elements present on one page

How can I maintain the correct selectedIndex of an HTMLSelectElement while having multiple select elements in a loop without any IDs? I am dynamically loading forms on a webpage, each containing a select element with a list of priorities. Each priority is ...

Data transmission from Node's hosted router to an external API, not from Node's hosted API

Need a Node router that can POST Json to a remote API? I dedicated my morning to solving this issue, and now I want to share some detailed examples with you for your benefit. In each example below, the router includes a GET method that, when called, will ...

What is the best way to retrieve nested reference data all at once from a Firestore document?

I have two distinct collections stored within my Firestore database. The first collection is users, and it can be visualized as shown here: https://i.stack.imgur.com/AKlyM.png The second collection is posts, represented by the following structure: http ...

Navigating with Nokia Here maps: plotting a path using GPS coordinates

I am currently developing a GPS tracking system and my goal is to visually represent the device's locations as a route. The challenge I'm facing is that there is a REST API available for this purpose, but my client-side application relies on soc ...

Why isn't the jQuery click() function functioning on my modified HTML?

I am trying to create a unique version of the go-moku game using different programming languages and databases. My aim is to enhance the game's functionality by incorporating jQuery, PHP, and a MySQL database. var moveCount = -1; setInterval(function ...

Trouble with JSON.stringify() object in AJAX request within Codeigniter framework

let dataString = JSON.stringify(formData); console.log(dataString); $.ajax({ url: urL, type: "POST", cache: false, data: dataString, success: function (data) { console.log(data); } }); When executing the code above, the ...

Executing a RESTful API request with Mocha in a Node.js environment

I've been attempting to make a REST call using Mocha. I tried using the "request" framework to log in at auth0. The REST call is correct; I tested the same data in Postman and received the correct response. However, when trying to implement the call ...

Modifying website elements with JavaScript

Can someone assist me with getting a script to work on my website that will allow me to switch between four different sets of content using buttons labeled 1, 2, 3, and 4? I have tried using addClass and removeClass but cannot seem to get it right. Here i ...

What is causing the malfunction in communication between my React app and Express server via fetch requests?

I am currently facing an issue while trying to connect my react js frontend (hosted on localhost for testing purposes, and also on my S3 bucket) to my node.js/express server deployed on an AWS Elastic Beanstalk environment. To resolve a CORS error, I recen ...

Leverage PHP variables within AJAX requests

I am currently working on implementing a specific functionality on the page "videos.php" (please note that this is all contained within a PHP echo statement): First, when a user clicks .star_' . $pvid_ID . ', it triggers the submission of a vid ...

Challenges related to using the require() method in JavaScript

I've been encountering an issue while trying to run the JavaScript client for the Tumblr API from their Github repository. The error message I keep getting is "require not defined" which has led me on a hunt across various forums and websites, includi ...

I am looking for a custom script for a splash page that will automatically redirect users to one of three designated pages based on the information stored

As a programmer, I'm well-versed in coding but lack knowledge about creating and utilizing cookies. If anyone could provide guidance on this matter, it would be highly appreciated. I believe I require two concise scripts for this task. 1st Script: T ...

Swapping icons in a foreach loop with Bootstrap 4: What's the most effective approach?

I need a way to switch the icons fa fa-plus with fa fa-minus individually while using collapse in my code, without having all of the icons toggle at once within a foreach loop. Check out a demonstration of my code below: <link rel="stylesheet" href= ...

Retrieving data from a nested object with varying key names through ng-repeat

My JSON object contains various properties with unique names: var definitions = { foo: { bar: {abc: '123'}, baz: 'def' }, qux: { broom: 'mop', earth: { tree: 'leaf', water: 'fi ...

Updating Highcharts with AJAX for simple line graphs

Can someone guide me on how to implement a basic line Highchart using AJAX, where the chart values update dynamically through AJAX calls? Any help or suggestions would be greatly appreciated. Thank you! ...

Vue.js is able to update various models based on selection from a form dropdown

I have a dynamic select list in my app built with vue.js. I am trying to update a "details" box on the page with information fetched through an ajax request. You can view the code here: https://jsfiddle.net/pznej8dz/1/ I am puzzled as to why the sf_detail ...

Retrieving data from a database and automatically populating textboxes using ajax and php

Currently, I am encountering a minor issue related to this particular topic. I've written a code snippet to automatically populate textboxes with values retrieved from the database once I enter an ID in the preceding field. Essentially, if I input a u ...

loading a partial view using AJAX

My intention is to create a dashboard view that displays multiple partial views. This project started as a way for me to learn, but I seem to be facing some challenges. Below is the code snippet causing issues: Here is the code snippet from my DashboardCo ...

What is the reason for the Pointer Lock API entry displaying a significant number when the window is compressed?

Take a look at these two screenshots that illustrate the issue: The first screenshot demonstrates the correct behavior - the fullscreen mode works perfectly. However, in the second screenshot, a problem arises. Depending on the size of the browser window, ...