• Apex coding
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 4
    Replies
Hi
Iam tryingto connect to salesforce sandbox
This is the error Iam getting please refer the link for screen shot
 
 
 
any help would be greatly appreciated
 
 
regards
 
sunil
HI
Iam trying to read a file on my local machine using java script
Here Im using Scripting.FileSystemObject (ActiveX object)
 
Here I am getting an error like Automation server cannot create object
 
how to solve the issue. your help is greatly appreciated
 
Here is the code what I have used and help me in fixing the error
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    <script> 
function ReadFileToString(strFileName) {
    var strContents;
    strContents = "";
    objFSO = new ActiveXObject("Scripting.FileSystemObject");
    if (objFSO.FileExists(strFileName)) {
        strContents = objFSO.OpenTextFile(strFileName, 1).ReadAll();
    }
   
    document.getElementById('filestr').innerHTML = strContents;
} //end of function
   
    </script>
   
</head>
<body onload=ReadFileToString('C:\createDocument.txt')>
<div id=filestr>
   </div>

</body>
</html>
 
 
 
 
regards
sunil
HI
Iam trying to read a file on my local machine using java script
Here Im using Scripting.FileSystemObject (ActiveX object)
 
Here I am getting an error like Automation server cannot create object
 
how to solve the issue. your help is greatly appreciated
 
Here is the code what I have used and help me in fixing the error
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    <script> 
function ReadFileToString(strFileName) {
    var strContents;
    strContents = "";
    objFSO = new ActiveXObject("Scripting.FileSystemObject");
    if (objFSO.FileExists(strFileName)) {
        strContents = objFSO.OpenTextFile(strFileName, 1).ReadAll();
    }
   
    document.getElementById('filestr').innerHTML = strContents;
} //end of function
   
    </script>
   
</head>
<body onload=ReadFileToString('C:\createDocument.txt')>
<div id=filestr>
   </div>

</body>
</html>
 
 
 
 
regards
sunil
Hi
 
I have a requirement like reading a file on local mahine using Apex
after reading that file using Apex I want to send the contents of that file as an attachment through email
 
can any one send me the sample Apex code of reading a file on local machine
 
waitng for a quick reponse
 
regards
sunil
 
 
Hi
 
I want to be able to attach a file to  the email and that file should be in my local file system
can any one send me the code on this on priority
and your sugestions are greatly accepted
 
 
regards
Sunil
HI
 
How to upload a file with out using Document or Attachment Object into salesforce file system
 
My requirement is as follows
I need to upload a file from my local system to salesforce file system
and How can I send that file as an attachment from File system through mail
 
please help me and your suggestions are most welcome
 
Regards
sunil
 
 
Hi
 
I want to upload a file  from my local drive and send that file as an attachment using Apex
for this to upload the file Iam using a standard object of Salesforce Document here
After uploading the file through URL the size of the file is 0 bytes
How to send this document as an attachment through email
can any one please send me the code to solve my issue
 
 
This is the code what Iam writing
 
Document doc=new Document();
Folder fold=new Folder();
fold.AccessType='Public';
fold.IsReadOnly=false;
fold.Name='MyFolder';
fold.DeveloperName='MyFolder';
fold.Type='Document';

Folder[] fld = [select f.id from Folder f  where f.Name = : ('MyFolder')];


doc.Name='MyTestDoc';
doc.URL = 'c:/ImpUrls.txt';
//doc.IsPublic = true;
doc.FolderId = fld[0].id;
//doc.ContentType = 'txt';
//doc.BodyLength=900;
insert doc;
 
regards
sunil
 
 
Hi
Iam Using Apex coding
I want to send an email using Apex
My email will also have an attachment
How to set the file body and  attach
a file with email
can any one help me in writing the code
 
regards
sunil
Hi
I have wriiten some classes and triggers whcih contain Apex coding
To deploy that on to production or Sandbox of Salesforce
 
