You need to sign in to do that
Don't have an account?
Andrew Lewis 9
Checking Accounts hierarchy level and passing the parent Id through VF page to report
Hi Everyone,
Brand new to Visualforce and I seem to have hit an error in my syntax, though I believe there is a better way to go about what I am trying to accomplish.
I am attempting to pass an account id to a report and have had success with the below code.
<apex:outputLink onclick="return isClickedInConsole(this)" html-data-reporturl="/{!$Label.Factset_List_View}?pv1={!URLENCODE(LEFT(Account.id,15))}" id="theLink_14">
<apex:outputLabel value="Factset List View"/>
<br/>
</apex:outputLink>
But I have now been requested to dynamically send the parent account id if the Hierarchy Level is equal to L3. Using the following code and other similar variations I recieve a syntax error and I am not sure how to go about solving it.
<apex:outputLink onclick="return isClickedInConsole(this)" html-data-reporturl="/{!$Label.Factset_Dashboard}?pv1={!URLENCODE(LEFT({!IF((Account.Hierarchy_Level__C=='L3'),Account.parentid,Account.id)},15))}" id="theLink_13">
<apex:outputLabel value="Factset Dashboard"/>
<br/>
</apex:outputLink>
Any help is greatly appreciated, thanks!
Brand new to Visualforce and I seem to have hit an error in my syntax, though I believe there is a better way to go about what I am trying to accomplish.
I am attempting to pass an account id to a report and have had success with the below code.
<apex:outputLink onclick="return isClickedInConsole(this)" html-data-reporturl="/{!$Label.Factset_List_View}?pv1={!URLENCODE(LEFT(Account.id,15))}" id="theLink_14">
<apex:outputLabel value="Factset List View"/>
<br/>
</apex:outputLink>
But I have now been requested to dynamically send the parent account id if the Hierarchy Level is equal to L3. Using the following code and other similar variations I recieve a syntax error and I am not sure how to go about solving it.
<apex:outputLink onclick="return isClickedInConsole(this)" html-data-reporturl="/{!$Label.Factset_Dashboard}?pv1={!URLENCODE(LEFT({!IF((Account.Hierarchy_Level__C=='L3'),Account.parentid,Account.id)},15))}" id="theLink_13">
<apex:outputLabel value="Factset Dashboard"/>
<br/>
</apex:outputLink>
Any help is greatly appreciated, thanks!
Thanks for posting.
Could you please try with below code
Below line has nested '{!'. this is might be causing issue.
{!URLENCODE(LEFT({!IF((Account.Hierarchy_Level__C=='L3'),Account.parentid,Account.id)},15))}"
Please mark as best answer if my reply helped.
All Answers
Thanks for posting.
Could you please try with below code
Below line has nested '{!'. this is might be causing issue.
{!URLENCODE(LEFT({!IF((Account.Hierarchy_Level__C=='L3'),Account.parentid,Account.id)},15))}"
Please mark as best answer if my reply helped.