• 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
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