• mat_tone_84
  • NEWBIE
  • 155 Points
  • Member since 2008

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 52
    Questions
  • 109
    Replies
It is possibile to create a trigger in "after update" that login to other organization with user e pass and update a field in the other our organization.
I don't want to use salesforce to salesforce connector.
Anyone can suggest me a way to do this?
thanks
Hi,
in vb.net i'm able to null a list of fields that i knows, but i'm looking for the way to repeat for each field of an object, for example, "opportunity" and check if the field is null. After that I can update my object.
Anyone can help me?

now i do this and work properly:
anull(0) = "custom_field_aasdfa__c"
anull(1) = "custom_field_basdfasb__c"
anull(2) = "custom_field_csdfac__c"
opportunityx.fieldstonull = anull
arrayopportunity(0) = opportunityx
saveresultx = client.update(arrayopportunity)
the problem is that i don't know which are the null field.
if I use "describeSObject" I can get the property of the field but not the value for check if it is null...
I think to do something like this:
for i = 0 to 500 'max number of the field into the opportunity
   if opportunityx.fieldname = "" then
       anull(z) = fieldname  <--- where i find it ?? 
end if
next i

 
Hi,
I came from vb6 and I try to write some code into visual studio express 2013 desktop. I look to this link "https://developer.salesforce.com/page/Integrating_Force.com_with_Microsoft_.NET" for get some ideas but i don't found the solution to my problem .
i need to update some fields of contact, this is my code, anyone can help me please? thanks
i imported into vbnet wsdl enterprise "wsdl.jsp.xml" from my salesforce 

Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
        'sf = service references
        'sforce1 = web references
        Dim SfdcBinding As sforce1.SforceService = New sforce1.SforceService
        Dim CurrentLoginResult As sforce1.LoginResult

        CurrentLoginResult = SfdcBinding.login("myuser", "passtoken")

        SfdcBinding.Url = CurrentLoginResult.serverUrl
        SfdcBinding.SessionHeaderValue = New sforce1.SessionHeader
        SfdcBinding.SessionHeaderValue.sessionId = CurrentLoginResult.sessionId
        Dim contact() As SF.Contact
        contact(0) = New SF.Contact ' i use sf because sforce1 haven't a list of object lead,case,opportunity,contact,account...
        contact(0).Id = "0032000000Hppxn"
        contact(0).MobilePhone = "34911111111"

        Dim saveResults As sforce1.SaveResult
        saveResults = SfdcBinding.update(contact(0)) ' <---- HERE i have an error when compile: cannot convert sf.contact into matrix sforce1.sobject

        If saveResults.success Then
            MsgBox("update ok")
        Else
            MsgBox("update ko")
        End If
      
    End Sub
Hi,
I need to create a template for use into opportunity which get attachment stored into the opportunity into note&attachments.
I'm able to do this with a trigger but I'm not able to create a template.
My goal is to send an email and the receiver will be able to open pdf.
I try this code but I have a pdf with this text : "core.filemanager.ByteBlobValue@22ad1468" 

<messaging:emailTemplate subject="test email" recipientType="Contact" relatedToType="Attachment">
<messaging:plainTextEmailBody >
test new template xxxx
</messaging:plainTextEmailBody>
<messaging:attachment renderAs="pdf" filename="filename.pdf">
{!relatedTo.body}
</messaging:attachment>
</messaging:emailTemplate>

I found some topic for convert "body" into a blobvalue or similar but I didn't solve the problem

Hi,

I have a trigger that work properly for send email with attachments.

Now I need to create 1 pdf from 2 attachment, how can I join the blob of 2 attachments ?

I think : blob joinedpdf = att2.body & att3.body;

after that I will add attachment joinedpdf in the email, anyone can help me? 

thanks

 

attachment Att2 = [Select body, name from attachment where name like 'yyyy' and parentid = :az limit 1];    
document att3 =[select body,name from document where name = 'xxx' limit 1]; 

Messaging.EmailFileAttachment fileAttachment2 = new Messaging.EmailFileAttachment();
fileAttachment2.setBody(att2.body);
fileAttachment2.setFileName('test.pdf');
fileAttachments.add(fileAttachment2);

