-
ChatterFeed
-
0Best Answers
-
3Likes Received
-
0Likes Given
-
43Questions
-
18Replies
effects of enabling and disabling users in salesforce
-
- Jose Zuniga
- April 14, 2017
- Like
- 0
- Continue reading or reply
replacing last_month
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
-
- Jose Zuniga
- February 13, 2017
- Like
- 0
- Continue reading or reply
can't see debug messages
Thx
-
- Jose Zuniga
- December 08, 2016
- Like
- 0
- Continue reading or reply
Sharing objects, triggers, and avoiding @future methods
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
-
- Jose Zuniga
- September 30, 2016
- Like
- 0
- Continue reading or reply
Getting Person account properties from a User
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
-
- Jose Zuniga
- September 28, 2016
- Like
- 0
- Continue reading or reply
Object that doesn't show up on list of objects
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?
-
- Jose Zuniga
- September 22, 2016
- Like
- 0
- Continue reading or reply
Redirecting to proper landing page
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?
-
- Jose Zuniga
- September 14, 2016
- Like
- 0
- Continue reading or reply
Is Account.net_Id__pc case sensitive? can this be changed?
Thanks
-
- Jose Zuniga
- September 12, 2016
- Like
- 0
- Continue reading or reply
Case sensitivity in SOQL 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?
-
- Jose Zuniga
- September 12, 2016
- Like
- 0
- Continue reading or reply
Dealing with a SOQL Query limit
---------------------------------------------------------------------
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
-
- Jose Zuniga
- September 12, 2016
- Like
- 0
- Continue reading or reply
How can I do to read/modify a person account NetId?
Thanks
-
- Jose Zuniga
- September 12, 2016
- Like
- 0
- Continue reading or reply
Updating an object if User is updated
-
- Jose Zuniga
- August 12, 2016
- Like
- 0
- Continue reading or reply
getting some SSO settings from APEX
Entity ID
Portal Community Login URL
Salesforce Login URL
Thanks
-
- Jose Zuniga
- August 11, 2016
- Like
- 0
- Continue reading or reply
Using Id in select clauses
--------------------------------------------------------
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
-
- Jose Zuniga
- August 10, 2016
- Like
- 0
- Continue reading or reply
Importing Permissions, PermissionSets, and XML from DEV
-
- Jose Zuniga
- July 29, 2016
- Like
- 0
- Continue reading or reply
offline Logs
How can this be done?
-
- Jose Zuniga
- July 26, 2016
- Like
- 1
- Continue reading or reply
exporting custom filed/object definitions to profile
<fieldPermissions>
<editable>false</editable>
<field>Work_Log__c.Calendar_Display__c</field>
<readable>true</readable>
</fieldPermissions>
Thanks
-
- Jose Zuniga
- July 18, 2016
- Like
- 0
- Continue reading or reply
relationship between readable, visible and 'read only'
<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?
-
- Jose Zuniga
- July 18, 2016
- Like
- 0
- Continue reading or reply
Setting permissions from profiles files and permissionsets files
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?
-
- Jose Zuniga
- July 15, 2016
- Like
- 0
- Continue reading or reply
How pro-grammatically can I verify the permissions on an object ?
-
- Jose Zuniga
- July 15, 2016
- Like
- 0
- Continue reading or reply
offline Logs
How can this be done?
-
- Jose Zuniga
- July 26, 2016
- Like
- 1
- Continue reading or reply
SSO: Make use of federation id 'case insensitive'
-
- Jose Zuniga
- May 31, 2016
- Like
- 1
- Continue reading or reply
Account, User, dynamically created Role
Thanks
Jose
-
- Jose Zuniga
- May 10, 2016
- Like
- 1
- Continue reading or reply
effects of enabling and disabling users in salesforce
- Jose Zuniga
- April 14, 2017
- Like
- 0
- Continue reading or reply
replacing last_month
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
- Jose Zuniga
- February 13, 2017
- Like
- 0
- Continue reading or reply
Error: Compile Error: Method does not exist or incorrect signature.....REMOVE(Cc.Id)
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 //
- Sarah Osburn 3
- September 12, 2016
- Like
- 0
- Continue reading or reply
How can I do to read/modify a person account NetId?
Thanks
- Jose Zuniga
- September 12, 2016
- Like
- 0
- Continue reading or reply
getting some SSO settings from APEX
Entity ID
Portal Community Login URL
Salesforce Login URL
Thanks
- Jose Zuniga
- August 11, 2016
- Like
- 0
- Continue reading or reply
Using Id in select clauses
--------------------------------------------------------
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
- Jose Zuniga
- August 10, 2016
- Like
- 0
- Continue reading or reply
relationship between readable, visible and 'read only'
<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?
- Jose Zuniga
- July 18, 2016
- Like
- 0
- Continue reading or reply
Error logs while saving a file to SandBox
Thanks
- Jose Zuniga
- July 13, 2016
- Like
- 0
- Continue reading or reply
Can't login into refreshed sandbox
- Jose Zuniga
- June 03, 2016
- Like
- 0
- Continue reading or reply
Creating a backup sandbox from another sandbox
So, is there anyway to safely create a sandbox B fully copu of another A?
Thanks in advance!
Jose
- Jose Zuniga
- June 03, 2016
- Like
- 0
- Continue reading or reply
Account, User, dynamically created Role
Thanks
Jose
- Jose Zuniga
- May 10, 2016
- Like
- 1
- Continue reading or reply
Relationship between a User account and a Person account
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
- Jose Zuniga
- May 10, 2016
- Like
- 0
- Continue reading or reply
Inserting person accounts in test mode
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
- Jose Zuniga
- May 10, 2016
- Like
- 0
- Continue reading or reply
Modifying and setting User.ContactId with a Contact.Id
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
- Jose Zuniga
- May 05, 2016
- Like
- 0
- Continue reading or reply
Assigning a value to usr.TimeZoneSidKey
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
- Jose Zuniga
- May 04, 2016
- Like
- 0
- Continue reading or reply