• Ezio_2010
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 13
    Replies

Alo there:

 

What im trying to do is restringed some text in a object field, I mean, if i got a custom object "letter" with a text field "kind" and I want to provide possible fixed values like "friendly or salary rise request or  dead threat" but that  I cannot insert another kind of text, and that's because i may be updating this field by web services api.

 

Is it possible to specify this at object creation time?

 

thank u

Alo:

 

Hope someone help me, i want to integrate salesforce app with a jee app, so im using web services api and this workflow feature, that is outbound messages, but what the...cant make heads nor tails of it.

 

The easy thing is (or at least it seems easy):

 

1. I got an object A, on the screen, I have a button and it will trigger some event, suppose populate new object B and save it.

 

2. After save object B, I have to send some fields of object A to my web service.

 

3. I have to get a response from my web service, with some id created there.

 

4. Set that id on object B and A.

 

 

the problem is, I cannot understand why if i create an outbound message, I have to use the wsdl created by force engine, why cant i call my wsdl.

 

I already parse wsdl of mine and made a class from it, but when I invoke that class within a trigger, it didn't work, some callout not permited or the like...not sure now. Then I searched on salesforce forum, and Simon was telling other guy to use outbound messages...xD

 

any help ?

 

thanks 4 reading

Alo there:

 

What im trying to do is restringed some text in a object field, I mean, if i got a custom object "letter" with a text field "kind" and I want to provide possible fixed values like "friendly or salary rise request or  dead threat" but that  I cannot insert another kind of text, and that's because i may be updating this field by web services api.

 

Is it possible to specify this at object creation time?

 

thank u

Alo:

 

Hope someone help me, i want to integrate salesforce app with a jee app, so im using web services api and this workflow feature, that is outbound messages, but what the...cant make heads nor tails of it.

 

The easy thing is (or at least it seems easy):

 

1. I got an object A, on the screen, I have a button and it will trigger some event, suppose populate new object B and save it.

 

2. After save object B, I have to send some fields of object A to my web service.

 

3. I have to get a response from my web service, with some id created there.

 

4. Set that id on object B and A.

 

 

the problem is, I cannot understand why if i create an outbound message, I have to use the wsdl created by force engine, why cant i call my wsdl.

 

I already parse wsdl of mine and made a class from it, but when I invoke that class within a trigger, it didn't work, some callout not permited or the like...not sure now. Then I searched on salesforce forum, and Simon was telling other guy to use outbound messages...xD

 

any help ?

 

thanks 4 reading

Hi, I have an object with two picklists.

One of these picklist shows some values depending on which value is set on the other one.

 

I have to implement this on a VF page.

Is there any way to get dependencies values with Describe methods?

 

For example, with getPicklistValues(), I get all values for a picklist. But I need to get only the ones associated with a particular value of the other picklist.

 

Any idea?
Thanks

 

 

How to upload file from local machine to salesforce.com.

Can you give some idea  or sample on how to implement it...!!

 

It will be great if anyone could help on this..

 

Thanks in advance.

 

Hi all, 

 

After some poking and prodding, I've gotten file attachments to work. Files are associated with apprenticeships; here's the code that I'm using for the controller extension

 

 

public PageReference deletefile() {

PageReference pageRef = System.currentPageReference();

apprenticeshipId = pageRef.getParameters().get('id');

ctContactId = pageRef.getParameters().get('ctContactId');

url = '/apex/CTN_Apprenticeship';

 

fileId = System.currentPageReference().getParameters().get('fileId');

attachment = [select Apprenticeship__c.attachment__r.id from Apprenticeship__c where attachment__r.id = 'fileId'];

delete attachment;

 

urlstring = url + '?id=' + apprenticeshipId + '&ctContactId=' + ctContactId;

PageReference ref = new PageReference(urlstring); ref.setRedirect(true); return ref;

}

 

 

 

 

The question is about how users can remove files. How do I query the NotesAndAttachments child object? I've tried a bunch of things, but all seem to throw errors (and googling "NotesAndAttachments" only pulls up minimal results!).

 

Has anyone been through this? Does anyone have suggestions about what a simple query might look like that I could use to populate a deletefile() action, or point me toward a code snippet that might accomplish the same? Thanks so much!

 

--Dave 

 

 

Message Edited by davecruso on 06-03-2009 08:56 AM
Message Edited by davecruso on 06-03-2009 08:57 AM
Message Edited by davecruso on 06-03-2009 08:58 AM

 

<apex:includeScript value="/soap/ajax/15.0/connection.js"/><apex:includeScript value="/soap/ajax/15.0/apex.js"/>sforce.connection.sessionId = '{!$Api.Session_ID}';