Messaging.EmailFileAttachment fileAttachment3 = new Messaging.EmailFileAttachment();
fileAttachment3.setBody(att3.body);
fileAttachment3.setFileName('test2.pdf');
fileAttachments.add(fileAttachment3); 

 

Hi,

I have a VF page that render as Pdf.

I need to show an image if a custom field has a custom value

 

This code works properly since some days ago but now doesn't work and I didn't any change to code!

 

<img id="id_image"  src="{!if(opportunity.field__c = "a",'/servlet/servlet.FileDownload?file=01520000001OEBG','')}"  height ="{!if(opportunity.field__c = "a",'948','0')}" width = "{!if(opportunity.field__c = "a",'700','0')}" />

 I get this error: 

The image at '' has a dimension set to 0. This can happen when the image is cached and later used with a different CSS style. Add a '?style=YourCssStyle' query parameter to the image URL to prevent caching.

 

I try to substitute 0 with null but I have a small image in the top corner left

 

How can I change the code or Do you know anoter way for my problem ? 

 

thanks

Hi,

I need to create a vf page into contact for get a field of a custom object, is it be possible ?

 

the query is like: "select customobject_customfield from customobject where customobject_customfield = :contact_city"

 

I will create a new visualforcepage , put it into the layout of contact and get a custom message to the user.

 

I'm able to create the trigger with query by eclipse, but it is the first time that I have to create a query into visualforcepage

 

Someone can give me some help with the syntax ?

 

thanks

Hi,

I want create a custom vf page with this code, but I get syntax error. 

I read the help of SF but I didn't find the answer of my problem :(

 

<apex:page renderAs="pdf" standardController="opportunity"> <html><head>            {!if(isblank(opportunity.custom1__c),'true',{!opportunity.custom2__c})}

{!if(isblank(opportunity.custom1__c),'true',<apex:outputText value="{!opportunity.custom2__c}"/>)}

{!if(isblank(opportunity.custom1__c),'true',<apex:outputText value="'"/>)}

{!if(isblank(opportunity.custom1__c),'true',<br/>)}

</head>


<body>
</body>

</html>
</apex:page>

 

all 4 IF doesn't work,

2nd ,3th and 4th I get syntax error.  ""<""

1st I get syntax error

 

I have to create a custom pdf with custom phrases by checking the value of "opportunity.custom1__c"

 

thanks

 

 

Hi,

I want delete many activiy history for reduce the data storage into SF.

 

I did a query with data loader by query task using filter like "where createddate < 2010-06-01:00:00:00.000z" and work properly (I got id and I deleted with dataloader many task)

 

But I see that there are many activity history which I can't delete, I try to count it on eclipse with this code :

select count() from activityhistory where createddate < 2010-06-01....

 but eclips give me a popup : "you can't do a query into this object"

 

How can I get ids of activityhistory and then delete it with dataloader?

 

thanks

 

 

 

I need a field with formula which do this:

 

 

- read the field "createddate" of all opportunities of contact

- take the last created opportunity

- show custom field

 

It is possibile?

 

I create a field with this code but doesn't work

 

Opportunit__r.createddate

 thanks

 

 


trigger update_date on CampaignMember (after update) {
   //create list of members
   list<CampaignMember> memb = new List<CampaignMember>();
   for (CampaignMember m : Trigger.new) {
       memb.add(m);
   }
   list<CampaignMember> memb_old = new List<CampaignMember>();
   for (CampaignMember m2 : Trigger.old) {
       memb_old.add(m2);
   } 
if (memb.get(0).status == 'sent' && memb_old.get(0).status == 'not sent' ){   

list<contact> list2 = [select id,date_last_sent_email__c from contact where Id = :memb.get(0).contactid];
        for(contact c: list2){
            if (memb.get(0).type_campagna__c.contains('%email%')){
               list.get(0).date_last_sent_email__c  = system.today();  
            }
        }
        update list2 ;
}
}

 hi!

