• sf consultant.ax380
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies

Hello all,

Currently we have 2 custom fields on the case edit page layout.   Picklist field2 is dependent on controlling field picklist field1.  We want to change this so picklist field2 is dependent on a custom field on the Account so that the picklist is field2 is already filtered appropriately when the page loads.. ie.. Case.Contact.Account.customfield?  Is this possible?

Thanks!
USE CASE
User enters data in text area on standard field (non visual force page)  return of save button has been overrriden to call an s-control. .S-control needs to populate the value of the merge field referencing that standard field  in a javascript var and append it to the url for an iframe. (Seems simple)

PROBLEM
Darn CRLF's that are embedded in the Merge Field if user hits enter in the text area field cause disasterous results (unterminated string error) when applying the merge field value to a javascript var.

QUESTION
Why have I constantly been unsuccessful in using Substitute to remove the CRLF??  Has ANYONE gotten this to work?

I've read varous other hacks requiring additional presentation logic of hidden form fields  or hidden divs working but this is not a read only field. The user is entering this right before the s-control is called.  I've heard of maybe run an additonal query either using query or retrieve as opposed to evaling the merge field but this has not seemed to work for me either.

ie. .the below I am using to protect against single and double quotes but I've tried numerous deritives to project against carriage returns and Substitute just doesn't seem to want to do it.

var desc = encodeURI("{! Substitute(Substitute(Case.Description ,"\\","\\\\"),"\"","\\\"")}" );

Any help would be greatly appreciated as I've wasted numerous hours on this. (in any other scenario I would use the full service side power of java to remove unwanted stuff before applying to the javascript var but in the case of Force.com and using an s-control. from my understanding my server side capability in this context is somewhat limited.

Thank you!


Message Edited by sf consultant on 11-26-2008 07:56 AM

Message Edited by sf consultant on 11-26-2008 07:57 AM

Message Edited by sf consultant on 11-26-2008 07:58 AM
Use the web services api

Maybe I'm just not understanding soql after years of using actual SQL. :)  How can statement 1 (with or clause)below return 0 records while statement 2 (no or clause) returns records???  It's an "or" clause.. I'm not getting it!!

I would think no matter what the 2nd 1/2 of the or clause evals to the 1st part should still return me some records.
A cut and paste of the soql (with the or clause) into eclipse in the schema browser IS returning records.. I'm even more perplexed now.

The email parm is the same passed in both statements.The obect being evalued is the junction table in a many to many relationship.

binding.service.soap_address = https://www.salesforce.com/services/Soap/c/14.0

Someone please stop my madness and help!!! LOL

Code:
        soql =   "    Select     i.KBDocSubscribed_To__c "
            +    "    From     INET_KBDocSubscription_Bridge__c i "
            +    "    Where     KBDocSubscription_Parent__r.Email__c like '"+email+"%'"
            +    "    or         KBDocSubscription_Parent__r.Contact__r.email like '" + email + "%'";

        soql =   "    Select     i.KBDocSubscribed_To__c "
            +    "    From     INET_KBDocSubscription_Bridge__c i "
            +    "    Where     KBDocSubscription_Parent__r.Email__c like '"+email+"%'";
.....
res = binding.query(soql);
.....

 

        
Hello all,

We have users that create html documents on the fly in our application.. some may include images.. these images our stored in our DB as blobs.. Currently we use the javax.mail classes but want to switch to the SF Web Services API to send the email. 

In our current version of our 3rd party application,  HTML Images are included as attachments to the email as opposed to absolute URL's as they are stored as blobs in the database and do not exist on any file system. The HTML references the images using the protocol prefix cid: and the content id of the attachment.

I’m looking at the SF web services API and trying to find something I can use to duplicate this.  I see the setFileAttachments and setDocumentAttachments methods but I’m thinking these are not what I want to use?

Any ideas are appreciated!!!

The below is more pseudo then actual code but you should get the idea.

