• asadim
  • NEWBIE
  • 335 Points
  • Member since 2009

  • Chatter
    Feed
  • 13
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 88
    Questions
  • 81
    Replies

Hi All.

 

I couldn't find any reference to how to upgrade my code.

Editing code on the IDE, saving successfully and redeploying doesn't seem to do the trick.

 

Do I need to change the metadatafile?

Can I just type 18?

 

Thanks.

 

Ben

Hi,

 

I want to call an actionFunction upon page load and I'm not sure how to do it. The <page> tag has an action attribute but that's only for calling controller methods.

 

Any help is appreciated!

Is sharing enforced from the top calling class to the bottom classes?

Pseudo: TopClass.method() > calls PCKG.ServiceClass.doWork() > calls PCKG.HelperClass.doHelp()

If TopClass is defined using "without sharing" do the packaged classes (Service & Helper) run in the same sharing context?

Thanks.
  • March 13, 2014
  • Like
  • 0

Hi,

 

We have thousands of attachments that we want to associate to new parents. Exporting them using Data Loader and loading them into Access/Excel will cause bad data imports (data is delimited incorrectly or the Office tool won't be able to open them). In Apex you can't overwrite the parentId field.

 

What's the solution? Any ideas? Thanks!

  • October 18, 2010
  • Like
  • 0

Hi,

 

I have a Word document uploaded as an Attachment. When I query for this file in my code (using SforceOfficeToolkit) I get back an Attachment sobject from which I can access its blob (body). I believe the blob is encoded in Base64. To convert this blob back into the original Word format I use a Base64 decoder. The decoder doesn't work with documents that have headers/footers but it works otherwise.

 

Any ideas how to get this to work? Here's my decoder just in case:

 

 

        public static byte[] DecodeBase64(string b64)
        {
            MSXML2.DOMDocument objXML = new MSXML2.DOMDocument();
            MSXML2.IXMLDOMElement objNode = objXML.createElement("b64");
            objNode.set_dataType("bin.base64");
            objNode.text = b64;
            return (byte[])objNode.nodeTypedValue;
        }

 

Thanks!
  • October 18, 2010
  • Like
  • 0

Hi,

 

Any ideas how I can print an Attachment given I know the url to it? The url to an Attachment is something like:

https://na3.salesforce.com/servlet/servlet.FileDownload?file=00PA0000002Dlc5

 

The Documents.Open() method takes in a url, and the above url doesn't work.

  • October 01, 2010
  • Like
  • 0

Hi,

 

Anybody knows how to get the actual link to a file sitting inside an Attachment? Currently when you say "View this file" you go to something like:

https://na2.salesforce.com/servlet/servlet.FileDownload?file=00PA0000005EPlt

 

What I'm looking for is:

http://??????????/myFile.doc

 

Any ideas? Thanks!

  • September 22, 2010
  • Like
  • 0

In a trigger on Contact, Trigger.new[i] is a Contact object. If this object has a valid AccountId against it shouldn't Trigger.new[i].Account not be null as well? This doesn't seem to be true. Any ideas why?

  • September 14, 2010
  • Like
  • 0

Anybody knows if there's a way to tell a WF field update formula to look for a string from the end? Something like INSTRREV in Access.

 

Thanks!

  • September 08, 2010
  • Like
  • 0

Hi,

 

We have some triggers on some object X, and then there are a couple Field Update Workflows on the same object that run after the triggers. These Workflows cause the same triggers to fire again because they update object X (as a result of Field Update). What I want to do is prevent this from happening. Is there a way to queue triggers to run after Workflows? An alternative method is perhaps using an intermediary static class to keep track of the triggers that have already run, but then I don't know if this class can keep its state after the Workflows start running.

 

Any help is appreciated!!

  • August 03, 2010
  • Like
  • 0

In the Offline Mode there's a sync functionality that syncs your local data up to your SF org, and vice versa. I believe there is some complex code in the backend that takes care of data overwrites and conflicts etc. I was wondering if the smarts of this sync function was exposed through the Java API?

 

Thanks.

Hi,

 

I have a custom exception class like so:

 

 

global class MyException extends Exception {
    
    global Boolean isCritical { get; private set; }
    
    global MyException( String msg, Boolean isCritical)
    {
        this(msg);
        this.isCritical = isCritical;
    }
}

 

 

But when MyException is thrown and caught the message that I get says "script-throw exception" as opposed to the message that I had specified.

 

Any ideas on how to get the message out of the exception? Thanks.

Hi,

 

I have a page written using dojo. This page works fine on all browsers when loaded locally but doesn't work in IE 8 when loaded from Salesforce (i.e. converted into a VF page with the libraries stored as Static Resources). I get:

 

dojo.body() is null or not an object

 

Any ideas why this is the case? Thanks!

The replacement does not happen at all in this code. Any ideas why?!!

 

 

String res = //some very long string of length 72000 chars
res = res.substring(4000, 5000); //this substring contains carriage return chars \n

res = res.replaceAll('\n', ' ');
system.debug(res);

 

Thanks in advanace!

Hi all,

 

I was running my test cases when I got this error message. The code I was testing is a few months old and it used to pass just fine, so I guess something happened during the Spring '10 release that is affecting my code. And btw, I have no idea what this error even means! It'd be great if someone could shed some light on this issue.

 

Thanks!!

Hi,

 

I have a few CSS-based pages written in JavaScript and and index file in HTML. These guys work beautifully on my local machine but when I upload them into salesforce as a Static Resource and convert the index page to a VF page all of a sudden the styles get messed up. eg. some font colours change. The CSS files are being loaded fine as the font types and everything is showing correctly.

 

Any ideas? Thanks!

  • April 30, 2010
  • Like
  • 0

Hi,

I have a bunch of JavaScript packages written using dojo and stored on some server. These packages are called com.abc.xyz.pkg# (with folder structure like http://server/~company/moduleX/src/com/abc/xyz/pkg#.js), and I want to include them in a VF page. The following doesn't work:

 

 

			djConfig = {
				parseOnLoad: true,
				baseUrl:'./',
				modulePaths:{'com.abc.xyz':'http://server/~company/moduleX/src/com/abc/xyz'},
				isDebug: false,
				usePlainJson: true
			};

			dojo.require("com.abc.xyz.pkg1");

			function onPageLoadHandler() {
				alert("Page loaded");
			};
			
			dojo.addOnLoad(onPageLoadHandler);

 

The error message is that "com" is undefined. The "Page loaded" message is also never displayed.

Any ideas would be appreciated.

 

  • April 26, 2010
  • Like
  • 0

Hi,

 

I have a VF page that simply outputs some text:

 

<apex:page controller="myController" contentType="text/javascript" showHeader="false">
some garbage text
</apex:page>

 Then I have a JavaScript that uses XMLHttpRequest to make a request to the above VF page:

 

var url = "http://na4.salesforce.com/apex/myPage";
xmlhttp.open('GET', url, true);
xmlhttp.send(null);

 Before making the request I make sure that I'm logged in with my salesforce account (so that I don't need to pass user/pass thru the url). The problem is that, I never get anything back. xmlhttp.status is always 0 and xmlhttp.responseText is always blank. Firebug shows the status of the GET request as 200 OK.

 