this code works properly with one member, if I update more than 20 records the trigger update only one member and not all 20!!

Maybe Do have I to optimize the code, any suggestions ?

thanks

 

Hi!

I create a trigger which send an email that work properly but I want to changhe or hide the sender email.

I want send an email with custom sender, but I don't find the way to do this.

 

I have this code into my trigger:

 

string emailcustom = list_o.get(0).email_custom__c;           
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            mail.setReplyTo(emailcustom);
            mail.setSenderDisplayName(emailcustom);

in my test the field email_custom__c has this value "test_1@xxx.com"

email of my organization is "myemail@xxx.com"  This email was setup by me on SF here: setup -> personal setup -> email -> My Email Settings

 

when I send email, the receiver will have in the header of email :

from test_1@xxx.com <myemail@xxx.com>

 

and now If the receiver reply to me, according to the client (outlook,gmail,yahoomail,...) of email wich he use I will have 2 case:

A - He reply to test_1@xxx.com

B - He reply to myemail@xxx.com

 

Gmail work properly and so it does the case A, but in the most other case I have the case B

 

How Can I solve this problem ? I want only the case A

 

Thanks!

 

 

 

Hello!

I have to do a trigger which send an email when the attachment's size is > of X kb.

I see that I can't create trigger into sandbox, because there isn't the object "attachment".

first question: Do have I to create the trigger only by eclipse ???

second question: Using the body.size() Will I solve my problem ?

thanks

In this days I want study the develop of force.com sites.

 

I want to do this:

a) create site ( easy thing and for this I don't want support)

b) create a reserved page where user can access with a password valid only for X hours, or create a reserved site valid only for X hours

 

The visitor join into my site, click on a standard link in homepage and he will receive by email the temporary password active only for X hours or reserved link active only for x hours.

 

It will be possibile the question at b) ?

 

thanks

Hi,

since yesterday the code work properly and I saw the popup of url, but now it doesn't show me any popup

I want open popup with url every time if the stagename of opportunity is closed/won.

I have active the popup on chrome, ie , firefox.

What kind of problem is it ?

thank

 

 

<apex:page standardController="opportunity" >
    
  <script src="/soap/ajax/10.0/connection.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/functions.js"></script>
<script>

if ('{!Opportunity.StageName}' == 'closed/won') {
var url1= 'http://www.mysite.com/'
window.open(url1)
}
</script>

 

 

hello, I use this code for validation of opportunity.

 

trigger convalidation_opportunity on opportunity (after update) {
    list<opportunity > list_opp= new List<opportunity >();
    for (opportunity o: Trigger.new) {    
        list_opp.add(o);
        }    
    if (list_opp.get(0).stagename== 'test value'){
        if (list_opp.get(0).test_field__c == null){
            list_opp.get(0).test_field__c.adderror('check this field');  
        }

if(list_opp.get(0).field__c == null){
list_opp.get(0).field__c.adderror('check this field');
}
} }

 If I work on opportunity in edit mode(by clicking on edit), the error will be show at the top of opportunity page, instead if I work with "Inline Editing" the error will be show near the field.

I have about 30 "if condition" and If I work on edit mode, I don't understand where is the field with error, but I have about 30 error in the top of page.

How can I solve this ?

thanks

 

 

Hi.

I see that SF auto update the close date every time I change(not rename) the account of opportunity, why?? Does it normal for SF ?

 

For example:

I have opportunity with:

won = true

closedate = 01 jan 2010

stagename = close/won

 

today 21 may 2010 if I change(not rename) account of the opportunity , because I check that is wrong, and I save the opportunity the results will be:

 

won = true

closedate = 21 may 2010

stagename = close/won

 

I have no worfkflow or trigger active, that do this change of closedate.

 

I think it is a bug of salesforce.

 

Another bug is that in 21 may 2010, if I change account of the opportunity some workflow will be fired again. This workflow that will be fired doesn't have any criteria linked to the change of account!!

 

Hi,

I'm new with visualforce.

I want that the true value ( messagge1_true) of this condition will be in a custom color , for example yellow

 

 