Code:
-------Using the javax.mail classes........
messageBodyPart = new MimeBodyPart();
DataSource fds = new FileDataSource("C:\\images\\jht.gif");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setHeader("Content-ID","<image>");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
transport.connect();
transport.sendMessage(message,

---------in the SF web service API...
com.sforce.soap.enterprise.SingleEmailMessage email =              new SingleEmailMessage()
email.setFileAttachments(i, _value)
email.setFileAttachments(fileAttachments);                                       
email.setDocumentAttachments(i, _value)
email.setDocumentAttachments(documentAttachments)

 



Message Edited by sf consultant on 09-09-2008 12:03 PM

Hello all,

I'm currently an independent consultant performing integration work for a company called Instranet (Recently acquired by Salesforce.com)  I've been providing pre-sales as well as development work in the integration of Instranets Knowledge Management tool and the Force.com platform.

I've proficient with Apex classes, Visual Force, s-controls, AJAX web service API, and Force.com administration.

I will be available soon to provide consulting efforts in both a pre-sales as well as post sales capacity. Resume is available on request. 

Please email me at rnendza@gmail.com or call me at 630-310-0898.

Thanks!

Rick

Hey guys, VF Newbie trying to figure out best approach.

Currently... on my case layout I have a custom link which calls an custom S-Control with the behavior
of Display in new window (ie.. popup) This s-control simply builds a bunch of querystring parms and changes the window's location to an external app passing these parms and then I'm good.

I have built a new VF page and I want to add the same functionality that custom link is providing on that standard case page.

Is there a way in VF to.............
1. reference this custom link and "drop it" on the page so as I can reuse all the existing code. (I don't think so)
2. maybe utilize a commandLink (I don't need a server side action called)  and then in the onclick of the command link somehow tell it to utilize the existing custom s-control and popup a new window with specific height / width.. etc.???

The more I think about this the more I know I'm thinking about this all wrong!!! :)

Any help would be appreciated!!

Thanks



Ocassionally when I'm creating a new case and hit the submit button.. depending on what I type in as the subject I'm getting a screen that shows me relevant solutoins search results. I would like to override this display to utilize solutions from a 3rd party application.  I can't seem to find out to override this screen.. Is it possible?

Cases/ create new case / hit continue / type password in the subject line and hit submit.

You should come to a page with the url similar to

https://na1.salesforce.com/ui/solution/SolutionSuggestionPage?caseid=50030000005H43L&autoredirected=1

I’ve searched high and low on all case page layouts / solution page layouts and all associated related lists and can’t find where to override this.

Something similar appeared to be in the Solutions Search Layouts – Solutions Search Results. Okay fine but that doesn’t tell me how to override the containing page to not use this..


Any ideas ... Thanks all!


 

USE CASE
User enters data in text area on standard field (non visual force page)  return of save button has been overrriden to call an s-control. .S-control needs to populate the value of the merge field referencing that standard field  in a javascript var and append it to the url for an iframe. (Seems simple)

PROBLEM
Darn CRLF's that are embedded in the Merge Field if user hits enter in the text area field cause disasterous results (unterminated string error) when applying the merge field value to a javascript var.

QUESTION
Why have I constantly been unsuccessful in using Substitute to remove the CRLF??  Has ANYONE gotten this to work?

I've read varous other hacks requiring additional presentation logic of hidden form fields  or hidden divs working but this is not a read only field. The user is entering this right before the s-control is called.  I've heard of maybe run an additonal query either using query or retrieve as opposed to evaling the merge field but this has not seemed to work for me either.

ie. .the below I am using to protect against single and double quotes but I've tried numerous deritives to project against carriage returns and Substitute just doesn't seem to want to do it.

var desc = encodeURI("{! Substitute(Substitute(Case.Description ,"\\","\\\\"),"\"","\\\"")}" );

Any help would be greatly appreciated as I've wasted numerous hours on this. (in any other scenario I would use the full service side power of java to remove unwanted stuff before applying to the javascript var but in the case of Force.com and using an s-control. from my understanding my server side capability in this context is somewhat limited.

Thank you!


Message Edited by sf consultant on 11-26-2008 07:56 AM

Message Edited by sf consultant on 11-26-2008 07:57 AM

Message Edited by sf consultant on 11-26-2008 07:58 AM
Use the web services api

Maybe I'm just not understanding soql after years of using actual SQL. :)  How can statement 1 (with or clause)below return 0 records while statement 2 (no or clause) returns records???  It's an "or" clause.. I'm not getting it!!

I would think no matter what the 2nd 1/2 of the or clause evals to the 1st part should still return me some records.
A cut and paste of the soql (with the or clause) into eclipse in the schema browser IS returning records.. I'm even more perplexed now.

The email parm is the same passed in both statements.The obect being evalued is the junction table in a many to many relationship.

binding.service.soap_address = https://www.salesforce.com/services/Soap/c/14.0

Someone please stop my madness and help!!! LOL

Code:
        soql =   "    Select     i.KBDocSubscribed_To__c "
            +    "    From     INET_KBDocSubscription_Bridge__c i "
            +    "    Where     KBDocSubscription_Parent__r.Email__c like '"+email+"%'"
            +    "    or         KBDocSubscription_Parent__r.Contact__r.email like '" + email + "%'";

        soql =   "    Select     i.KBDocSubscribed_To__c "
            +    "    From     INET_KBDocSubscription_Bridge__c i "
            +    "    Where     KBDocSubscription_Parent__r.Email__c like '"+email+"%'";
.....
res = binding.query(soql);
.....

 

        
Hello all,

We have users that create html documents on the fly in our application.. some may include images.. these images our stored in our DB as blobs.. Currently we use the javax.mail classes but want to switch to the SF Web Services API to send the email. 

In our current version of our 3rd party application,  HTML Images are included as attachments to the email as opposed to absolute URL's as they are stored as blobs in the database and do not exist on any file system. The HTML references the images using the protocol prefix cid: and the content id of the attachment.

I’m looking at the SF web services API and trying to find something I can use to duplicate this.  I see the setFileAttachments and setDocumentAttachments methods but I’m thinking these are not what I want to use?

Any ideas are appreciated!!!

The below is more pseudo then actual code but you should get the idea.

Code:
-------Using the javax.mail classes........
messageBodyPart = new MimeBodyPart();
DataSource fds = new FileDataSource("C:\\images\\jht.gif");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.setHeader("Content-ID","<image>");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
transport.connect();
transport.sendMessage(message,

---------in the SF web service API...
com.sforce.soap.enterprise.SingleEmailMessage email =              new SingleEmailMessage()
email.setFileAttachments(i, _value)
email.setFileAttachments(fileAttachments);                                       
email.setDocumentAttachments(i, _value)
email.setDocumentAttachments(documentAttachments)

 



Message Edited by sf consultant on 09-09-2008 12:03 PM
Hi,
 
I'm opening my application through an SControl and redirecting to our URL.  We then perform some operations and want the parent window (SFDC) to refresh.  However, when I use
 

Hi

I am using a Custom Control to redirect our users to the Edit Contact Page.
I am also passing some account information in the query string.

This has been working fine, Except when trying to access one of our custom fields (an address field) where the user has put carriage returns in the data.

i.e.
      17 Hammer Street
      Hammer house

Now i am using javascript to redirect the user to the contact page. Whenever i try access the field that has carriage returns on it, the javascript does not seem to execute. Trying different accounts without this carriage return worked fine.
I tried replacing the carriage return, but cannot even get that far.

I reduced the script in the sforce control to the following:

<script language="JavaScript">
function showaddress()
{
       alert("{!Account_WCF_Billing_Street}");
}
showaddress();
</script>

Again, this code runs fine for accounts in which this custom field has no carriage returns, yet just doesn't run for fields with carriage returns.

Any way around this, TIA