• Gabriel Corrêa de Oliveira
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 2
    Replies
When I add a partner to an opportunity through the web UI and issue a query like this:
[select AccountFromId, AccountToId, Role, OpportunityId, ReversePartnerId from Partner where OpportunityId = :opportunityId]

Two records are found. One has the AccountFromId field referring to the opportunity's account and AccountToId referring to the partner account while the other one has AccountToId referring to the opportunity's account and AccountFromId referring to the partner account.

Both also have the ReversePartnerId field referring to one another; and, thus, form some kind of bidirectional relationship.

I have some APEX code that queries the Partner object to find which accounts are related to a certain opportunity. Hence, I need to write test cases that setup the right database environment before they run. I want to run them with @isTest(seeAllData=false), for they need to be deterministic and not affected by the state of the production database when I deploy them.

I tried the following:
Partner partner = new Partner();
partner.AccountToId = partnerAccountId;
partner.OpportunityId = opportunityId;
partner.IsPrimary = true;
partner.Role = PARTNER_ROLE; // A constant
insert partner;
I ran this from the @testSetup method, but only one record was inserted.

Then, I  tried to insert the reverse relationship record programmatically in many different ways, but Salesforce doesn't allow us to set AccountFromId and OpportunityId at the same time. In addition, the  ReversePartnerId field is not writable.

My conclusion so far is that it's impossible to create the bidirectional relationships in the same way that Salesforce does when we use the web UI.

There are no clear directions in the documentation on how to insert these objects, and this seems to be yet another pitfall in Salesforce's CRM platform.
I have the following problem that happens from time to time:

When I am doing development in a Sandbox and try to save a change to an APEX class, the developer console never finishes saving. I can wait forever, and the title on the editor tab continues to say 'Saving...'.

If I close the editor, it shows me a popup window with the title FIELD_INTEGRITY_EXCEPTION and a message in Portuguese saying:
 
Failed to create deployment: Este contêiner está sendo salvo com deploymentId=1drZ0000001AMEs. Você não pode colocar uma solicitação na fila até que isso seja concluído.: ID do contêiner de metadados

My Salesforce is configured for Portuguese, and I don't have multilanguage licenses. Therefore, I'm stuck with poorly translated messages even in the developer tools. This makes it hard for me to search the web for possible solutions.

In English, the text of the message would mean something like this:
 
Failed to create deployment: This container is being saved with a deploymentId=1drZ0000001AMEs. You can't add a request to the queue until this is finished.: Metadata container ID

After the problem happens for the first time, I can never recover from it with the same user. Other users seem to continue being able to save code to the same sandbox.

In addition, after the first time, the problem persists even if I try to save code through an external tool like Mavensmate.

In my opinion, this is clearly a bug, but Salesforce's standard support plan doesn't even allow us to report bugs with developer tools.

For the meantime, I couldn't find any other solution but to delete the sandbox, create it again, and re-save all the code that I changed, class by class. Obviously this makes me waste a lot of time.
I am new to Force.com and I am still having a hard time to wrap my head around so many things.

In every "normal" production system, logs are constantly collected and kept for a reasonable amount of time according to a retention policy. Usually days or weeks. Thus, system administrators can monitor logs and detect potential problems before users even notice them.

However, with Salesforce, thinks seem to be very different:

Apparently logs will only be collected in a "per-session" basis and for a specific user. I can't find any practical way to generate logs for all the users of my "org" and retain them for any period longer than a few minutes.

My Salesforce "org" contains a lot of Apex code that interacts with external services and performs DML operations against "the database". Hence, there are many things that can go wrong during a normal business day for our users.

Alas, it seems that Force.com expects us to only collect logs to "debug" whatever goes wrong. Thus, we have to wait for a user to complain about something, enable the logs for his or her session, and ask him or she to reproduce whatever went wrong.

So, I wonder if this is really the best we can do with Force.com in terms of logging.

If so, it couldn't be more disappointing. I just can't believe that such a successful platform can have such a narrow-minded approach to logging.

Thank you.
Dear All,

I am new to Force.com, and I need to understand clearly whether the following requirements are attainable.

I have been checking some Books on Force.com development, and I found the following:
 
Development with the Force.com Platform, 3rd edition, by Jason Ouellete, Page 197
[..]A controller extension is a custom controller that extends the behavior of a standard controller. Controller extensions are primarily used to integrate Visualforce more tightly with the native user interface. Many features of Visualforce integration such as overriding standard buttons are not supported for pages that use custom controllers.[..]
 
Visual Force Developer's Guide, by W.A. Chamil Madusanka, Page 26
[..]Controller extensions are used to extend the logic and functionality of a standard controller or a custom controller. A controller extension cannot be on a page without a standard controller or a custom controller. Controller extensions are written using Apex.[..]

Nonetheless, it is no clear to me to what extent we can override the default behaviors of the standard controllers through controller extensions.
 
The paragraphs of these books and others usually state that it is possible to override default buttons, but they never seem to go any further.
 
Once I extend the default controller, can I make the standard page use such extension instead of the original one? For instance, can I extend te default controller of the Account object and make the standard account page use my extension instead of the default controller? Or, instead, would I be forced to write a new Visualforce page as the only way to use such extension?
 
If writing a new Visualforce page were the only option, would I be able to replace the standard page of an object by the new page?
 
Moreover, would I be able to create a configurable Visualforce page? A page whose layout can be changed by the users just like they can change standard pages?
 
In a controller extension, would it be possible to override the default behavior of a standard field's setter? For instance, would I be able to tamper with the default behavior of the postal code field when the user changes its value, so that I can look it up in a postal codes' database and auto-fill the street address, city, and state? Literature simply doesn't go this far, neither to confirm such possibility nor to deny it.
 
