• Koen (BvD)
  • NEWBIE
  • 30 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 42
    Replies
Hi,

We have some visual force pages that have been working well in the classic version of Salesforce, but now a client would like to use them in the lightning slow interface. What seems to break functionality is that all my apex:outputlink with target=_top links are changed into javascript with a call to javascript:srcUp and as argument the link. They don't work for me:
In chrome, I am sent to another page which contains the left toolbar and the top bar (with the search) and then my visualforce page that I called, but without the actual parameters that I passed on the initial link, they somewhere get lost. So my page isn't displaying what was intended from the link.
Note that in IE11 these links do nothing, I suppose this is one telltale sign of the announced non-support of IE11
One ugly solution is to change my apex:outputlink into <a href="" > but that isn't really a clean solution is it? Also the visualforce page I land on then doesn't display the left menu bar or the top bar with the search anymore, it goes fullframe without any context.

 
Hi,

I have been using a controller extension in my package from the start without any issues. However now I wanted to allow in installed instances to use the extension so that it can also be used on other objects or custom objects. The logical first step is to add the global marker to the class so that it becomes visible where installed. However I still can't use it
<apex:page standardController="Case" extensions="BvDLinkController" >
The logic dictates that you need to add the package prefix name, but when I do that I get the error that the name should not contain underscores
<apex:page standardController="Case" extensions="bvdep__BvDLinkController" >
How can I reference a controller extension from an installed package?

Koen.
Hi,

I have been using a controller extension in my package from the start without any issues. However now I wanted to allow in installed instances to use the extension so that it can also be used on other objects or custom objects. The logical first step is to add the global marker to the class so that it becomes visible where installed. However I still can't use it
<apex:page standardController="Case" extensions="BvDLinkController"  >
The logic dictates that you need to add the package prefix name, but when I do that I get the error that the name should not contain underscores
<apex:page standardController="Case" extensions="bvdep__BvDLinkController"  >

How can I reference a controller extension from an installed package?

Koen.
 
Hi, 

I found in the doc examples of how to use JSENCODE and HTMLENCODE, but somehow cannot get it to work in my case. I have on my custom controller a property called CurrentDefault. It always worked ok for example used like this on the page

<apex:inputHidden id="DefaultSelection" value="{!CurrentDefault}" />

but now I want to ensure values are properly encoded, so I try for example to add HTMENCODE 

<apex:inputHidden id="DefaultSelection" value="{!HTMLENCODE(CurrentDefault)}" />

But when I try to save this I get the error

Error: Unknown property 'HTMLENCODE( CurrentDefault)'

And I don't see why, because Ithe samples from the doc do work. Also if I try the same outside of the value property it does work. So if I just put this in the page somewhere I get no errors
{!HTMLENCODE(CurrentDefault)}

As a side question, anyway I can call these functions also from the controller? I seem to have passed across an example, but can't find it back.

Koen.


I have a strange problem when updating a a custom object / field. During the load of the page I check via a webservice some info and update if necessary. I use the very standard way of retreiving the object, changing something and updating it

 

        bvdep__BvD_Installed_Products__c checkInstall =  
                   [select Name, bvdep__Product_URL__c from bvdep__BvD_Installed_Products__c
                    where bvdep__Id__c = :details.ProductId LIMIT 1];

         checkInstall.bvdep__Product_URL__c = details.Url;

         Database.SaveResult SR = database.update (checkinstall);
         if (SR.isSuccess ())
               // report success

 I added all kind of trace messages, and I can see that the new value is on the object and that the isSuccess returns true, however the object is not updated. It is not a problem of security as the same code is able to insert new objects (so access to all fields is ok).

What is even more strange is that I really have the impression that the update just gets lost. To try the update method I also added the update of the name property that is a standard field. The funny thing is that when the page displays the name is updated (I see the updated name in the left pane of recent items) but as soon as I click on the object it shows up with the old name and the old custom property value.

