Authored by Zishan Razzaq
Showing posts with label Salesforce. Show all posts
Showing posts with label Salesforce. Show all posts

Tuesday, March 20, 2018

NEW SITE

Check out my New Website Cloud Computing Made Easy


Salesforce
ServiceNow
AWS
Mulesoft

Friday, July 22, 2016

The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301P0000000D7My. Contact your administrator for help.

Hi All,


Ever run into an error that does not seem to make sense even though it provides the ID and you take that ID place it into the salesforce URL and it brings up nothing. This is the scenario especially when your Flow/Process builder breaks and it provides an error such as this:

"The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301P0000000D7My.  Contact your administrator for help."

The ID is not really the ID for the Flow or process builder. To find that out we have to do a little bit of work and here is how:

Navigate to Setup, and in quick search on left hand side type in "Flows"  as so in the screenshot below:























Open up any flow,  By clicking Open next to the flow.


Now in the URL, the last part where there is a salesforce ID, place the ID giving in your error and hit enter, Once you hit enter, it will navigate you to the correct flow and from there you can deactivate it and re-look at why is it failing.




 Hope this helps Enjoy...
Thanks
Zishan






Wednesday, August 21, 2013

Lookup Field is on Page Layout but Users can not see it???

Hi everyone:

Scenario:

I got an email, where the User can not view this one field which is a lookup to another object within the current object but yet the had the following:
  1. FLS- Field Level Security - the field was visible to there profile
  2. It was on the page layout that was assigned to there profile
  3. Even checked the Accessibility Access within the field and it was required.
So then what can be the issue?

WHY CAN'T THIS USER OR ANYONE WITHIN THIS USER's PROFILE SEE THIS FIELD?
(THIS WOULD BE A GOOD SCENARIO FOR A SFDC ADMIN INTERVIEW)

SOLUTION:

The reason they can not see that field even with all the permissions there... The User's profile does not have access to that related object that field is looking up to.

So navigate to the user profile, go to the object that the lookup refers to and provide it read access or whatever your business requires to have access to.

Go back to the page log under that user and they now should see the field and everything should work properly....


Hope this helps
thanks
Zishan R

Thursday, November 29, 2012

How to use 'NOT LIKE' in SALESFORCE SOQL

Hi everyone:
    Business Scenario:
        They would like something update where a field on the record is NOT LIKE "adviser." Or in simplest terms does not contain "Adviser".

Solution for developers in APEX:

APEX will not allow someone to write a simple query such as:
SELECT Name From ABC where id=:Ownerid and Name NOT Like '%adviser%';

So solution is simple:
SELECT NAME From ABC where id=:Ownerid and (NOT Name Like  '%adviser%');

If you are utilizing GROUP By statements here is an example of one:


 AggregateResult[] groupedResults = 
         [SELECT Ownerid,Count(Id) ce 
         FROM Opportunity Where 
         Withdrawn__c = True 
         AND StageName = 'Closed Won' 
         AND Withdrawal_Status__c ='Withdrawn' 
         AND Withdrawn_Date__c = THIS_MONTH  
         AND Ownerid=:id 
         AND (NOT Name Like '%COMP%')
         GROUP BY Ownerid];  

Hope this Helps.
Thanks
Zishan



FLOOR Function in Salesforce Alternative Way

Hi everyone:
    Business Scenario:
       The business would like a formula field that will calculate a number to the nearest lowest 10.
Which means:
If the number is 129 the new number would be 120
If the number is 64 the new number would be 60.

The issue:
   In Salesforce, FLOOR Functionality does not work the same way in Excel.
In Excel you would do something like this to get the top results:
=FLOOR(129,10) which equals 120

In Salesforce, within a formula field it would be:
FLOOR(129) which equals 129, does not work. Do not know why, when Salesforce states the following:
"Returns a number rounded down to the nearest integer."
  

Solution:
   Navigate to the Object that you are placing this formula field in: For me its:
Setup | Create | Object | Test | New Field

Click on Formula Attribute type and Click Next.
For data type click on Number, no decimal if you want you can have it.

The field I will utilize is an existing field within my formula that is a Number(18,0) field already named Net_Enrollment__c.

This is my final formula for the new field I created named Level__c:
IF(Net_Enrollment__c <1 1="1" et_enrollment__c="et_enrollment__c" span="span">

Breakdown of the formula:
I utilize If then statement to conditionalize it to work properly (you do not have to)
I start with:

IF(Net_Enrollment__c<1 0="0" 1="1" be="be" do="do" end="end" greater="greater" if="if" is="is" it="it" math="math" means="means" net_enrollment="net_enrollment" result="result" should="should" span="span" the="the" then="then" which="which" zero="zero">

FLOOR(Net_Enrollment__c) <== which returns me my number


VALUE(RIGHT(TEXT(Net_Enrollment__c), 1) <== Reasons of utilizing TEXT functionality and RIGHT Function

RIGHT Function only works on TEXT and not number data types. 
So I had to convert the Net_Enrollment__c field into a TEXT and then utilize the RIGHT function to get me the Last Digit in my Net Enrollment number and VALUE function returns it to a number

So if I have 129, by using the formula
VALUE(RIGHT(TEXT(129), 1) would give me "9"

So then I take the whole number 129 - 9 = 120
Which is
FLOOR(129)-VALUE(RIGHT(TEXT(129), 1))


Hope this helps and remember always think outside the box.

Thanks
Zishan

 

Thursday, February 23, 2012

Change Password via Developer Console in Salesforce without resetting password

Scenario:
      We need to reset a password or change the password on an user utilizing a 3rd party app in salesforce. This user is there for the app only and not really a physical user in the instance. The email for this user is a person who has left the company or is on vacation but you need the app to work.

Solution:
    You can do this 2 ways:
  1. Change the Email of the user in question
  2. Click on Generate Password and click save.
But lets say you can not change the Email of the user because you should not be the owner of the app or you are not part of the app as an admin. Here is where you change using Developer Console.

Go to Setup and Drop it down to Developer Console or sometimes called the System Log




Within the "Logs" tab you will see a button called "Execute".


Click on the text box or white space next to it.

It shall open up another window which is titled "Enter Apex Code"

Place in the following SOQL query:
User usr = [select Id from User where username='appuser@myzc.com'];
System.setPassword(usr.Id,'welcome1234');

Then click on Execute.
It should bring up a success window and you should be good to go.
Now you may need to log in and make sure everything is ok.

Hope this helps... I am not responsible for anyone utilizing this method... It can be a risk... I would check before you do this task.
Thanks
Zishan R.


Watch Me Fight 
Join My Facebook on Cage Assassin Fight Gear 
Like my fan page Cage Assassin Fight Gear