• kosmitev
  • NEWBIE
  • 40 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 19
    Replies
Hi,
We have a piece of Apex code which calls a webservice reads some information from the webservice and updates accounts. 
One of the values it updates is BillingCountry and when the value returned by the webservice is not correct salesforce.com throws an FIELD_INTEGRITY_EXCEPTION.
To fix that I developed a before update and before insert trigger which converts the invalid value to a valid value. Salesforce.com still throws an error.
The exact steps to reproduce are:
1. Turn address picklists on.
  2. Write a Before update, before instert trigger for account:
trigger Account_BIBU on Account(before insert, before update) {   
    Account acct = (Account)trigger.new[0];
    acct.BillingCountry = 'France';
}
   3. Open the developer console => Debug => Execute Anonimous Apex and execute:
   Account acct = [Select Name, BillingCountry, BillingStreet FROM Account WHERE LIMIT 1];
   acct.BillingCountry ='United States of America';
    update acct;
    4. Execute it. It will throw an error.
    5. Now try to execute the below:
        Account acct = [Select Name, BillingCountry, BillingStreet FROM Account LIMIT 1];
        acct.BillingCountry ='United States';
        update acct;
       It executes fine and BillingCountry is France.

Does anyone have any ideas? Is this a bug in salesforce.com? 
As far as I know salesforce.com runs validation rules after before update trigger but in this case they seem to be run before the before update trigger.

Thanks,
Kzmp

Hi,

I have the following APEX rest method:

 

@RestResource(urlMapping='/TestService/*')
global with sharing class TestService {
@HttpPost
global static String Scheduler() {
     return 'TEST';
}

}

 

When I try to call it with:

curl -X POST -H "X-PrettyPrint:1" -H "Content-Type:application/x-www-form-urlencoded" -k "https://na12-api.salesforce.com/services/apexrest/TestService/Scheduler?schedule=1&hour=22&minute=48" -H "Authorization: Bearer SESSION_ID"

It returns the following error message:

[ {
"message" : "An unexpected error occurred. Please include this ErrorId if you
contact support: 330346244-51980 (863387990)",
"errorCode" : "UNKNOWN_EXCEPTION"
} ]

 

when I change ti to @HttpGet and I call it with curl -X GET -H "X-PrettyPrint:1" -H "Content-Type:application/x-www-form-urlencoded" -k "https://na12-api.salesforce.com/services/apexrest/TestService/Scheduler?schedule=1&hour=22&minute=48" -H "Authorization: Bearer SESSION_ID"

 

I get the expected result.

 

Any help will be appreciated.

 

Thanks,

Kzmp

Hi,

I have a VF page which calls one of Salesforce's connection.js functions:sforce.connection.remoteFunction to call a rest method on Salesforce.com. 

The problem is that I have a reverse proxy which mangles the URLs and the remoteFunction call hangs and it just never completes.

I know that salesforce internally uses a proxy page to fascilitate the cross domain communication and I suspect that connection.js cannot deal with the reverse proxy Urls.

 

Has anybody else seen this or have any ides on how to solve it?

 

Thanks,

Kzmp

Hi,

Is there a way I can disable/precent a trigger from firing if the trigger comes from a managed application?

 

The problem is that I have a managed package which has been released. There is a trigger which is useful to some cutomers and not useful to other and I need a way to disable it from those who do not want it.

 

Thanks,

Kos

Hi There,

I have an interesting prolem.

1. I create a new Accounts' view and for condition I set:

    DateTimeFieldX equals 31/01/2012 15:45

    I save the view and it returns me a record with the DateTimeFieldX equaling: 2012-01-31T15:45:03.000Z.

    From that I can see that it is ignoring the :03 milliseconds part.

 

2. I open the Force.com Explorer and I type in the following query:

    SELECT  Name FROM Account where DateTimeFieldX = 2012-01-31T15:45:00Z and I get nothing which is understandable

     because I have 00 for milliseconds.

 

The question is how to the where clause condition in 2 above to ignore the milliesconds value and to return me whatever 1 above returns.

To put this into perspective I am building a where clause in .Net which is similar to SF's and I let users enter date and time up-to the millisecond.

 

For those of you who are looking for a solution on how to cnovert DateTime to a DateTime field suitable for SOQL query in .Net here it is:
 public string Convert(DateTime obj, Field field = null)
 {
     return System.Xml.XmlConvert.ToString(obj, System.Xml.XmlDateTimeSerializationMode.Utc);
  }

 

Thanks,

Kos

Hi,

We have a composite application which does some batch processing inside of SF.

Our customers would now like to schedule those batch jobs to run at particular times.

The problem I am having is how will the batch job establish a session with Salesforce.

The only way that I see is if we store the username and password of our users with us which I do not want to do.

 

Is there any way for our users to schedule an Apex class within SF which invokes a webservice at our end passing in session id so that we can connect to SF?

Or is there any better suggestions on how to achieve the taks without storing the usernames and passwords?

 

Thanks,

Kos

Hi,

Does anybody know a way to find the layout names per an sObject.

I have looked at describeLayout but that gives you everything but the name - very weird.

 