Any ideas how I should make REST calls to a VF page and get the response back? Thanks!!

 

 

  • April 22, 2010
  • Like
  • 0

Hi,

 

We have a web service written in Apex that I'd like to access from a JavaScript-based page that is hosted on some server (i.e. not a visualforce page). Any ideas on how I can do that?

 

Thanks.

  • April 16, 2010
  • Like
  • 0

We used to have an existing package which we had to modify, and now this modification is not getting installed into the client environemnt. Basically the modification in question was a change to the Name Field on a few custom objects (changed the type). The interesting thing is that this change gets sucked into the package with no issues.

 

My question is, if this is the intended behaviour then why was no documentation on this? We are pretty much at a point of no return and we can get screwed big time over this problem.

 

Any help is grealy appreciated.

 

  • April 09, 2010
  • Like
  • 0

Hi,

 

I'm using the Sforce Office Toolkit and I get the following error when I try logging into a client's system:

INVALID_LOGIN: Invalid username, password, security token; or user locked out.

 

I can login to our developer accounts just fine -it's only the clients that don't work. The credentials that I'm using are 100% correct.

 

Any ideas?

  • March 26, 2010
  • Like
  • 0

Hi,

 

I have developed an Office add-in which I'm trying to deploy using a MS installer. The issue is that after the installation is done I try to launch my add-in but I get this error:

 

Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154.

 

I've heard that this has to do with the DLL not being registered (DLL is the Office Toolkit DLL). I cannot register the dang thing using regsvr32 either for this error message:

 

"Make sure that yourdll.dll is a valid DLL or OCX file and then try again."

 

So I'm kind of stuck! Any ideas would be appreciated.

  • March 24, 2010
  • Like
  • 0

Can we get a proper log without any limitations? I have a batch that works fine when the record count is low but fails at high counts. In the latter case I cannot see what the error was because the debug log cuts off somewhere in the middle. Up until now I have been dealing with this just by making guesses and trial and error changes but I really don't think I should be doing that!! :)

 

Is it possible to see what the error was? Thanks.

  • December 16, 2009
  • Like
  • 1

Hi,

 

Inside Contact I'd like to look for all contacts whose first name + ' ' + last name equals a local varialbe, say myVar. I can't figure out how to do the concatenation. I've tried :(FirstName + ' ' + LastName) and that didn't work. This is an inline query. Any ideas please? Thanks!

  • September 09, 2009
  • Like
  • 1

Hi,

 