Salesforce.com recommends that at least 75% of your Apex scripts should be covered by unit tests, and all triggers should have some test coverage.
 
 
I have wriiten test classes for classes and I dont know How to write test cases for Triggers
what do you mean by " all triggers should have some test coverage."
 
can any one help me in this  regard
 
regards
sunil
 
Hi
 
I have written an apex script which  inserts records into my custom object
 
Now I have to log information like How many records got inserted and if any error occured while inserting
I want to log the error if any
 
so how to log the necessary info or error info
 
How can we log information in sales force?, what is the name of the log file?
what settings should be done for logging in sales force? and How it works?
 
 
 
 
 
I have wriiten apex code to insert records into my custom object
 
Iam not able to insert
 
In the sand box  for a normal user to insert records through apex script  any permissions are required?
 
please let me know
 
 
regards
 
sunil
 
 
 
 
Hi
 
Iam trying to insert records into the custom object through apex code
Iam using sand box here
 
Iam not getting any errors but  Iam not able to view the inserted records
 
If i try to insert manually then the records are inserted and Iam able to see
 
can any one help in resolving this issue
 
regards
sunil
Hi
 
I have taken a column called price, and its data type is currency
If I enter negative amount as -1200 then its is displaying ($1,200.00)
 
but my requirement is to display   -$1,200.00
 
what I have to do to achieve this
 
I have created a custom object.
Except the standard field the remaining fields(custom fields are not displayed)
 
can you please tell me how to enable the fields of a custom object in the UI part
Hi
 
Iam inserting records into the custom object.
The custom object is given look up Relation ship (The custom object appears in Opportunities tab)
 
I have wriiten a trigger which inserts records into the custom object.
The trigger is executing fine, but I am not able to see the records in the corrosponding Custom Object
 
I have checked about the presence of records in the Custom Object by writing a SOQL query
here the records are coming.
 
can any one suggest why the records are not displayed in the view part
 
please help me in solving this
 
Hi
 
I have created a custom object, Iam inserting the records by apex code
this is code I had wriiten
 
 
Scheduling__c sch=new Scheduling__c();

sch.Name='My Scheduling Name';
sch.Line_Description__c=sch_desc;
sch.Date__c=sch_date;
insert sch;
 
My records are inserted into Custom object but they are not visible in the UI part
 
I have checked by writing a SOQL query, Iam getting the inserted values in System.debug() when I click Run Test
 
why the records are not displayed in the view part
 
can any one suggest me a solution
 

 
Hi
 
I have created a custom object, at the time of creating this I have mapped this to Opportunity object using look up
 
After creating this custom object, Iam able to add the records By Clicking on  the new button i.e manually
 
But if I try to insert programatically by using Apex code, Iam not getting any errors but the record that is inserted is not visible
 
what sort of settings I have to do, can any one please help me to solve this issue
 
 
 
How to login into Sales Force using the  web services API
 
can any one suggest me How to login and what are the settings I have to do to run
the Apex scripts
 
please give me the code samples as well
 
 
Hi
 
Iam trying to login using Java code with sales Force using Web Services API
 
Iam not able to login, Iam getting a flag as INVALID_LOGIN
 
Actually I have Sales Force User Name and password and Iam trying to login to Force.com Sand Box
can any one help me to resolve this problem
 
 
Hi
 
I have a requirement like reading a file on local mahine using Apex
after reading that file using Apex I want to send the contents of that file as an attachment through email
 
can any one send me the sample Apex code of reading a file on local machine
 
waitng for a quick reponse
 
regards
sunil
 
 
I have created a custom object.
Except the standard field the remaining fields(custom fields are not displayed)
 
can you please tell me how to enable the fields of a custom object in the UI part
Hi
 
I have created a custom object, at the time of creating this I have mapped this to Opportunity object using look up
 
After creating this custom object, Iam able to add the records By Clicking on  the new button i.e manually
 
But if I try to insert programatically by using Apex code, Iam not getting any errors but the record that is inserted is not visible
 
what sort of settings I have to do, can any one please help me to solve this issue