<apex:page standardController="opportunity" >

    
    <b>{!IF(contains(opportunity.custom_fields__c, "testvalue"), "messagge1_true", "messagge2_false")}</b>
    
    
    
</apex:page>

 I try to put <apex:outputText color="yellow"> before the " <b> " and </apex:outputtex> after "</b>"  but doesn't work....

I try to read salesforce_pages_developers_guide.pdf but I find only the way of <style> tag with html but doesn't work too

 

thanks

 

Some time I have in the desktop some file for upload into opportunities.

 

I'm studying a program in vb6 for clicking on file on the desktop with right click and chose the menu "upload to salesforce".

After, the user will be write the id of opportunities, and the work as done!!

I will have my file on desktop into SF; in this way is more fast than upload manually into SF and login etc...

 

I'm able to loggin into sf and update field, but I'm not able to upload file, maybe I have to create a field with bloob or something similar....

Anyone can help me ?

I'm looking on discussion boards but I find something only for vb.net .

 

thanks!

 

Hi,

I create a datetime fields and I want to write it the date of CreatedDate with custom hours and minutes. If it will exist a function datetime like date(year,month,day) I solve my problem!!

 

The problem is that I want to send an email to lead at X hours Y minutes with workflow.

If the lead was created in the night, I don't want send email to lead immediately and so I will send the email in the office time (9am to 8 pm) and not in the night

Maybe I have to do a case condition, because if the lead is created at 9 pm, the datetime field will have the next day at 9 am

 

I think to write some code like this

 

 

date( year(datevalue(createddate)), month(datevalue(createddate)),day(datevalue(createddate)) ) & 09:00:00.000Z

 

 

 

Anyone can help me?

Hi,
in vb.net i'm able to null a list of fields that i knows, but i'm looking for the way to repeat for each field of an object, for example, "opportunity" and check if the field is null. After that I can update my object.
Anyone can help me?

now i do this and work properly:
anull(0) = "custom_field_aasdfa__c"
anull(1) = "custom_field_basdfasb__c"
anull(2) = "custom_field_csdfac__c"
opportunityx.fieldstonull = anull
arrayopportunity(0) = opportunityx
saveresultx = client.update(arrayopportunity)
the problem is that i don't know which are the null field.
if I use "describeSObject" I can get the property of the field but not the value for check if it is null...
I think to do something like this:
for i = 0 to 500 'max number of the field into the opportunity
   if opportunityx.fieldname = "" then
       anull(z) = fieldname  <--- where i find it ?? 
end if
next i

 
Hi,
I came from vb6 and I try to write some code into visual studio express 2013 desktop. I look to this link "https://developer.salesforce.com/page/Integrating_Force.com_with_Microsoft_.NET" for get some ideas but i don't found the solution to my problem .
i need to update some fields of contact, this is my code, anyone can help me please? thanks
i imported into vbnet wsdl enterprise "wsdl.jsp.xml" from my salesforce 

Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
        'sf = service references
        'sforce1 = web references
        Dim SfdcBinding As sforce1.SforceService = New sforce1.SforceService
        Dim CurrentLoginResult As sforce1.LoginResult

        CurrentLoginResult = SfdcBinding.login("myuser", "passtoken")

        SfdcBinding.Url = CurrentLoginResult.serverUrl
        SfdcBinding.SessionHeaderValue = New sforce1.SessionHeader
        SfdcBinding.SessionHeaderValue.sessionId = CurrentLoginResult.sessionId
        Dim contact() As SF.Contact
        contact(0) = New SF.Contact ' i use sf because sforce1 haven't a list of object lead,case,opportunity,contact,account...
        contact(0).Id = "0032000000Hppxn"
        contact(0).MobilePhone = "34911111111"

        Dim saveResults As sforce1.SaveResult
        saveResults = SfdcBinding.update(contact(0)) ' <---- HERE i have an error when compile: cannot convert sf.contact into matrix sforce1.sobject

        If saveResults.success Then
            MsgBox("update ok")
        Else
            MsgBox("update ko")
        End If
      
    End Sub
