• Jose Zuniga
  • NEWBIE
  • 65 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 43
    Questions
  • 18
    Replies
We are arriving to our max number of Salesforce Users. We know that there is a bunch of them who log in every 3-4 weeks. Many of these users are somehow "plugged" to sharing groups, they need to receive emails, and several other operations related to their respective salesforce ID. Could it be OK to disable users to allow others to use our Sales Force app and if they come back later re-enabling them -possibly disabling others-?

I have some code that depends on LAST_MONTH. Something like:

select .... date__c .. FROM myTable__c where date__c = LAST_MONTH

This code, as I understand, returns a result set constrained to

firstOfPastMonth <= date__c <= LastOfPastMonth

In order to make this query ready to run for any other month and not only for the last one, I tried to eliminate the use of LAST_MONTH by using variables like:

iniMonth = myToday.addMonths(-1).toStartOfMonth(); endMonth = iniMonth.addDays(date.daysInMonth((integer) iniMonth.year(), (integer) iniMonth.month()));

where myToday represents a call to a date that belongs to the month just after the needed month. So I got:

select .... date__c ... FROM myTable__c where date__c >= iniMonth AND date__c < endMonth

Am I missing something? Please, let me know Thanks
I need to see the system.debug messages for two important classes:  CommunitiesLandingController and CaminoRedirectController. These clases execute after the JIT handler is done. For some reason I can only see the system.debug messages for the JIT handler but not for the controllers. How can this be done?

Thx
I need to find out how a sharing group can be empty?
I am trying to implement an algorithm like this:
I want to share an object O using a sharing group G
Before inserting the object O create an empty group G
After inserting the object add the "people" that O will be shared with to G, possibly rename G and "attach" G to O so this object will be shared through G.
Is this possible? If so I might be able to avoid the use of @future methods and Salesforce is so problematic with them.
thanks
if I have a user that has "plugged" a person account throught the User.ContactId,

      Account a = handleAccount(create, u, attributes);    // a    gets an account object       
      Id accountId = a.Id;     
    ......
      User U  ....
      U.ContactId = [select PersonContactId  FROM account where ID =: accountId].PersonContactId; 

How can I do to refer to all the account properties from User?  Is there something like   U.ContactId__r.personemail? 

Thanks
 
I have this object called DateTimeSetter:

Label    DateTimeSetter    
Object Name    DateTimeSetter
API Name    DateTimeSetter__c    
Setting Type    Hierarchy
Visibility    Public
Description    
Namespace Prefix        C
reated Date    2/29/2016 1:05 PM
Last Modified Date    2/29/2016 1:05 PM

From any other profile different to system admin I can not save data that uses this object. From the profiles I have, I can't find this object. Te setting Type option is Grey out showing only the "Hierarchy" option making impossible to change this setting (as far as I know). How can I do to enable access to this object from any profile different to admin?
I have this link which works:
https://myforcename.force.com/myCommunity
However, if I use
https://myforcename.force.com
I get the message:
https://myforcename.force.com/myCommunity is under construction
How can I do to make https://myforcename.force.com properly redirect to https://myforcename.force.com/myCommunity?
Is    Account.net_Id__pc   case sensitive? can this be changed to be case insensitive?

Thanks
 
I have this query:

List<id> accounts1 = [SELECT Id, PersonContactId, PersonEmail, FirstName, LastName, net_Id__pc FROM Account
                             where net_Id__pc = pFederationID]

I need the constraint   net_Id__pc = pFederationID  to be case non sensitive. I mean, if net_Id__pc = 'jOeDoe'  and   pFederationID = 'joedoe' then they should be considered equal. How can this be done?
I have the next code:

---------------------------------------------------------------------
List<User> lUsers = [select federationIdentifier, email, firstName, lastName, ContactId, isActive from User where isActive=True and FederationIdentifier != ''];
List<Account> lAccounts = new List<Account>();


for (User U:lUsers)
{
    Account uAccount = [select Id, PersonContactId, net_id__pc, personemail, firstName, LastName from account where PersonContactId = :U.ContactId].get(0);
    uAccount.net_id__pc = U.federationIdentifier;
    lAccounts.add(uAccount);  
}

system.debug(lAccounts);

--------------------------------------------------------------
But I am getting a System.LimitException: Too many SOQL queries:101. Is there any other way to write this code and avoid this problem?

Thanks

 
How can I do to read/modify a person account NetId? I couldn't find any reference for this particular field in PersonAccount or account

Thanks
I need to update an object called Employee__c if the respective User object is updated. Let's suppouse that before any update, the employee__c object was already created at the time its respective User one was created and that Employee__c has a field that makes a look up over the User object keeping the id of the User that "triggered its creation". I need to do this using Process Builder. Any ideas?
Is there anyway to obtain the values (using Apex) of the next fields filled up in the SSO page settings:

Entity ID
Portal Community Login URL
Salesforce Login URL

Thanks
I have the next code:

--------------------------------------------------------
 for (User U: newUsersData)
      {

            .............

      
              List <employee__c> LEmp =  [select   ID, 
                                  Email__c,
                                First_Name__c,
                                Last_Name__c,
                                User_Record__c,
                                Title__c,
                                MSC__c,
                                Global_Department__c
                             
                                          from employee__c 
                                          where User_Record__c = :U.Id                                                        
                                   ];
                   ....

--------------------------------------------------

User_Record__c is a lookup over User. The object  employee__c   has User_Record__c  as a field. Whenever I run the previous Select query LEmp becomes empty. But, if I write at the query console:

select   ID, Email__c, First_Name__c,
         Last_Name__c,  User_Record__c,
         Title__c,  MSC__c, Global_Department__c
 from employee__c 
 where User_Record__c = :'SOMEUSERID'

where SOMEUSERID  represents the ID of the user I am looking for then I get the row I need. 
Is there something wrong with my syntax?
Thanks
Lets assume that I created an object in DEV, several permissions respect to that object were set -not necessarily by me- and now this object is deployed to production. If I want to retrieve all the information like field permissions, accessibility ones, etc etc, I know that information will be in the profiles and in the permissionSets folder. What I don't know is all the xml element types used to specify this information. Does anyone know this? What could be the case for classes?
 
I need to be able to see the logs created by my code using system.debug inclusive if I am offline.
How can this be done?
What setting I need to use to be able to export custom object/field definitions (like security etc) to a profile? For example, in Admin.profile I will like to see something like 
    <fieldPermissions>
        <editable>false</editable>
        <field>Work_Log__c.Calendar_Display__c</field>
        <readable>true</readable>
    </fieldPermissions>

Thanks
In a profile I can see:

    <fieldPermissions>
        <editable>true</editable>
        <field>Time_Log__c.Date__c</field>
        <readable>true</readable>
    </fieldPermissions>

but using the 'Set Field-Level Security' web interface I can only see:  visible  and  'Read Only' options. Please, tell me what means readable? I suspect it means     readable = Read Only  +  Visible

am I right?
Hello
     We refreshed our pro sandbox and now we need to reassign the permissions to objects from a backup zip file copy of our sandbox which we got using force.com eclipse (yes, we got the Profiles and Permisionsets folders and their contents). Some objects are missing their respective permissions and we only have the those files. How can we reassing -programmatically if possible- the needed permissions?
How pro-grammatically can I verify the permissions on an object and its fields? I also need to find -programmatically- objects with no permission set through profiles or permission sets?
I need to be able to see the logs created by my code using system.debug inclusive if I am offline.
How can this be done?
Our Active Directory system is NOT case sensitive respect of the federation ID. So, if for a user the true federation id is  myID  this person could also use  Myid. We notice, however that Salesforce is -by default- case sensitive respect of the federation Id. Is it possible to change this behavior within Salesforce? Any special setting?  Thanks a lot
 
I go to the Accounts page and start creating a new account. I fill up this form and press 'Save". At the next page I click on "Enable Customer User" and after that I see the information of a user including the name of a Role that seems to be dynamically created and that also is not existent in the UserRole table. How this could be happening? The system is able to save the user information in this case. (we use person accounts)

Thanks
Jose
 
We are arriving to our max number of Salesforce Users. We know that there is a bunch of them who log in every 3-4 weeks. Many of these users are somehow "plugged" to sharing groups, they need to receive emails, and several other operations related to their respective salesforce ID. Could it be OK to disable users to allow others to use our Sales Force app and if they come back later re-enabling them -possibly disabling others-?

I have some code that depends on LAST_MONTH. Something like:

select .... date__c .. FROM myTable__c where date__c = LAST_MONTH

This code, as I understand, returns a result set constrained to

firstOfPastMonth <= date__c <= LastOfPastMonth

In order to make this query ready to run for any other month and not only for the last one, I tried to eliminate the use of LAST_MONTH by using variables like:

iniMonth = myToday.addMonths(-1).toStartOfMonth(); endMonth = iniMonth.addDays(date.daysInMonth((integer) iniMonth.year(), (integer) iniMonth.month()));

where myToday represents a call to a date that belongs to the month just after the needed month. So I got:

select .... date__c ... FROM myTable__c where date__c >= iniMonth AND date__c < endMonth

Am I missing something? Please, let me know Thanks
Hi All,

I am getting the above error on my trigger (wrote a class and then added the class to my trigger) and I can't figure out how to resolve.  All help is so greatly appreciated!

Error: Compile Error: Method does not exist or incorrect signature: ContactExtIdUpdates.updatecalled.remove(Id) at line 6 column 72

Class:
public with sharing class ContactExtIdUpdates {
    public static set<ID> updatedcalled = new set<id>();
}
Here is the trigger and location of the error:
trigger ContactID on Contact (before insert, before update, after update, after delete)
{
    // creates a "lock" by adding the object Id into the "updatecalled" set of IDs.
    for (Contact Cc : Trigger.New) {
            if (Trigger.isAfter) {
                if (!ContactExtIdUpdates.updatecalled.Contains(Cc.Id)) ContactExtIdUpdates.updatecalled.remove(Cc.Id); //Removes lock once updated <------THIS LINE IS CAUSING ERROR
        } else if (!ContactExtIdUpdates.updatecalled.Contains(Cc.Id)) {//Checks lock, executing code only if no lock
        ContactExtIdUpdates.updatecalled.Add(Cc.Id); //Adds lock
        //


 
How can I do to read/modify a person account NetId? I couldn't find any reference for this particular field in PersonAccount or account

Thanks
Is there anyway to obtain the values (using Apex) of the next fields filled up in the SSO page settings:

Entity ID
Portal Community Login URL
Salesforce Login URL

Thanks
I have the next code:

--------------------------------------------------------
 for (User U: newUsersData)
      {

            .............

      
              List <employee__c> LEmp =  [select   ID, 
                                  Email__c,
                                First_Name__c,
                                Last_Name__c,
                                User_Record__c,
                                Title__c,
                                MSC__c,
                                Global_Department__c
                             
                                          from employee__c 
                                          where User_Record__c = :U.Id                                                        
                                   ];
                   ....

--------------------------------------------------

User_Record__c is a lookup over User. The object  employee__c   has User_Record__c  as a field. Whenever I run the previous Select query LEmp becomes empty. But, if I write at the query console:

select   ID, Email__c, First_Name__c,
         Last_Name__c,  User_Record__c,
         Title__c,  MSC__c, Global_Department__c
 from employee__c 
 where User_Record__c = :'SOMEUSERID'

where SOMEUSERID  represents the ID of the user I am looking for then I get the row I need. 
Is there something wrong with my syntax?
Thanks
In a profile I can see:

    <fieldPermissions>
        <editable>true</editable>
        <field>Time_Log__c.Date__c</field>
        <readable>true</readable>
    </fieldPermissions>

but using the 'Set Field-Level Security' web interface I can only see:  visible  and  'Read Only' options. Please, tell me what means readable? I suspect it means     readable = Read Only  +  Visible

am I right?
Every time we deploy to PROD using Force.com Eclipse we can get a deployment log. How can we get an error log every time we save a file to a Sandbox? This is so important to analyze that it will badly surprise me if this is not possible.

Thanks
After we refreshed a sandbox from production I was not anymore able to log in to the sandbox. Is there a way to create an admin account that will allow me to log in into the refreshed sandbox and create or redefine its admin users? Thanks again
I'm trying to have two sand boxes A and B with the same content. Why? because we want to make merges between our main sand box A and production P. But if something goes wrong we would like to have B as backup. What could go wrong? Well, sometimes some updates from a sandbox can't be applied and it could be very teddious to find what failed. After we refesh sandbox A from P some important changes we wanted to incorporate in production from A could be accidentally be gone forever. This could be a big waist of time and resources.
    So, is there anyway to safely create a sandbox B fully copu of another A?

Thanks in advance!
Jose
I go to the Accounts page and start creating a new account. I fill up this form and press 'Save". At the next page I click on "Enable Customer User" and after that I see the information of a user including the name of a Role that seems to be dynamically created and that also is not existent in the UserRole table. How this could be happening? The system is able to save the user information in this case. (we use person accounts)

Thanks
Jose
 
My JIT code creates one User object  u  and another Person Account object with  accountId  ID. (my environment uses person accounts). I need to establish a relationship between them and I believe this has to be done using a command like:

u.ContactId = [select PersonContactId FROM account where ID =: accountId].Id

However, I am getting the next error at the insert command:

10:34:29:496 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Contact ID: id value of incorrect type: 0015500000Es8udAAB: [ContactId]

Can someone please tell me what am I missing?
Thanks Jose

Hello
    My envrionment is using personAccounts. While I was developing my code I was running a testing method so my code will insert a person account. To my surprise, under this testing process after the insert command was applied, the respective inserted record showed an ID but the isPersonAccont value was FALSE. not only that, the record type was giving a null value and this was properly assigned using the command

 RecordType personAccountRecordType =  [SELECT Id FROM RecordType WHERE Name = 'Person Account' and SObjectType = 'Account'];


If I run the same code out of the testing environment then that record is properly inserted in the database with the mentioned fields isPersonAccount and RecordType assigned to their proper values  (true and 'person Account' respectively). Any solution to have this working as expected in testing environment?

Thanks
Jose

 

While trying to insert a User accound using Apex I got this error:

16:55:44:236 EXCEPTION_THROWN [38]|System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, Cannot create a portal user without contact: [ContactId]

How can I relate a contact object to the respective User object? I now some contact fields can be modified using the account object. 

Thanks in advance
Jose
 
Usr is User data type. I tried:

usr.TimeZoneSidKey     = '(GMT-06:00) Mountain Daylight Time (America/Denver)';

but I get the next error after trying to insert:

15:19:03:036 FATAL_ERROR System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Time Zone: bad value for restricted picklist field: (GMT-06:00) Mountain Daylight Time (America/Denver): [TimeZoneSidKey]

but '(GMT-06:00) Mountain Daylight Time (America/Denver)' is one of the picklist values for TimeZoneSidKey.

Any help, please?
Thanks
Jose