Is there a way to select everything in SOQL like "SELECT *" in SQL? I have looked at the SOQL manual about SELECT statements but it didn't tell if I can do this or not.

 

Thanks.

  • September 08, 2009
  • Like
  • 1

Hi,

 

We have thousands of attachments that we want to associate to new parents. Exporting them using Data Loader and loading them into Access/Excel will cause bad data imports (data is delimited incorrectly or the Office tool won't be able to open them). In Apex you can't overwrite the parentId field.

 

What's the solution? Any ideas? Thanks!

  • October 18, 2010
  • Like
  • 0

Anybody knows if there's a way to tell a WF field update formula to look for a string from the end? Something like INSTRREV in Access.

 

Thanks!

  • September 08, 2010
  • Like
  • 0

In the Offline Mode there's a sync functionality that syncs your local data up to your SF org, and vice versa. I believe there is some complex code in the backend that takes care of data overwrites and conflicts etc. I was wondering if the smarts of this sync function was exposed through the Java API?

 

Thanks.

Hi,

 

I have a page written using dojo. This page works fine on all browsers when loaded locally but doesn't work in IE 8 when loaded from Salesforce (i.e. converted into a VF page with the libraries stored as Static Resources). I get:

 

dojo.body() is null or not an object

 

Any ideas why this is the case? Thanks!

The replacement does not happen at all in this code. Any ideas why?!!

 

 

String res = //some very long string of length 72000 chars
res = res.substring(4000, 5000); //this substring contains carriage return chars \n

res = res.replaceAll('\n', ' ');
system.debug(res);

 

Thanks in advanace!

Hi all,

 

I was running my test cases when I got this error message. The code I was testing is a few months old and it used to pass just fine, so I guess something happened during the Spring '10 release that is affecting my code. And btw, I have no idea what this error even means! It'd be great if someone could shed some light on this issue.

 

Thanks!!

Hi All.

 

I couldn't find any reference to how to upgrade my code.

Editing code on the IDE, saving successfully and redeploying doesn't seem to do the trick.

 

Do I need to change the metadatafile?

Can I just type 18?

 

Thanks.

 

Ben

Hi,

 

I have a few CSS-based pages written in JavaScript and and index file in HTML. These guys work beautifully on my local machine but when I upload them into salesforce as a Static Resource and convert the index page to a VF page all of a sudden the styles get messed up. eg. some font colours change. The CSS files are being loaded fine as the font types and everything is showing correctly.

 

Any ideas? Thanks!

  • April 30, 2010
  • Like
  • 0

Hi,

 

I have a VF page that simply outputs some text:

 

<apex:page controller="myController" contentType="text/javascript" showHeader="false">
some garbage text
</apex:page>

 Then I have a JavaScript that uses XMLHttpRequest to make a request to the above VF page:

 

var url = "http://na4.salesforce.com/apex/myPage";
xmlhttp.open('GET', url, true);
xmlhttp.send(null);

 Before making the request I make sure that I'm logged in with my salesforce account (so that I don't need to pass user/pass thru the url). The problem is that, I never get anything back. xmlhttp.status is always 0 and xmlhttp.responseText is always blank. Firebug shows the status of the GET request as 200 OK.

 

Any ideas how I should make REST calls to a VF page and get the response back? Thanks!!

 

 

  • April 22, 2010
  • Like
  • 0

Hi,

 

We have a web service written in Apex that I'd like to access from a JavaScript-based page that is hosted on some server (i.e. not a visualforce page). Any ideas on how I can do that?

 

Thanks.

  • April 16, 2010
  • Like
  • 0

We used to have an existing package which we had to modify, and now this modification is not getting installed into the client environemnt. Basically the modification in question was a change to the Name Field on a few custom objects (changed the type). The interesting thing is that this change gets sucked into the package with no issues.

 

My question is, if this is the intended behaviour then why was no documentation on this? We are pretty much at a point of no return and we can get screwed big time over this problem.

 

Any help is grealy appreciated.

 

  • April 09, 2010
  • Like
  • 0

Hi,

 

I'm using the Sforce Office Toolkit and I get the following error when I try logging into a client's system:

INVALID_LOGIN: Invalid username, password, security token; or user locked out.

 

I can login to our developer accounts just fine -it's only the clients that don't work. The credentials that I'm using are 100% correct.

 

Any ideas?

  • March 26, 2010
  • Like
  • 0

Hi,

 

I have developed an Office add-in which I'm trying to deploy using a MS installer. The issue is that after the installation is done I try to launch my add-in but I get this error:

 

Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154.

 

I've heard that this has to do with the DLL not being registered (DLL is the Office Toolkit DLL). I cannot register the dang thing using regsvr32 either for this error message:

 

"Make sure that yourdll.dll is a valid DLL or OCX file and then try again."

 

So I'm kind of stuck! Any ideas would be appreciated.

  • March 24, 2010
  • Like
  • 0