Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

What to do when an activex object is not defined?

Asked by Aashna Saito Apr 17, 2023 1.4K views 1 answer
Share

About this question

I have an existing Javascript button which causes an "ActiveXObject is not defined" error when I click on it.

{
    !REQUIRESCRIPT("/soap/ajax/22.0/connection.js")
}
var newIRnAGenRequest = new sforce.SObject("Account");
newIRnAGenRequest.id = "{!Account.Id}";
newIRnAGenRequest.Request_Folder_Path__c = "{!Account.Request_Folder_Path_Hidden__c}";
newIRnAGenRequest.Req_Communication_Folder_Path__c = "{!Account.Req_Communication_Folder_Path__c}";
newIRnAGenRequest.Primary_Request_Status__c = "{!Account.Primary_Request_Status__c}";
var result = sforce.connection.update([newIRnAGenRequest]);
var myObject;
var myFile0 = "{!Account.Request_Folder_Path_Hidden__c}";
var myFile1 = "{!Account.Req_Communication_Folder_Path__c}";
if (newIRnAGenRequest.Primary_Request_Status__c == "Submitted") {
    alert("Please select a Primary Team assigned");
} else {
    location.reload(true);
    myObject = new ActiveXObject("Scripting.FileSystemObject");
    if (myObject.FolderExists(myFile0)) {
        window.open(myFile0);
    } else {
        var myObject2, newfolder;
        myObject2 = new ActiveXObject("Scripting.FileSystemObject");
        newfolder = myObject2.CreateFolder(myFile0);
        newfolder = myObject2.CreateFolder(myFile1);
        window.open(myFile0);
    }
}

When I tried to google it, I found that it was related to files and it is dedicated to IE only. It worked a few months ago in chrome. But now it stopped working everywhere.


My request is to provide any alternate solutions, if ActiveXObject can't be used anymore.

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.