Where can I find a list of every single thing that I can do with, and that I can not do, with a controller extension?
 
 
I am very new to Salesforce and the first thing I noticed about the platform was its poor performance.

Clearly it's not a Web 2.0 application since full page reloads are the standard navigation mechanism.
Load times of 5s, 10s, or even 15s are common in my company's day-to-day usage of Salesforce.

I've heard excuses saying that it's because our "org" is overloaded with data. So, I decided to create a developer account and see how Salesforce behaves with a brand new empty "org". As a result, I couldn't be more disappointed.

I clicked through the standard tabs like Accounts, Contacts, and Leads, which all take several seconds to load empty.

Then I analyzed some of these pages with Google Chrome's Page Speed tool which found a myriad of performance issues like:
  • Avoid Redirects 
    • (L)Minimize redirects
  • Reduce blocking resources 
    • (M)Inline Small JavaScript, (L)Optimize the order of styles and scripts
  • Minimize payload 
    • (H)Combine images into CSS sprites, (L)Serve resources from a consistent URL, (L)Minify JavaScript, (L)Minify CSS, (L)Minify HTML, (L)Optimize images
  • Minimize delay in page load 
    • (H)Minimize request size, (L)Avoid bad requests, (L)Specify image dimensions, (L)Put CSS in the document head
  • Other 
    • (H)Defer parsing of JavaScript, (L)Remove query strings from static resources, (L)Specify a Vary: Accept-Encoding header

As a confirmation, I also ran YSlow, from Yahoo, against them, and got only C as an average grade.

In addition, higher network latency adds to the poor optimization of the web UI and makes the overall user experience even worse, since most of our users are in South America while the nearest Salesforce data centers are in the United States.

Moreover, Salesforce doesn't seem to make use of any global CDN to optimize the load time of static components.

After all, I wonder if other large Salesforce users experience similar difficulties. I find it odd that little is discussed on the web about the performance of Salesforce itself, since I'm not even talking about other applications that one could develop on the Force.com platform.
I am very new to Force.com and Salesforce.com, and I am having a hard time wrap my head around the platform.
The branding is very confusing to me.

Force.com is commercially presented as a PaaS solution; yet, new applications are created from within Salesforce, which is a CRM application.
Everything seems to stem from Salesforce, and brand new applications already contain CRM-related objects upon creation, such as Accounts, Opportunities, and so on. So, how does that make sense? What if I am not creating a CRM-related application? Why is the CRM application the center of everything?
When I add a partner to an opportunity through the web UI and issue a query like this:
[select AccountFromId, AccountToId, Role, OpportunityId, ReversePartnerId from Partner where OpportunityId = :opportunityId]

Two records are found. One has the AccountFromId field referring to the opportunity's account and AccountToId referring to the partner account while the other one has AccountToId referring to the opportunity's account and AccountFromId referring to the partner account.

Both also have the ReversePartnerId field referring to one another; and, thus, form some kind of bidirectional relationship.

I have some APEX code that queries the Partner object to find which accounts are related to a certain opportunity. Hence, I need to write test cases that setup the right database environment before they run. I want to run them with @isTest(seeAllData=false), for they need to be deterministic and not affected by the state of the production database when I deploy them.

I tried the following:
Partner partner = new Partner();
partner.AccountToId = partnerAccountId;
partner.OpportunityId = opportunityId;
partner.IsPrimary = true;
partner.Role = PARTNER_ROLE; // A constant
insert partner;
I ran this from the @testSetup method, but only one record was inserted.

Then, I  tried to insert the reverse relationship record programmatically in many different ways, but Salesforce doesn't allow us to set AccountFromId and OpportunityId at the same time. In addition, the  ReversePartnerId field is not writable.

My conclusion so far is that it's impossible to create the bidirectional relationships in the same way that Salesforce does when we use the web UI.

There are no clear directions in the documentation on how to insert these objects, and this seems to be yet another pitfall in Salesforce's CRM platform.
I have the following problem that happens from time to time:

When I am doing development in a Sandbox and try to save a change to an APEX class, the developer console never finishes saving. I can wait forever, and the title on the editor tab continues to say 'Saving...'.

If I close the editor, it shows me a popup window with the title FIELD_INTEGRITY_EXCEPTION and a message in Portuguese saying:
 
Failed to create deployment: Este contêiner está sendo salvo com deploymentId=1drZ0000001AMEs. Você não pode colocar uma solicitação na fila até que isso seja concluído.: ID do contêiner de metadados

My Salesforce is configured for Portuguese, and I don't have multilanguage licenses. Therefore, I'm stuck with poorly translated messages even in the developer tools. This makes it hard for me to search the web for possible solutions.

In English, the text of the message would mean something like this:
 
Failed to create deployment: This container is being saved with a deploymentId=1drZ0000001AMEs. You can't add a request to the queue until this is finished.: Metadata container ID

After the problem happens for the first time, I can never recover from it with the same user. Other users seem to continue being able to save code to the same sandbox.

In addition, after the first time, the problem persists even if I try to save code through an external tool like Mavensmate.

In my opinion, this is clearly a bug, but Salesforce's standard support plan doesn't even allow us to report bugs with developer tools.

For the meantime, I couldn't find any other solution but to delete the sandbox, create it again, and re-save all the code that I changed, class by class. Obviously this makes me waste a lot of time.
I am very new to Force.com and Salesforce.com, and I am having a hard time wrap my head around the platform.
The branding is very confusing to me.

Force.com is commercially presented as a PaaS solution; yet, new applications are created from within Salesforce, which is a CRM application.
Everything seems to stem from Salesforce, and brand new applications already contain CRM-related objects upon creation, such as Accounts, Opportunities, and so on. So, how does that make sense? What if I am not creating a CRM-related application? Why is the CRM application the center of everything?