• MarceldeB
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 31
    Replies

I am  getting this error when trying to call a batch from an after insert after update trigger.  The batch works when called from the scheduler.  I have no @future methods in my org and a Trigger is not a batch method, so anyone knows what the deal is?

Hi,

To be able to create some specific functionality on history tracking, I need to find out which fields of an object have been indicated for history tracking.

 

In the documentation (DescribeFieldResult) I didn't find any method for this. But I hope anyone might have figured out a way to determine this...

 

Thanks, Marcel.

Hi, I want to show a date with the month in words (january 1). In apex I use datetime.format('MMMM d').

But the returned name of the month is always in English, and my customers speak Dutch... Any tricks how to get the dateformat return in a local language?

Thanks, Marcel.

Hi, we would like to earmark emails we send as a singleEmailMessage as 'private'. In Outlook this gives the receiver the possibility to keep them out of the sharing of his mails with a secretary. Anyone knows wether it is possible to do this in apex messaging classes or otherwise?

Thanks, Marcel.

Hi,
we recently found out that since some time (could be since the summer '12 upgrade but I am not sure) the apex error messages 'Unexpected error, your development organization has been notified' are not being sent from some of the orgs where our app (managed package) is installed.
So now customers expect we get a message but we don't.
We didn't change anything in our app settings, the mail address for error messages in the app is filled in as before.
Anybody familiar with this?

Regards, Marcel.

Hi, I need to create an XML document with encoding ISO-8859-1.

In the XML header I added the encoding in the tag writeStartDocument, but when running I get the error message:

Underlying stream encoding 'UTF-8' and input paramter for writeStartDocument() method 'ISO-8859-1' do not match

 

Looks like UTF-8 is hard-coded somewhere! could not find any learnings on this apart from a comparable message from 2010 on this. Anyone knows or has a solution for this?

 

XmlStreamWriter la = new XmlStreamWriter();
  la.writeStartDocument('ISO-8859-1', '1.0');
  la.setDefaultNamespace('http://www.pensioenaangifte.nl/schemas/Pensioenaangifte/2012/1/0');
  la.writeStartElement(null,'Pensioenaangifte',null);
   etc...

 


Hi,

since the upgrade to spring'12 many of my tests fail if I run them from theApex Test Execution page. But if I run them from the Apex Classes page (run all tests) they all pass fine!

 

It looks like the way the system processes simultanious tests in teh Test Execution Page has been changed. In the failing scripts I first delete all instances of a custom object and then insert a new instance, to be sure only that instance is in the database while testing. The error message I get since this week in many of my testclasses is:

 

System.DmlException: Delete failed. First exception on row 0 with id a03A0000001ItxxIAC; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []

 

Any tricks/ explanation or comment from salesforce?

thanks.

I want to render a visualforce page in Excel using contenttype = 'application/vnd.ms-excel#test.xls'.

This worked fine before except for some hidden coding in the top cells, but since a few months or so the system adds cells with week days, calendar months and year in the form of picklist to the end of the sheet. looks like unneeded html coding with a calendar picker is added. there is nothing in my page which calls these fields and they are not on the screen if I render the page regularly in html.

I saw in this board that other users have the same issues, but found no solution so far.

 

Hi,

I wondered whether there is a possibility to restrict the access to user data. I would like to be able to restrict users from viewing other users names or data like email, phonenumber etc.

Most of our users use the system in europe with an international (US) keyboard. In the numeric keypad the decimal separator is a point. In the local settings however the decimal separator is a comma. If you enter a decimal using the keypad, the point is disregarded, so 1.25 becomes 125,00!!!

Other applications such as Excel interprets this well and would convert each entry to a local settings entry, so entering 1.25 or 1,25 gives the same solution.

Anyone who has solved this in salesforce?

Hi,

I want to add a new object from a commandbutton on a VF page, where some fields are already filled in as the name/id of the employee.

I use the following:

 

<apex:commandButton value="Leaverequest" 
action="{!urlFor($Action.Leave__c.New, null, 
[CF00NA0000003nF3I=EssEmployee.name,CF00NA0000003nF3I_lkid=EssEmployee.id,retURL='/apex/'+$CurrentPage.Name])}" /> 

 

 