Hi,
I need to create a template for use into opportunity which get attachment stored into the opportunity into note&attachments.
I'm able to do this with a trigger but I'm not able to create a template.
My goal is to send an email and the receiver will be able to open pdf.
I try this code but I have a pdf with this text : "core.filemanager.ByteBlobValue@22ad1468" 

<messaging:emailTemplate subject="test email" recipientType="Contact" relatedToType="Attachment">
<messaging:plainTextEmailBody >
test new template xxxx
</messaging:plainTextEmailBody>
<messaging:attachment renderAs="pdf" filename="filename.pdf">
{!relatedTo.body}
</messaging:attachment>
</messaging:emailTemplate>

I found some topic for convert "body" into a blobvalue or similar but I didn't solve the problem

Hi,

I have a VF page that render as Pdf.

I need to show an image if a custom field has a custom value

 

This code works properly since some days ago but now doesn't work and I didn't any change to code!

 

<img id="id_image"  src="{!if(opportunity.field__c = "a",'/servlet/servlet.FileDownload?file=01520000001OEBG','')}"  height ="{!if(opportunity.field__c = "a",'948','0')}" width = "{!if(opportunity.field__c = "a",'700','0')}" />

 I get this error: 

The image at '' has a dimension set to 0. This can happen when the image is cached and later used with a different CSS style. Add a '?style=YourCssStyle' query parameter to the image URL to prevent caching.

 

I try to substitute 0 with null but I have a small image in the top corner left

 

How can I change the code or Do you know anoter way for my problem ? 

 

thanks

Hi,

I need to create a vf page into contact for get a field of a custom object, is it be possible ?

 

the query is like: "select customobject_customfield from customobject where customobject_customfield = :contact_city"

 

I will create a new visualforcepage , put it into the layout of contact and get a custom message to the user.

 

I'm able to create the trigger with query by eclipse, but it is the first time that I have to create a query into visualforcepage

 

Someone can give me some help with the syntax ?

 

thanks

Hi there,

 

From what i am reading, it is possible to send a pdf attachment in a visual force email template. But only if that attachment is created on the fly using merge fields. 

 

Is it possible to attach a pdf file that is stored in the Notes & Attachments object, and have that attachment sent with the visual force email template?

 

 

Hello, I am looking to have attachments (i.e. actual physical file and not the link) in vf email template. How do i accomplish this? Appreciate if you have any sample code. Thanks

Hi,

I want create a custom vf page with this code, but I get syntax error. 

I read the help of SF but I didn't find the answer of my problem :(

 

<apex:page renderAs="pdf" standardController="opportunity"> <html><head>            {!if(isblank(opportunity.custom1__c),'true',{!opportunity.custom2__c})}

{!if(isblank(opportunity.custom1__c),'true',<apex:outputText value="{!opportunity.custom2__c}"/>)}

{!if(isblank(opportunity.custom1__c),'true',<apex:outputText value="'"/>)}

{!if(isblank(opportunity.custom1__c),'true',<br/>)}

</head>


<body>
</body>

</html>
</apex:page>

 

all 4 IF doesn't work,

2nd ,3th and 4th I get syntax error.  ""<""

1st I get syntax error

 

I have to create a custom pdf with custom phrases by checking the value of "opportunity.custom1__c"

 

thanks

 

 

Hi,

I want delete many activiy history for reduce the data storage into SF.

 

I did a query with data loader by query task using filter like "where createddate < 2010-06-01:00:00:00.000z" and work properly (I got id and I deleted with dataloader many task)

 

But I see that there are many activity history which I can't delete, I try to count it on eclipse with this code :

select count() from activityhistory where createddate < 2010-06-01....

 but eclips give me a popup : "you can't do a query into this object"

 

How can I get ids of activityhistory and then delete it with dataloader?

 

thanks

 

 

 

I need a field with formula which do this:

 

 

- read the field "createddate" of all opportunities of contact

- take the last created opportunity

- show custom field

 

It is possibile?

 

I create a field with this code but doesn't work

 

Opportunit__r.createddate

 thanks