• KyleKyle
  • NEWBIE
  • 30 Points
  • Member since 2011

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

I have a contact which has a partner user. I am disabling the partner user from contact detail page by selecting "Disable partner user" option from "Work with Portal Button" dropdown.

 

I have a trigger on User object which fires on after update event.

 

trigger TR_User on User (after update) {
system.debug('########'+trigger.new[0].IsActive + '-' + trigger.old[0].IsActive);
}

 

In this trigger I am checking the IsActive field value of user object. But both Trigger.New[0].IsActive and Trigger.Old[0].IsActive returns same value i.e true. While I was expecting it to become false as User is disassociated from the contact in this process.

 

I am not sure whether it is a bug in the Salesforce or I am missing something...

 

Please Suggest.

 

Thanks,

Devendra Natani

Blog

 

 

Hi All, 

I need to know how I can let edit (Upsert ) my managed package custom settings by all user, what permission and what setting do I need to do and ship in Manage package ?
HI All,

We are planning to submit a manage package to salesforce. We are checking the security related issue using Checkmarx.

We are getting warning messages in Test methods for not using assert statement and multiple trigger on same object.

Will below warnings fail in the actual saleforce security review? 


User-added image



Hello,

 

I have a vf page with action attribute

 

<apex:page standardController="object1" extensions="class2" recordSetVar="sitem" action="{!sectionStat}">

 

now in my class i have this method which does the DML operation.

 

pulic void sectionStat()

{

...

...

 

try
                    {
                        upsert StatusLists;
                    }
                     catch(DmlException e){System.debug('~~~~~~~~~~~~~EXCEPTION --'+e);}  

 

}

 

Now when I do CheckMax security scanner it gives me XSRF error.

 

Than I tried to call this method from the constructor but I suppose you cannot call a DML operation from a constructor.

 

So I do not know what to do .

 

Please help on how to solve this issue.

Thanks

  • March 13, 2013
  • Like
  • 0

I got a question from a guy from a customer  today about My Domain, SP-Initiated SAML and the Admin login

Background:
- When setting up 'My Domain' and Federated, you can set up SP-initiated AND set it so that all logins must be from the My Domain page (no going to login.salesforce.com)
- Now consider this scenario, they set up SP-initiated and also check the flag to lock logins to be only from the My Domains page.  Their IDP goes down.  The Admin tries to login.  It seems he is stuck.  He goes to the My Domain page, which forwards him to the IdP which is down.  He can't go to login.salesforce.com because of the lock setting.
Question: What do they do?
I believe the only answer is that they cannot lock people to using the My Domains page without risking locking the Admin out in the case of an IDP-down situatino. They have to leave open the possibility of going to login.salesforce.com to allow the Sys Admin to login in an emergency situation.
Thoughts?
 

I have a contact which has a partner user. I am disabling the partner user from contact detail page by selecting "Disable partner user" option from "Work with Portal Button" dropdown.

 

I have a trigger on User object which fires on after update event.

 

trigger TR_User on User (after update) {
system.debug('########'+trigger.new[0].IsActive + '-' + trigger.old[0].IsActive);
}

 

In this trigger I am checking the IsActive field value of user object. But both Trigger.New[0].IsActive and Trigger.Old[0].IsActive returns same value i.e true. While I was expecting it to become false as User is disassociated from the contact in this process.

 

I am not sure whether it is a bug in the Salesforce or I am missing something...

 

Please Suggest.

 

Thanks,

Devendra Natani

Blog

 

 

Note I'm not positive the subject of this post is the true reason for the bug.  The other possible explanation is:


Dynamic SOQL requires namespace prefixes when called in global context

 

Anyway, the bug is:

 

Our managed package occasionally uses Dynamic SOQL.  In one case, we have a controller that uses Database.query() without any namespace prefixes:

Database.query('select CustomField__c from CustomObject__c');

 

In another case, we call Database.getQueryLocator() (as part of a Database.Batchable implementation).  That query also does not include the namespace prefix:

global Database.queryLocator start(Database.BatchableContext bc) {
return Database.getQueryLocator('select CustomField__c from CustomObject__c');
}

 

 


All of this works in our DE org, but once packaged & deployed, only the first one works.

 

The second ("getQueryLocator") throws an exception:

Developer script exception from iHance : 'i.Maintenance' : common.exception.ApiQueryException: No such column 'CustomField__c' on entity 'i__CustomObject__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.


I'm not sure if the bug is that getQueryLocator() requires the namespace prefix, or if Dynamic SOQL methods called in the global context do.  Without re-packaging everything to create a test case, there's no way for me to tell.

 

Salesforce support - I've created case 03501471 to track this issue.

  • April 23, 2010
  • Like
  • 0