the id CF00NA0000003nF3I is the system id for my custom field which I want to pre-populate. This works fine, but if I deploy this in another salesforce org, the field-ID is different so it will no longer work. Just putting the fieldname in doesn't work, although that sometimes works for standard fields.

Any ideas how to get the field ID dynamically (eg in the controller)? I cannot find a getdescribe kind of solution for this.

 

we use messaging.SingleEmailMessage/ messaging.SendEmail to send out mails from apex. it seems these mails are not sent 'secure'.  our customers are urgently asking for a more secure way to send the mails. any tips how to send out mails (with attachments) in a secure way (certificates?/ssl?) from salesforce apex coding?

 

Hi, I have an inputfield 'day of birth' in my vf page. since the datepicker doesn't work here (only works fine for years ahaid or a few years in the past) and therefore is confusing, I would like to switch it off.

Any tricks how to do that?

I need to be able create a large number of PDF-rendered VF pages to send as attachments. I use getcontent for this, but this gives a timeout if called online. But getcontent is not available in @future calls or in batch jobs.

 

I have run out of ideas to get this done! Any advise?

 

to illustrate a simple version of my coding:

 

list<Messaging.EmailFileAttachment> AttList= new list<Messaging.EmailFileAttachment>();
for(ID myIDs:IDlist){
  PageReference pdf = Page.myPDFpage; // myPDFpage is VF page rendered as PDF
  pdf.setRedirect(true);
Blob b = pdf.getContent(); Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment(); efa.setFileName('mypdf.pdf'); efa.setBody(b); AttList.add(efa); } Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); email.setToAddresses(new list<String>('mymail@mail.com')); email.setSubject('myMail'); email.setPlainTextBody('This is my mail'); email.setFileAttachments(AttList); Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});

 

 

Hi,

I have a VF page with two commandbuttons (save and cancel). If a user presses the enter key halfway editing the page, the page performs the cancel command and all data is lost, while I would want the save command to be called. i searched the docu and forum but see no simple way to control the priority of the commandbuttons or the setting to link a commandbutton to the enter key. any tips?

 

 

      <apex:pageblockbuttons location="top">
        <apex:commandButton value="Opslaan" action="{!saveall}" tabindex="0" rerender="mdw,arb"/>
        <apex:commandButton value="Annuleren" action="{!cancelall}" immediate="true"/>
      </apex:pageblockbuttons>

 ps: in dutch opslaan = save, annuleren = cancel

 

I want to create a task for a custom object Employee. but the name (who field) of a task can only refer to leads or contacts, which makes no sense in this case. Is there a way to relate this field to other objects? Otherwise, is there a way to remove this field from the screen layout (it seems to be obligatory).

Hi, I created a custom object which I call from a custom Visualforce Tab. The display and edit screens of the object are layouts, no visualforce pages. In these screens, I cannot reference to my custom tab, but another tab is shown as active. I wondered if/ how I can reference the layouts of this object to my custom tab (like the command tabstyle in a visualforce page).

Hi,

I recently installed a new development environment. in my other environment I get an email with error details when there is a runtime error (developer script exception), but in the new environment I do not get these messages. Probably I miss a setting here, but I cannot find it.

I did set the 'send apex mails' checkbox in my userdetails.

any tips?

Hi,

I am writing a test script in an apex vf extension. when I run the tests in eclipse, the test also calls a trigger which I didn't select and which is absolutely not called from the script, since it covers a different object.

 

When I call the same test from the online development environment, the additional trigger is not mentioned and the test covers all coding.

 

Can anybody explain why this additional trigger might be included in the test?

Thanks.

Hi,

In my apex script I make a copy of an original list with sObjects, to see at a later phase (eg when saving the objects) wether there has been a change of any of the fields by the user.