Thanks,

Kos

Hi guys,

I have run the Checkmarx security took against my apex code and I have got half a red circle in the section Problems by Impacts saying "Spoofing identity".

Could anybody please shed some light about how to tackle this.

To give you some more detail about the applicatoin:

It consits of VF pages and components and infrastructure classes. After a user saves an account let say I have some javascript which redirects the user to my page (VF page). On my page I present some information to the user and I have a button "Continue" when the user clicks the button I return the user to his original SalesForce accounts page with that record selected.

During all redirects I am passing the record id parameter in the url.So more technical the process is:

1. user saves an account.

2. My override account controller constructs a redirect url to my custom VF page and includes the account id as url paramter.

3. Must custom page reads the account id and presents some information to the user.

4. User clicks "Continue" and the user gets redirected back to the accounts page.

 

Thanks,

Kos

Hi Guys,

 

I need some help. We developed a Composite (Hosted) application that integrates with Salesforce. It's time for security review submission. We went through the requirements - http://wiki.developerforce.com/index.php/Security_Review. OWASP Top Ten Checklist and Requirements Checklist evaluated. We have followd the policies described on the page as closely as possible but we do not meet all of them a 100 %. For example we do not have a company wide security policy.

We have also run the Burp scanner.

 

Is there anything else that we should do?

 

Does Salesforce require a minimum unit tests code coverage for Composite (Hosted) applications? Does Salesforce require any information about our security policies prior to security review and if so, what kind of information?

 

Thank you in advance!

Hi guys,

The title pretty much explains what I need to do.

To clarify more:

I have a component with code like:

<apex:component access="global">
    <apex:attribute access="global" name="RecipientLabel" description="Recipient label." type="String" required="true"/>

-------SOME MORE STUFF HERE------

  <apex:outputPanel rendered="{!RecipientLabel}.length()>0"><div> <apex:outputLabel >{!RecipientLabel}:</apex:outputLabel> </div> </apex:outputPanel>

-----SOME MORE STUFF HERE -----


</apex:component>

If you look at the expression that I hae for rendered: "{!RecipientLabel}.length()>0"

That does not work it seems to be always false even though when I remove it the component shows and I can see that the output label has text in it.

Please let me know hwo to make that work.

I have tried sever different things like putting a javascript function in rendered different syntaxes but so I am not lucky enough to hit the right combination.

 

Thanks,

Kos

Hi,
We have a piece of Apex code which calls a webservice reads some information from the webservice and updates accounts. 
One of the values it updates is BillingCountry and when the value returned by the webservice is not correct salesforce.com throws an FIELD_INTEGRITY_EXCEPTION.
To fix that I developed a before update and before insert trigger which converts the invalid value to a valid value. Salesforce.com still throws an error.
The exact steps to reproduce are:
1. Turn address picklists on.
  2. Write a Before update, before instert trigger for account:
trigger Account_BIBU on Account(before insert, before update) {   
    Account acct = (Account)trigger.new[0];
    acct.BillingCountry = 'France';
}
   3. Open the developer console => Debug => Execute Anonimous Apex and execute:
   Account acct = [Select Name, BillingCountry, BillingStreet FROM Account WHERE LIMIT 1];
   acct.BillingCountry ='United States of America';
    update acct;
    4. Execute it. It will throw an error.
    5. Now try to execute the below:
        Account acct = [Select Name, BillingCountry, BillingStreet FROM Account LIMIT 1];
        acct.BillingCountry ='United States';
        update acct;
       It executes fine and BillingCountry is France.

Does anyone have any ideas? Is this a bug in salesforce.com? 
As far as I know salesforce.com runs validation rules after before update trigger but in this case they seem to be run before the before update trigger.

Thanks,
Kzmp
Hi,
We have a piece of Apex code which calls a webservice reads some information from the webservice and updates accounts. 
One of the values it updates is BillingCountry and when the value returned by the webservice is not correct salesforce.com throws an FIELD_INTEGRITY_EXCEPTION.
To fix that I developed a before update and before insert trigger which converts the invalid value to a valid value. Salesforce.com still throws an error.
The exact steps to reproduce are:
1. Turn address picklists on.
  2. Write a Before update, before instert trigger for account:
trigger Account_BIBU on Account(before insert, before update) {   
    Account acct = (Account)trigger.new[0];
    acct.BillingCountry = 'France';
}
   3. Open the developer console => Debug => Execute Anonimous Apex and execute:
   Account acct = [Select Name, BillingCountry, BillingStreet FROM Account WHERE LIMIT 1];
   acct.BillingCountry ='United States of America';
    update acct;
    4. Execute it. It will throw an error.
    5. Now try to execute the below:
        Account acct = [Select Name, BillingCountry, BillingStreet FROM Account LIMIT 1];
        acct.BillingCountry ='United States';
        update acct;
       It executes fine and BillingCountry is France.

Does anyone have any ideas? Is this a bug in salesforce.com? 
As far as I know salesforce.com runs validation rules after before update trigger but in this case they seem to be run before the before update trigger.

Thanks,
Kzmp