This would look like a trigger, but there are no triggers on this object.

 

I am quite sure that this exact same code has worked before, and the only change I can remember making is upgrade the version of the code and pages all to the latest version of the api (it was version 16, now verion 26). But I downgraded the version of both page and controller back to 16 and it doesn't work.

 

How can I find where - and most importantly why - the update gets undone?

 

Koen.

For some obscure reason you can no longer grant access to custom objects to the standard user profile. I am not going to rant about how stupid this is (though I feel like) but I wanted to keep compatibble and allow the use of the apex code even for standard users. So I would like to detect the standard profiles (i.e. those that salesforce does not allow to gain access to custom objects). All I could come up with is test on the profiles names

 

    public boolean isStandardUserProfile ()
    {
        String ProfId= UserInfo.getProfileId();
        List<Profile> lstP = [select name from Profile where id =: ProfId];        
        Profile p = lstP [0];
        return p.name == 'Standard user' || p.name == 'Marketing User' || p.name == 'Contract Manager' || p.name == 'Solution Manager';        
    }

 

But this is not very clean, and what is worse it doesn't even work if the user has another language than english configured as apparently even the profile names are translated.

What can I do? All I need is to be able to make the distinction between a user not having access to the custom object because his profile is configured not to allow access and users from standard profile where salesforce does not allow you to configure access. Note that this is really inconsistent as they allow you to edit for standard users the field level security of custom objects, but you can never test on these settings as the access to the object is disabled.

We made a package for integration with Salesforce partly based on the webserivce api. Because of this, it is not available in most professional editions (as they have to pay an extra fee to activate this) Now I see that the new REST api has the functions that we need. First I wonder : is this available for all editions? I can't find any info, but the announcement says "for all".

My second question is then : is it still reasonable to deactivate webservices for professional edition if I can do the same using REST api? It is just that the webservice SOAP interface is much nicer and easier to use, but if we can do it the other way (REST api) then there is nothing stopping me from wasting some time in reprogramming the calls I need.

 

Koen.

This question often returns and I found the standard answer, but my case is slightly different.

 

So I know that the url to access the partner api (wsdl) is slightly different for a sandbox version (test.salesforce.com), however I can't change my initial url to connect, because I use the merge field {!$Api.Partner_Server_URL_160} to connect to the api using an already open session in salesforce. On the public urls for the partner api (either sandbox or production) you can only open a new session on the public wsdl and then receive a new url. As I don't have the log in credentials of the user I avoided this by using this merge field to get the correct url for an already connected user.

 

This doesn't work for a sandbox version. Any help or hint would be greatly appreciated.

Hello,

 

I am working with a managed package, but am not sure how to use the beta and release versions. I have one account where I create the package and a second where I install it. It is in the second account that the testing is done. So on one hand I would have to create beta packages untill all testing is ready and then change it to release.

 