I use deepclone (clone(true,true)) to make the copy of the relevant objects which I add to the list. Immediately after the cloning, the objects are identical (assertequals of clone and original returns true), after showing them on a vf page with only outputfields they remain identical,

but after showing them in a vf page with inputfields they are seen different (assertequals of clone and original returns false), although all fields (including system fields like lastmodifieddate and id) are identical (assertequals of the individual fields returns true).

 

Anyone who recognizes this and could think of a way to handle this without having to compare each individual field to check for changes?

 

Hi, in a visualforcepage I want to start an action (in this case a usermessage) after a change in an inputfield. I have two problems with this:

- in Firefox I got the action to work, in IE8 it doesn't work.

- if the inputfield is a date field, the action only works (in firefox) if the change is made directly in the field, not if the date is picked from the date-picker (calendar). It seems as if the system doesn't see this as a field change.

Anyone who has an advise on this?

 

Apex (extension):

... 

  public pagereference controleerBSN(){
    if (!leesobject.bsncheck(medewerker.burgerservicenummer__c)){ // checks wether ID is valid
      ApexPages.Message bsnfout = new ApexPages.Message(ApexPages.Severity.ERROR, 'BurgerServiceNummer fout');
      ApexPages.addMessage(bsnfout);
      fieldcheckStyle = 'border-size:2px; border-color:red;border-style:solid;';
    } else {
      fieldcheckStyle = '';
    }
  return null;
  }

...

 

Visualforce page:

... 

    <apex:pageBlock title="Medewerkergegevens" mode="edit" id="medewerkerblock">
      <apex:PageMessages />

...

         <apex:pageblockSectionItem >
          <apex:outputLabel value="{!$ObjectType.Medewerker__c.fields.BurgerServiceNummer__c.label}" for="bsn"/>
          <apex:outputpanel>
            <apex:inputfield value="{!mdw.BurgerServiceNummer__c}" id="bsn" style="{!fieldcheckStyle}"/>
            <apex:actionsupport event="onchange" action="{!controleerbsn}" rerender="medewerkerblock"/>
          </apex:outputpanel>
        </apex:pageblockSectionItem>

...

 

 

 

Hi,

To be able to create some specific functionality on history tracking, I need to find out which fields of an object have been indicated for history tracking.

 

In the documentation (DescribeFieldResult) I didn't find any method for this. But I hope anyone might have figured out a way to determine this...

 

Thanks, Marcel.

Hi,
we recently found out that since some time (could be since the summer '12 upgrade but I am not sure) the apex error messages 'Unexpected error, your development organization has been notified' are not being sent from some of the orgs where our app (managed package) is installed.
So now customers expect we get a message but we don't.
We didn't change anything in our app settings, the mail address for error messages in the app is filled in as before.
Anybody familiar with this?

Regards, Marcel.

During a batch apex job I have noticed the number of Total Batches is changing, lowering. It starts high and then as the job progresses the number starts to lower. It would also appear that the batch apex job is missing some of the records that should have been originally queried and are never being processed by the batch apex class.

 

Here are some images showing the drop as the batch job progresses:

1670 Total Batches

 

1623 Total Batches

 

1527 Total Batches after complete

 

The difference is 143 batches or 29,000 records which is exactly how many records are not being processed.

 

This is bizarre. Any ideas?

 

Thanks,

Jason

I am  getting this error when trying to call a batch from an after insert after update trigger.  The batch works when called from the scheduler.  I have no @future methods in my org and a Trigger is not a batch method, so anyone knows what the deal is?

I'm wanting to progammatically work out which fields (so names and types) will be available in the Field column of the History object for a table.

 

There doesn't seem to be anything on 

com.sforce.soap.partner.Field

 

Also how do I work out what the History sObject for an sObject is?

 

Thanks

 

 

I want to render a visualforce page in Excel using contenttype = 'application/vnd.ms-excel#test.xls'.

This worked fine before except for some hidden coding in the top cells, but since a few months or so the system adds cells with week days, calendar months and year in the form of picklist to the end of the sheet. looks like unneeded html coding with a calendar picker is added. there is nothing in my page which calls these fields and they are not on the screen if I render the page regularly in html.

I saw in this board that other users have the same issues, but found no solution so far.

 

Hi,

I wondered whether there is a possibility to restrict the access to user data. I would like to be able to restrict users from viewing other users names or data like email, phonenumber etc.

Hi,

I want to add a new object from a commandbutton on a VF page, where some fields are already filled in as the name/id of the employee.

I use the following:

 

<apex:commandButton value="Leaverequest" 
action="{!urlFor($Action.Leave__c.New, null, 
[CF00NA0000003nF3I=EssEmployee.name,CF00NA0000003nF3I_lkid=EssEmployee.id,retURL='/apex/'+$CurrentPage.Name])}" /> 

 

 