I have the above code in a visualforce page.

As per document, the AJAX toolkit supposed to handle the session Id by itself with no extra work.

But i get invalid sessionID error, if i dont set it onload of the page.

 

Is there something i'm missing?

Is using Controller the alternative to avoid this?

 

Thanks

KK 

 

 

Hello,

 

I am building a Visualforce page that is bound to the Case standard controller. This page is replacing the standard New Case page in Salesforce.com. I want to include an input that allows users to add an attachment to their Case when they are creating the record using my page. I already have a controller extension that this page is using to enhance the New Case process. I see that there was a new "apex:inputFile" component included in the Winter 09 release that allows me to do this. The documentation gives me the following usage example:

 

(from: http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_inputFile.htm)

 

 

<; Page: --><apex:page standardController="Document" extensions="documentExt"><-- Upload a file and put it in your personal documents folder--> <apex:messages /> <apex:form id="theForm"> <apex:pageBlock> <apex:pageBlockSection> <apex:inputFile value="{!document.body}" filename="{!document.name}"/> <apex:commandButton value="save" action="{!save}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form></apex:page> /*** Controller ***/public class documentExt { public documentExt(ApexPages.StandardController controller) { Document d = (Document) controller.getRecord(); d.folderid = UserInfo.getUserId(); //this puts it in My Personal Documents } }

 

However, this code assumes that the page is bound to the Document standard controller. Also, since the Case record is not yet created, I cannot specify the parent ID of the Case for my attachment since it does not exist yet (remember, this page replaces the standard New Case page.)

 

Can someone explain to me how I would modify my controller extension to make the "apex:inputFile" component work in this scenario? I'm planning on adding this to my Visualforce page:

 

<apex:pageBlockSectionItem> <apex:outputLabel value="Add attachment:" /> <apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" /> <apex:commandButton value="save" action="{!save}" /></apex:pageBlockSectionItem>

 

 

 but I know that I will need to modify my controller extension to make this work. Also, if I use:

 

<apex:commandButton value="save" action="{!save}" />

 

 

how will it know to just save the attachment, and not the entire Case page?

 

Thanks for any help that you can provide. I'm pretty new to Visualforce/Apex development, so examples of how to make this work would be greatly appreciated! :)

 

Thanks,

 

-- Rob 

 

I am trying to get my enterprise.wsdl to compile with the wsimport tool from the latest JAX-WS release. Basically what I am trying to do is to eventually move our application away from the now pretty tired Axis 1 environment to JAX-WS which will in due course come bundled with Java 1.6.

Typical errors are like:

 [wsimport] [ERROR] A class/interface with the same name "com.sforce.soap.enterprise.DescribeLayout" is already in use. Use a class customization to resolve this conflict.
 [wsimport]   line 2611 of file:/home/mm/oscar/build_current/dev/jaxws/sforce/enterprise.wsdl

 [wsimport] [ERROR] (Relevant to above error) another "DescribeLayout" is generated from here.
 [wsimport]   line 2456 of file:/home/mm/oscar/build_current/dev/jaxws/sforce/enterprise.wsdl

It seems wsimport which I believe internally uses the xjc compiler from JAXB doesn't like identical element and type names.

Have others encountered the same / similar problem? Are there simple solutions (I know I can create custom bindings for those elements but that is pretty painful)?

Thanks
  • December 06, 2006
  • Like
  • 0
Hi All,

I need to select all the fields ( like accountName, accountNumber etc ) of Account ( or any sobject ) through SOQL.

I constructed the select qurey as follows.

DescribeSObjectResult res = binding.describeSObject( "Account" );
Field[] fields = res.getFields();
String expr = "";
for( int i=0; i < fields.length-1; i++ )
{
expr += fields[i].getName() + ", ";
}
expr += fields[ fields.length - 1 ].getName();

String qry = "Select " + expr + " from Account";
QueryResult res = binding.query( qry );

While executing this, I am getting following exception.

Is there any easier way to achieve this!

Kindly help me solve this problem!

Regards,
Ganesh Kumar N.S.A

Exception in thread "main" java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:135)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at com.adventnet.authentication.interceptor.ClientPrincipalAssociator.invoke(ClientPrincipalAssociator.java:52)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
at $Proxy1.importFromSForce(Unknown Source)
at com.adventnet.examples.ImportUtilClient.main(ImportUtilClient.java:39)
Caused by: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1603)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1271)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215)
... 10 more
Caused by: java.io.NotSerializableException: org.apache.crimson.tree.ElementNode2
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1224)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1050)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:367)
at java.util.Vector.writeObject(Vector.java:1017)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
  • April 23, 2004
  • Like
  • 0