However there is a big nuisance in using beta packages in my case. You cannot upgrade beta packages, so you must first uninstall and then reinstall the package. To be able to uninstall you need to remove all references and you also lose all contents in custom objects. For the package I have and the references and content I create in the installed package, this makes a difference of installation time from 10 minutes to upgrade just to a new release version to 45 minutes when using beta packages (remove references, uninstall, install, create references in page layouts and user's default apps, creating content, ..)

 

So what is the correct way to use beta versions? Or am I just to use release versions? (But one aestatic aspect then is that the version is upped for every cycle)

 

Any suggestions?

Koen.

I created a package that calls a webservice. To make this work, I had to add the domain of the webservice to security controls / remote site settings. Now I am ready to package my code and was wondering how to communicate this requirement. Ideally I would somehow from the package installation get this setting included, probably with some accept dialog box for the user (as I can imagine it would not be secure if I would be able to change this without the administrator accepting this change)

 

What would be the best way to go about this?

 

Koen.

Up to now I haven't been able to run dml statements that are not textbook examples. My current error message is

 

bvdep:DML currently not allowed

 

An unexpected error has occurred. Your development organization has been notified.

 

 

where bvdep is the namespace I assinged for my managed package. The testmethod that executes the same code works ok (I insert the record, and then fetch it in the test method), so I can only assume that it is somewhere related with permissions.

 

Although the message states that "your development organization has been notified" , I didn't get any message (up to a week or two ago, I would get an e-mail in the event of such a message, but this stopped  working, I no longer get these messages, I am also having difficulties displaying the system log, something that would work perfectly up to a few week ago)

 

Koen.

 

I am trying to save user specific information in a custom object. However I am unable to create or update a record in my table. My table just has two columns, one is a reference to the user, one is a reference to a second custom object (to store the user's selection). I can create and edit entries using the default interface of salesforce and selecting entries from the controller works ok. I am unable to catch an exception (either with general exception or DMException). There is no information in the system log, even at the finest level.

 

I have a similar problem when updating. There I do not create my object using new but using a select statement.

 

Here is the essential part of my code

 

try

{

UserSettings__c settings = new UserSettings__c ();

settings.Product__c = (Id) product;

settings.User__c = (Id) Userinfo.getUserId ();

Database.SaveResult saveResult = Database.insert (settings);

System.debug(saveResult);

System.debug(System.LoggingLevel.DEBUG, 'Inserted settings);

}

catch (Exception e)

{

System.debug(System.LoggingLevel.DEBUG, e);

System.debug(System.LoggingLevel.DEBUG, 'Failed to insert settings');

}

 

In the system log everything comes out on one line (something to do with the error)

 

line 57, column 21: SOBJECT:BvD_UserSettings__c lsettings.Product__c <= Cast 20090922084653.442:Class.BvDProductSelectionController.setCurrentProduct:

line 58, column 21: SOBJECT:UserSettings__c settings.User__c <= Id userId 20090922084653.442:Class.BvDProductSelectionController.setCurrentProduct:

line 59, column 21: DeclareVar: Database.SaveResult saveResult 20090922084653.442:Class.BvDProductSelectionController.setCurrentProduct:

line 59, column 55: Database.insert(SOBJECT:UserSettings__c) 20090922084653.442:External entry point: Exiting user sharing mode Cumulative profiling information:

 

followed by all timings of the sql queries, including the insert query

 

Database.insert(SOBJECT:UserSettings__c): executed 1 time in 0 ms 3

 

And ending with the message that there was an error

 

j_id0:j_id1:j_id2:j_id4: An error occurred when processing your submitted information. ***Ending Page Log for /apex/BvDProductSelection?sfdc.tabName=01r70000000Pv9C

 

 

 

 

I am trying to mimick some behavior I had with an s-control with visual force. If you place a custom button that links to an s-control and then specify that you want the side bar for example, you could link to a page without header and side bar refershing.

 

So I made a visual force page that I added to my account page layout and there I place a link or button. I tried with the commandlink and commandbutton that reference an action on my controller and the action returns a PageReference to a second visual force page. If I specify nothing then the page goes into the iframe in the account detail, not the idea, so I would need to add target=_top and force a client side redirect. However then the entire page is refreshed which makes it seem much slower than the original behavior with the s-control where only the account detail itself was refreshed. How can I obtain the same behavoir as the s-control linked to a custom button?

Is there a way in visual force to inspect the currently selected application (from the drop down box at the top of the page ) ?

Is there somewhere I can store a setting per user, or a setting maintained during the session that I can access from Visual force? Creating a custom object with a reference to the user seems a "heavy" solution if its just to remember the last option chosen.

I had a quick look into visual force pages to see if I would be able to get more out of it, especially now that s-controls are end of life. but there is one aspect where I don't see how it replaces s-controls. Previously you could build an s-control with an image, links and other elements on it and then drop it onto an existing page layout (for example for accounts). How would you do this with visual force pages. The only way I see is to build a new page with the components from the standard account editing page, but normally an s-control you put in a package, distribute it and then after importing you just add it to your already personalized page ...

 

Koen.

My question is more general for webservices, but as I am developing in.NET and don't see a specific forum for the webservice, here it goes:

 

With the webservice methods for object description you can find parent child relationships appaerntly only in one direction. For a particular table the describesObject allows to list the childrelationships, so from the Account table I can find its relation to the contacts table. However if I am looking at the child table in the relationship, I don't see how I can find the parent table. So starting with the Contacts table, how can I see that Accounts is its parent table without needing to scan all other tables to see if my current table happens to be in one of the relationships. I see that a fielddescription also holds a property RelationshipName, but this doesn't seem to help you much further as there is still no way to deduce the table from the relationshipname, or is there?

 

Koen.

I see that the support for currencies (for example for annual revenue field on the account record) is not enabled for all clients of salesforce. How can I get the currency used by an organisation when this feature is not enabled? The only thing I can find that is filled in is the currencysymbol property of the GetUserInfoResult object. Am I really to program a table that maps these symbols to currencies? Is this even a one to one relation? Can't I just get the currency iso code for that organisation? The  field userDefaultIsoCurrencyCode is null, so it isn't there. Where or where can I get this?
 
Thanx
Koen.
If I want to extend the search functionality (i.e. upon searching in salesforce also display information from other sources) what would be the best option? Currently I have only used standard customisation with links and buttons and interaction with the webservice api. On the search screen I can't see any possibility to add something and on the search result I can add a button but without any knowledge of the search criterium this doesn't really interact with the search either. Would I be able to get the search criterium with the ajax toolkit? Or with apex or something else yet?

Koen.
Hi,

We have some visual force pages that have been working well in the classic version of Salesforce, but now a client would like to use them in the lightning slow interface. What seems to break functionality is that all my apex:outputlink with target=_top links are changed into javascript with a call to javascript:srcUp and as argument the link. They don't work for me:
In chrome, I am sent to another page which contains the left toolbar and the top bar (with the search) and then my visualforce page that I called, but without the actual parameters that I passed on the initial link, they somewhere get lost. So my page isn't displaying what was intended from the link.
Note that in IE11 these links do nothing, I suppose this is one telltale sign of the announced non-support of IE11
One ugly solution is to change my apex:outputlink into <a href="" > but that isn't really a clean solution is it? Also the visualforce page I land on then doesn't display the left menu bar or the top bar with the search anymore, it goes fullframe without any context.

 
Hi All,

I want to insert account record from one SF orgnisation to another SF org. In destination orgnaisation i have created below webservice method.
global class testSOAPAccInsert{

    webservice static Id insertAcc(String name)
    {
        Account acc = new Account();
        acc.Name = name;
        insert acc;
        return acc.Id;
    }
}

I generated wsdl from it and created class using wsdl in source orgnisation. However, when i tried to invoke this method from class generated using wsdl i am getting illegeal session id error. 

How would i get session id or how can i impelment login method in my global class. Please help.

Thanks,
Nikhil 

I have a strange problem when updating a a custom object / field. During the load of the page I check via a webservice some info and update if necessary. I use the very standard way of retreiving the object, changing something and updating it

 

        bvdep__BvD_Installed_Products__c checkInstall =  
                   [select Name, bvdep__Product_URL__c from bvdep__BvD_Installed_Products__c
                    where bvdep__Id__c = :details.ProductId LIMIT 1];

         checkInstall.bvdep__Product_URL__c = details.Url;

         Database.SaveResult SR = database.update (checkinstall);
         if (SR.isSuccess ())
               // report success

 I added all kind of trace messages, and I can see that the new value is on the object and that the isSuccess returns true, however the object is not updated. It is not a problem of security as the same code is able to insert new objects (so access to all fields is ok).

What is even more strange is that I really have the impression that the update just gets lost. To try the update method I also added the update of the name property that is a standard field. The funny thing is that when the page displays the name is updated (I see the updated name in the left pane of recent items) but as soon as I click on the object it shows up with the old name and the old custom property value.

This would look like a trigger, but there are no triggers on this object.

 

I am quite sure that this exact same code has worked before, and the only change I can remember making is upgrade the version of the code and pages all to the latest version of the api (it was version 16, now verion 26). But I downgraded the version of both page and controller back to 16 and it doesn't work.

 

How can I find where - and most importantly why - the update gets undone?

 

Koen.

Hi i am creating visualforce pages and apex classes triggers etc for last some time.i want to know what is app in salesforce and how to publish it on AppExchange? Any requirement for publishing app on app exchange i went through this tutorial link

they teach how to create an app in developer org by default there are 6 tabs Home,Chatter,File,Your Tab ,Reports,DashBoard.i basically want to know what app contains? apex class,visualforce page these components or only standard tabs and some customization tab what we see when we select an app in developer org

For some obscure reason you can no longer grant access to custom objects to the standard user profile. I am not going to rant about how stupid this is (though I feel like) but I wanted to keep compatibble and allow the use of the apex code even for standard users. So I would like to detect the standard profiles (i.e. those that salesforce does not allow to gain access to custom objects). All I could come up with is test on the profiles names

 

    public boolean isStandardUserProfile ()
    {
        String ProfId= UserInfo.getProfileId();
        List<Profile> lstP = [select name from Profile where id =: ProfId];        
        Profile p = lstP [0];
        return p.name == 'Standard user' || p.name == 'Marketing User' || p.name == 'Contract Manager' || p.name == 'Solution Manager';        
    }

 

But this is not very clean, and what is worse it doesn't even work if the user has another language than english configured as apparently even the profile names are translated.

What can I do? All I need is to be able to make the distinction between a user not having access to the custom object because his profile is configured not to allow access and users from standard profile where salesforce does not allow you to configure access. Note that this is really inconsistent as they allow you to edit for standard users the field level security of custom objects, but you can never test on these settings as the access to the object is disabled.

We made a package for integration with Salesforce partly based on the webserivce api. Because of this, it is not available in most professional editions (as they have to pay an extra fee to activate this) Now I see that the new REST api has the functions that we need. First I wonder : is this available for all editions? I can't find any info, but the announcement says "for all".

My second question is then : is it still reasonable to deactivate webservices for professional edition if I can do the same using REST api? It is just that the webservice SOAP interface is much nicer and easier to use, but if we can do it the other way (REST api) then there is nothing stopping me from wasting some time in reprogramming the calls I need.

 

Koen.

Could someone please tell me what is the apex equivalent for {!API.Partner_Server_URL_80}? I'm trying to create a page reference for Conga Merge. Also does {!API.Session_ID} == UserInfo.getSessionId()? Thanks!

  • June 04, 2010
  • Like
  • 0

How do I allow users using standard profiles to view a custom object?

 

Some of the users in my organisation are not able to see all the custom objects that I have created.

Trying to fix this, I've been around and checked every checkbox I could find that looked even vaguely applicable to no avail. Apart from the ones under Setting->Manager Users->Profiles because apparently the standard profiles cannot be edited.

 

Which is where I start to get confused. Because according to the documentation "users with standard profiles can't access new custom objects—you must assign them custom profiles and edit the profiles" ... but about half of my custom objects are accessible with the standard profiles.

 

So obviously there must be way to allow standard profiles access to custom objects because I've apparently already done it several times but as I'm making this up as I go along learning this as I go along I didn't realise it was impossible at the time and now can't remember how to do it again.

 

Can anyone enlighten me?

  • April 22, 2010
  • Like
  • 0

Hello,

 

I am working with a managed package, but am not sure how to use the beta and release versions. I have one account where I create the package and a second where I install it. It is in the second account that the testing is done. So on one hand I would have to create beta packages untill all testing is ready and then change it to release.

 

However there is a big nuisance in using beta packages in my case. You cannot upgrade beta packages, so you must first uninstall and then reinstall the package. To be able to uninstall you need to remove all references and you also lose all contents in custom objects. For the package I have and the references and content I create in the installed package, this makes a difference of installation time from 10 minutes to upgrade just to a new release version to 45 minutes when using beta packages (remove references, uninstall, install, create references in page layouts and user's default apps, creating content, ..)

 

So what is the correct way to use beta versions? Or am I just to use release versions? (But one aestatic aspect then is that the version is upped for every cycle)

 

Any suggestions?

Koen.

I created a package that calls a webservice. To make this work, I had to add the domain of the webservice to security controls / remote site settings. Now I am ready to package my code and was wondering how to communicate this requirement. Ideally I would somehow from the package installation get this setting included, probably with some accept dialog box for the user (as I can imagine it would not be secure if I would be able to change this without the administrator accepting this change)

 

What would be the best way to go about this?

 

Koen.

Up to now I haven't been able to run dml statements that are not textbook examples. My current error message is

 

bvdep:DML currently not allowed

 

An unexpected error has occurred. Your development organization has been notified.

 

 

where bvdep is the namespace I assinged for my managed package. The testmethod that executes the same code works ok (I insert the record, and then fetch it in the test method), so I can only assume that it is somewhere related with permissions.

 

Although the message states that "your development organization has been notified" , I didn't get any message (up to a week or two ago, I would get an e-mail in the event of such a message, but this stopped  working, I no longer get these messages, I am also having difficulties displaying the system log, something that would work perfectly up to a few week ago)

 

Koen.

 

Is there somewhere I can store a setting per user, or a setting maintained during the session that I can access from Visual force? Creating a custom object with a reference to the user seems a "heavy" solution if its just to remember the last option chosen.

I had a quick look into visual force pages to see if I would be able to get more out of it, especially now that s-controls are end of life. but there is one aspect where I don't see how it replaces s-controls. Previously you could build an s-control with an image, links and other elements on it and then drop it onto an existing page layout (for example for accounts). How would you do this with visual force pages. The only way I see is to build a new page with the components from the standard account editing page, but normally an s-control you put in a package, distribute it and then after importing you just add it to your already personalized page ...

 

Koen.

Hi,

 

While Running a testmethod, I am getting the exception "System.TypeException: Testmethods do not support webservice callouts". This testmethod is for testing a trigger, which is calling the Google API service for Latitude and Lonitude Conversion. I am using Salesforce API version 15.0

 

What can be the alternative way? Please help..

 

Thanks in advance,

Suvra

  • April 17, 2009
  • Like
  • 0

I have a new native app on the app exchange and a professional edition customer tried to install it. They got a bunch of errors like this:

 

Missing feature

Apex Classes

Installing this package requires the following feature and its associated permissions: Apex Classes

 

 

My app uses a few custom classes, objects, and a visualforce page. I was told that even a pro edition can install an app that uses custom apex classes. 

 

Does anyone have ideas of how to dig into this further?

 

Thanks!

  • February 20, 2009
  • Like
  • 0
I see that the support for currencies (for example for annual revenue field on the account record) is not enabled for all clients of salesforce. How can I get the currency used by an organisation when this feature is not enabled? The only thing I can find that is filled in is the currencysymbol property of the GetUserInfoResult object. Am I really to program a table that maps these symbols to currencies? Is this even a one to one relation? Can't I just get the currency iso code for that organisation? The  field userDefaultIsoCurrencyCode is null, so it isn't there. Where or where can I get this?
 
Thanx
Koen.

I need to acces Partner server url global variable from apex code in order to pass it into web service.

In visualforce i can write the followin statement in page layout  {!$Api.Partner_Server_URL_120} which renderes something like that https://na5.salesforce.com/services/Soap/u/12.0/461200D70000000IfeF

How can i access {!$Api.Partner_Server_URL_120}  variable from apex code?

Thanks in advance