the id CF00NA0000003nF3I is the system id for my custom field which I want to pre-populate. This works fine, but if I deploy this in another salesforce org, the field-ID is different so it will no longer work. Just putting the fieldname in doesn't work, although that sometimes works for standard fields.

Any ideas how to get the field ID dynamically (eg in the controller)? I cannot find a getdescribe kind of solution for this.

 

I've torn my page right down to just a page (standardController, extension and tabStyle applied) with a detail tag inside (relatedList and title is set to false).

 

The tab is not being shown. When the detail is removed, it shows absolutely fine. Is this a new bug that the new spring release has put on our heads? This has never happened before, as this was an old page that worked perfectly fine!

we use messaging.SingleEmailMessage/ messaging.SendEmail to send out mails from apex. it seems these mails are not sent 'secure'.  our customers are urgently asking for a more secure way to send the mails. any tips how to send out mails (with attachments) in a secure way (certificates?/ssl?) from salesforce apex coding?

 

Hello Everyone,

 

Actually, am designing reports on visualforce page, not using Standard reports of salesforce. i want to implement button name Export to Excel. am not getting anything to implement the same. If anyone know the coding for export button pls post the code.

 

Pls help me for the same.

 

 

Thanks In Advance

 

Hi, I have an inputfield 'day of birth' in my vf page. since the datepicker doesn't work here (only works fine for years ahaid or a few years in the past) and therefore is confusing, I would like to switch it off.

Any tricks how to do that?

Hello  everyone,

 

Please any one tell me, Is it possible to embed page layout in visaul force page. I mean i have one page layout and i want it to embed it in visual force page i.e. when i open the page that page layout is called and opens.

 

If its possible then please tell me hows it possible.????

 

 

Thanks in Advance.

  • September 21, 2010
  • Like
  • 0

Hi,

I have a VF page with two commandbuttons (save and cancel). If a user presses the enter key halfway editing the page, the page performs the cancel command and all data is lost, while I would want the save command to be called. i searched the docu and forum but see no simple way to control the priority of the commandbuttons or the setting to link a commandbutton to the enter key. any tips?

 

 

      <apex:pageblockbuttons location="top">
        <apex:commandButton value="Opslaan" action="{!saveall}" tabindex="0" rerender="mdw,arb"/>
        <apex:commandButton value="Annuleren" action="{!cancelall}" immediate="true"/>
      </apex:pageblockbuttons>

 ps: in dutch opslaan = save, annuleren = cancel

 

Hi,

In my apex script I make a copy of an original list with sObjects, to see at a later phase (eg when saving the objects) wether there has been a change of any of the fields by the user.

I use deepclone (clone(true,true)) to make the copy of the relevant objects which I add to the list. Immediately after the cloning, the objects are identical (assertequals of clone and original returns true), after showing them on a vf page with only outputfields they remain identical,

but after showing them in a vf page with inputfields they are seen different (assertequals of clone and original returns false), although all fields (including system fields like lastmodifieddate and id) are identical (assertequals of the individual fields returns true).

 

Anyone who recognizes this and could think of a way to handle this without having to compare each individual field to check for changes?