Skip to main content

Posts

Showing posts from 2015

Removing RecordType from Profile using Metadata

I thought that this is going to be my worst experiment ever!!I should not done this especially when I have other important task to do. I tried to figure out how to embed inline visualforce in Page Layout for Standard Edit, so I creating RecordType and hope it will help.But it won't;there seem no choice to embed inline visualforce based on the Answer here . Anyway,back to accident RecordType.I am not able to delete it because it prompt me to deactivate it first.Again when I tried to deactivate it,it prompt error because it said it being used by these profiles. This record type Common Component cannot be deactivated because the following profiles use this record type as default . These profiles are more that 200(Actually to be exact 243).How I am going to navigate each profiles through browser and change the setting--it's going to take me forever. *just normal office chat* After few tries,it works.Nah,here the metadata that I append in my package.xml .So as you ca

Reading JSON file in GitHub from JSFiddle

I am experimenting with HighChart, digging out the code.I create sample JSON  resided in GitHub.Then in JSFiddle, I use Raw url to read JSON file,but it does not work and prompt me this error. Uncaught SecurityError: Blocked a frame with origin "xxxx" from accessing a frame with origin "http://jsfiddle.net". Protocols, domains, and ports must match. Then I googling and found out that we can paste Github URL at  http://rawgit.com/  ,so it will generate url that accessible.

Help Text oh Help Text

I am quite piss off for few day.I have standard page layout that already fulfill the requirement except : I want explanation in the form that also hyperlink point to  complete guideline URL on certain field.  This is pieces of cake but I could not find it doable in Salesforce.I just need to put some instruction something like bleh bleh bleh please click here. But it is not supported in Salesforce,even static text also not doable in Pagelayout. So I have to go for customize instead of using standard just because of one field requirement. Try to put hyperlink either using a href or hyperlink() == FAIL Please vote the idea here: Help Text with hyperlink Also it is good if we can have static text embedded in Page Layout :  Allow Text Labels within Section columns on page layouts Because of this lackness, there appexchange developed just to support this Improved Help  , which I am not sure what is it doing.Maybe will explore later.

Implementation restriction: TopicAssignment only allows security evaluation for non-admin users when either (1) LIMIT is specified and at most 1000 or (2) WHERE is specified and filter on Id or Entity

The error of today Implementation restriction: TopicAssignment only allows security evaluation for non-admin users when either (1) LIMIT is specified and at most 1000 or (2) WHERE is specified and filter on Id or Entity Rootcause:Query to TopicAssignment  no limit clause. List < TopicAssignment > topicAssigList = new List < TopicAssignment >([ SELECT EntityId , TopicId FROM TopicAssignment ]); No SOQL limit if logged-in user has “View All Data” permission. If not, do one of the following: Specify a LIMIT clause of 1,100 records or fewer. Filter on Id or Entity when using a WHERE clause with "=". If there no Where clause, then just include the LIMIT List < TopicAssignment > topicAssigList = new List < TopicAssignment >([ SELECT EntityId , TopicId FROM TopicAssignment LIMIT 1000 ]); TopicAssignment

Lightning Quickstart

The quick tutorial can be found here :  Lightning Quick Start (PDF) Error that you might face: FIELD_INTEGRITY_EXCEPTION Note that your code is something like this <aura:application > <jam:hello /> </aura:application> Note jam is namespace.In my case my namespace is unid .Replace jam with unid . After that click Preview, you may get URL No Longer Exist--I close my browser and reopen it.It works fine.

Breadcrumb in Gridbuddy

I just get to play around with Gridbuddy .While breaking an ice,I got requirement to create breadcrumb in Gridbuddy ,I referring to this site and follow the instruction.But somehow I bumped to some errors and manage to fix it.So I would like to rewrite it here so I won't forget. This is referring to Account breadcrumb because Account can have many children and grandchildren. Account A  --> Account B -->Account 1                    --->Account C -->Account 2                    --->Account D  So breakcrumb will be look like this Account A >> Account >> B >> Account 1 These are the steps: Create a number formula field to indicate hierarchy level at Account object. Create a text formula field to printout breadcrumb link Create a text formula field for Drill Up URL Add formula field to Gridbuddy field Create two actions at GridBuddy ; Drill Up and Drill Down. Add action to the Grid Step 1:Create a number formula field to indicate h

Salesforce Date format conversion

I want to change the format of Date field to M/dd/YYYY so it will be read as 07/30/2014. The field is Date datatype not Datetime datatype. Note: 1) In Date class there only format() method that will change the date format using locale. format() Returns the Date as a string using the locale of the context user 2) Only in DateTime class offer various of date formatting method. format() Converts the date to the local time zone and returns the converted date as a formatted string using the locale of the context user. If the time zone cannot be determined, GMT is used. format(dateFormatString) Converts the date to the local time zone and returns the converted date as a string using the supplied Java simple date format. If the time zone cannot be determined, GMT is used. format(dateFormatString, timezone) Converts the date to the specified time zone and returns the converted date as a string using the supplied Java simple date format. If the supplied time zone is not in th

Posting code in WP

Just trying to  post my apex code in WP. 1)Using Gist . Just copy the Gist URL into your WP post.Done.Look nice , but if you delete your file in Gist,the code in post also will be gone which I less prefer.Maybe will use it if I decide not to delete my file in Gist.  2) Using code based on Posting source code . Because this is from SyntaxHighlighter,it offered quite sophisticated features,but unfortunately I found it not able to remove the scroll bar.It got some solutions but only apply for WordPress.org only.But it nice, maybe for longer and complex code I can use this.  [code language="java" padlinenumbers="true" highlight="1"] public Map<Id,MyAgenda__c> getAgendaMap(){ agendaMap = new Map<Id,MyAgenda__c>([SELECT Id FROM MyAgenda__c WHERE Id=: this.stdController.getId() ORDER BY Date__c DESC]); return agendaMap; } [/code]  3)Using hilite.me It look nice for simple and shorter code. public Map < Id , My

Deploy salesforce component using ANT

*damnn... I missed one html tag , it prompt error then I click undo all my entries gone.blogger autosave seem not working.i have no luck.this is my third time entry* Why you need this? Imagine that you want to move many new component that not yet exist in the other sandbox.Instead of creating component one by one ,it is better to use ANT.But if the component is already exist in the target sandbox,it is advisable to have backup.Because you might overwrite other people code in target sandbox. Steps:(green color only apply for one time) 1. Install JAVA 2. Install ANT 3. Setup environment variables (PATH etc) 4. Download Force.com Migration Tool by go to Setup -> Develop ->Tools 5. Unzip the downloaded folder.Inside the folder contains directory/file such as: sample  > codepkg,mypkg,removecodepkg,unpackaged,build.properties,build.xml. ant-salesforce.jar Readme.html 6. Copy the component that you want to deploy into codepkg folder. 7. Open sample folder and

Salesforce Recycle Bin

No shortcut to find Recycle Bin. Replace highlighted  instance with your instance. https:// my_instance /search/UndeletePage *Deleted objects also can be found in Setup -->Create -->Objects.Scroll to the bottom of the page.