So here I am trying to enjoy a nice sat with my kids. And I get a call. Apparently, Sp12 has murdered the service cloud console API. All versions from what we can tell. even old ones. that should be backwards supported/compatible/whatever. Tried salesforce example code from page 7 of:

 

http://www.salesforce.com/us/developer/docs/api_console/api_console.pdf

 

No love (by the way you should really use showheader=false and sidebar=false). JS error:

 

"Uncaught ReferenceError: Sfdc is not defined" in integration.js.  

 

The cloud and I aren't on speaking terms. Maybe we should see other people.........or cumulus formations.......whatever......

Hi,

Is there a way I can disable/precent a trigger from firing if the trigger comes from a managed application?

 

The problem is that I have a managed package which has been released. There is a trigger which is useful to some cutomers and not useful to other and I need a way to disable it from those who do not want it.

 

Thanks,

Kos

Hi There,

I have an interesting prolem.

1. I create a new Accounts' view and for condition I set:

    DateTimeFieldX equals 31/01/2012 15:45

    I save the view and it returns me a record with the DateTimeFieldX equaling: 2012-01-31T15:45:03.000Z.

    From that I can see that it is ignoring the :03 milliseconds part.

 

2. I open the Force.com Explorer and I type in the following query:

    SELECT  Name FROM Account where DateTimeFieldX = 2012-01-31T15:45:00Z and I get nothing which is understandable

     because I have 00 for milliseconds.

 

The question is how to the where clause condition in 2 above to ignore the milliesconds value and to return me whatever 1 above returns.

To put this into perspective I am building a where clause in .Net which is similar to SF's and I let users enter date and time up-to the millisecond.

 

For those of you who are looking for a solution on how to cnovert DateTime to a DateTime field suitable for SOQL query in .Net here it is:
 public string Convert(DateTime obj, Field field = null)
 {
     return System.Xml.XmlConvert.ToString(obj, System.Xml.XmlDateTimeSerializationMode.Utc);
  }

 

Thanks,

Kos

Hi,

 

I have created Custom Home Page component which will be shown on all the pages. It has Javascript file and method in JS file which is executed when page is loaded into browser. I want to know which page layout is loaded in Javascript method. Please suggest me how do I get Page Layout name using javascript in Custom Home Page component.

 

Thanks,

Prasad

Difference between person account and business account?

Hi,

We have a composite application which does some batch processing inside of SF.

Our customers would now like to schedule those batch jobs to run at particular times.

The problem I am having is how will the batch job establish a session with Salesforce.

The only way that I see is if we store the username and password of our users with us which I do not want to do.

 

Is there any way for our users to schedule an Apex class within SF which invokes a webservice at our end passing in session id so that we can connect to SF?

Or is there any better suggestions on how to achieve the taks without storing the usernames and passwords?

 

Thanks,

Kos

Hi,

Does anybody know a way to find the layout names per an sObject.

I have looked at describeLayout but that gives you everything but the name - very weird.

 

Thanks,

Kos

Hi Guys,

 

I need some help. We developed a Composite (Hosted) application that integrates with Salesforce. It's time for security review submission. We went through the requirements - http://wiki.developerforce.com/index.php/Security_Review. OWASP Top Ten Checklist and Requirements Checklist evaluated. We have followd the policies described on the page as closely as possible but we do not meet all of them a 100 %. For example we do not have a company wide security policy.

We have also run the Burp scanner.

 

Is there anything else that we should do?

 

Does Salesforce require a minimum unit tests code coverage for Composite (Hosted) applications? Does Salesforce require any information about our security policies prior to security review and if so, what kind of information?

 

Thank you in advance!

Hi guys,

We are developing a managed package which we would like to prepare for a security review.

In the package we have logic in a one VF page's controller which returns a PageReference object and redirects to another VF page. We want to be able to pass the record id from the first page to the second page and we are currently doing that by adding the id to the url as a parameter string.

We have a problem with security review with this approach. I wandered what would you recommend to make that more secure.Probably a session inside of SalesForce or encrypt the id or how?

 

Thanks,

Kos

  • December 02, 2010
  • Like
  • 0

Hi guys,

The title pretty much explains what I need to do.

To clarify more:

I have a component with code like:

<apex:component access="global">
    <apex:attribute access="global" name="RecipientLabel" description="Recipient label." type="String" required="true"/>

-------SOME MORE STUFF HERE------

  <apex:outputPanel rendered="{!RecipientLabel}.length()>0"><div> <apex:outputLabel >{!RecipientLabel}:</apex:outputLabel> </div> </apex:outputPanel>

-----SOME MORE STUFF HERE -----


</apex:component>

If you look at the expression that I hae for rendered: "{!RecipientLabel}.length()>0"

That does not work it seems to be always false even though when I remove it the component shows and I can see that the output label has text in it.

Please let me know hwo to make that work.

I have tried sever different things like putting a javascript function in rendered different syntaxes but so I am not lucky enough to hit the right combination.

 

Thanks,

Kos

I am using  salesforce webservice to get all the page layouts for the particular sobject using DescribeLayout class. But the problem is DescribeLayout class is not exposing Page layout name. Is there anyway i can get that name ?