Ribbon button should be hidden based on lead status - CRM 2011 - dynamics-crm-2011

I have custom button in lead ribbon. The custom button should be hidden when lead is qualified. How can I do that? Can any one please explain. I appreciate.

You can actually accomplish this entirely with built-in DisplayRule functionality. When a Lead is qualified, the StatusCode property is set to "Qualified", which translates into an OptionSet value of "3". You can check for the value of this property in a ValueRule and display/hide the control appropriately. I can think of two ways to achieve this:
Erik Pool's Visual Ribbon Editor
RibbonXml
<RibbonDiffXml>
<CustomActions>
<CustomAction Id="CompanyName.Form.lead.MainTab.Actions.Sample.CustomAction" Location="Mscrm.Form.lead.MainTab.Actions.Controls._children" Sequence="41">
<CommandUIDefinition>
<Button Id="CompanyName.Form.lead.MainTab.Actions.Sample" Command="CompanyName.Form.lead.MainTab.Actions.Sample.Command" Sequence="29" ToolTipTitle="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" LabelText="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" ToolTipDescription="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.Description" TemplateAlias="isv" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
<CommandDefinition Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command">
<EnableRules />
<DisplayRules>
<DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule" />
</DisplayRules>
<Actions>
<Url Address="http://www.bing.com" />
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule">
<ValueRule Field="statuscode" Value="3" />
</DisplayRule>
</DisplayRules>
<EnableRules />
</RuleDefinitions>
<LocLabels>
<LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.LabelText">
<Titles>
<Title languagecode="1033" description="Sample" />
</Titles>
</LocLabel>
<LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.Description">
<Titles>
<Title languagecode="1033" description="Sample Description" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>

Related

Open password protected Excel spreadsheet with UiPath

I was wondering if anyone had succeeded in opening a password protected XL spreadsheet with UiPath.
I tried using "Open Workbook" and entering the password in password field ... but that didn't work.
I tried using Open Application ... but I can't seem to talk to the password dialogue box.
Really flumoxed !
Update the Excel Activities. Use the new Excel Application Scope. Set the password property.
Try saving this password-protected Excel dummy data file (https://cdn-business2.discourse.org/uploads/uipath/original/2X/2/25c38fb93744b863e5db1e50f757a6cdf8b77128.xlsx) and run it against this code below (save as XAML, the UiPath file).
Hope that helps.
<Activity mc:Ignorable="sap sap2010 sads" x:Class="excel_password" mva:VisualBasic.Settings="{x:Null}" sap2010:WorkflowViewState.IdRef="excel_password_1"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:sd="clr-namespace:System.Data;assembly=System.Data"
xmlns:ui="http://schemas.uipath.com/workflow/activities"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>System.Xml.Serialization</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.Core</AssemblyReference>
<AssemblyReference>UiPath.Core.Activities</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence DisplayName="excel_password" sap2010:WorkflowViewState.IdRef="Sequence_2">
<Sequence.Variables>
<Variable x:TypeArguments="sd:DataTable" Name="dt" />
<Variable x:TypeArguments="x:String" Name="dt_op" />
</Sequence.Variables>
<ui:ReadRange AddHeaders="True" DataTable="[dt]" DisplayName="Read range" sap2010:WorkflowViewState.IdRef="ReadRange_1" Password="uipath" SheetName="Sheet1" WorkbookPath="dummy.xlsx">
<ui:ReadRange.Range>
<InArgument x:TypeArguments="x:String">
<Literal x:TypeArguments="x:String" Value="" />
</InArgument>
</ui:ReadRange.Range>
</ui:ReadRange>
<ui:OutputDataTable DataTable="[dt]" DisplayName="Output data table" sap2010:WorkflowViewState.IdRef="OutputDataTable_1" Text="[dt_op]" />
<WriteLine DisplayName="Write line" sap2010:WorkflowViewState.IdRef="WriteLine_1" Text="[dt_op]" />
<ui:MessageBox Caption="{x:Null}" ChosenButton="{x:Null}" Buttons="Ok" DisplayName="Message box" sap2010:WorkflowViewState.IdRef="MessageBox_1" Text="[dt_op]" TopMost="True" />
<sads:DebugSymbol.Symbol>dyxDOlxVc2Vyc1xtbWlhb1xEb3dubG9hZHNcZXhjZWxfcGFzc3dvcmQueGFtbA47A0sOAgEBQAVGFAIBDUcFR48BAgEISAVIaAIBBUkFSbUBAgECQC9ANQIBEkMLQzoCARFAhgFAjgECARBAmQFAoQECAQ9ArwFAuwECAQ5HgwFHjAECAQtHI0cpAgEJSFxIZQIBBkmaAUmjAQIBAw==</sads:DebugSymbol.Symbol>
</Sequence>
<sap2010:WorkflowViewState.ViewStateManager>
<sap2010:ViewStateManager>
<sap2010:ViewStateData Id="ReadRange_1" sap:VirtualizedContainerService.HintSize="314,87" />
<sap2010:ViewStateData Id="OutputDataTable_1" sap:VirtualizedContainerService.HintSize="314,22" />
<sap2010:ViewStateData Id="WriteLine_1" sap:VirtualizedContainerService.HintSize="314,61" />
<sap2010:ViewStateData Id="MessageBox_1" sap:VirtualizedContainerService.HintSize="314,59" />
<sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="336,473">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="excel_password_1" sap:VirtualizedContainerService.HintSize="376,553" />
</sap2010:ViewStateManager>
</sap2010:WorkflowViewState.ViewStateManager>
</Activity>
Use Excel application scope and read the excel through that.
when you use excel application on your right hand side,under file you have a field called Password.
Enter the password which would make the excel sheet open.
This should work

How to make a single column in Telerik Radgrid Resizable?

I have the following Telerik RadGrid.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true"
PageSize="50" HeaderStyle-Height="20" ShowStatusBar="true" AllowCustomPaging="True"
OnNeedDataSource="RadGrid1_NeedDataSource" OnSortCommand="RadGrid1_SortCommand"
OnPageSizeChanged="RadGrid1_PageSizeChanged" OnPageIndexChanged="RadGrid1_PageIndexChanged"
OnItemCommand="RadGrid1_ItemCommand" OnItemDataBound="RadGrid1_ItemDataBound">
<clientsettings>
<Selecting AllowRowSelect="True" />
<Resizing EnableRealTimeResize="true" />
</clientsettings>
<exportsettings filename="list">
</exportsettings>
<mastertableview datakeynames="ID" autogeneratecolumns="false">
<PagerStyle AlwaysVisible="true" PagerTextFormat="{4} {5} item(s) in {1} page(s)" />
<Columns>
<telerik:GridBoundColumn DataField="Contract" HeaderStyle-Width="20%" HeaderText="Contract Title"
UniqueName="Contract" SortExpression="Contract"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Customer" HeaderStyle-Width="20%" HeaderText="Vendor"
UniqueName="Vendor" SortExpression="Customer"> </telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Contractor" HeaderStyle-Width="20%" HeaderText="Contractor"
UniqueName="Contractor" SortExpression="Contractor"></telerik:GridBoundColumn>
**<telerik:GridBoundColumn DataField="Name" HeaderText="Service"
UniqueName="Name" SortExpression="Name" Resizable="true"> </telerik:GridBoundColumn>**
</Columns>
</mastertableview>
</telerik:RadGrid>
I want to make only the last column (Name) resizable. I used Resizable="true" but it is not working. Is there any other way for it?
You need to add AllowColumnResize="True" on RadGrid and you can disable other column's resize properties by using Resizable="False".

In ext.net, how do I align a tabpanel button to the right?

I would like to align the button of the right, but keep the content tabs on the left. This is my code:
<ext:TabPanel ID="TabPanel1" runat="server" Height="295" Plain="true" DeferredRender="false" meta:resourcekey="TabPanel1Resource1">
<TabBar>
<ext:Button runat="server" Icon="ArrowOut" meta:resourcekey="fullscreenResource1">
<DirectEvents>
<Click OnEvent="edit_fullOpenAdd" />
</DirectEvents>
</ext:Button>
</TabBar>
<Defaults>
<ext:Parameter Name="autoScroll" Value="true" Mode="Raw" />
</Defaults>
<Items>
......the content ......
</Items>
</ext:TabPanel>
Any Ideas?
Thank you!
Edit: I was told to try tabCls: 'right-tab', but I do not know how to implement this.
Use TabStrip control.
Please see this example: http://examples.ext.net/#/TabPanel/TabStrip/Overview/

Ext:BooleanColumn,when editing ,it shows true or false value

I have a grid and there is ext:BooleanColumn inside it,and I put a combobox for editing boolen colum.everything works fine ,except of this one .when I click boolen colum to edit,it shows false or true inside it,
I added a image what I trying to say.
how I can avoid this .thank you
and here is the my code :
<ext:BooleanColumn ID="BooleanColumn1" runat="server" DataIndex="BorcOdendimi" TrueText="odendi" Text="ödenme durumu"
FalseText="odenmedi" >
<Editor>
<ext:ComboBox runat="server" Text="odendi durumu" Editable="false">
<Items>
<ext:ListItem Text="Odendi" Value="1" />
<ext:ListItem Text="Odenmedi" Value="0" />
</Items>
</ext:ComboBox>
</Editor>
</ext:BooleanColumn>
To get it working the Values of the ComboBox's Items should match the values of a BooleanColumn. Currently, true/false (BooleanColumn's values) doesn't match 1/0 (ComboBox Items' values).
You can replace the existing ComboBox's Items with:
<ext:ListItem Text="Odendi" Value="true" Mode="Raw" />
<ext:ListItem Text="Odenmedi" Value="false" Mode="Raw" />
Answered in the Ext.NET forums thread.

Get selected values from MultiCombo in Ext.NEt via JS

I am using Ext.Net I have a form with a ComboBox which I have just changed to a MultiCombo.
Previously I used "SelectEnquiry.getValues()" to retrieve the selected item and pass it into a parameter used with a Button Direct Event.
How do I get the selected values when using the MultiCombo?
Combo Box Bit
<ext:MultiCombo runat="server" ID="SelectEnquiry" FieldLabel="Enquiry" AnchorHorizontal="95%" Editable="false" ValueField="Id" DisplayField="ProviderName" TypeAhead="true" Mode="Local" ForceSelection="true" TriggerAction="All" EmptyText="Select Enquiry" ValueNotFoundText="Select Enquiry" ItemSelector="div.list-item" SelectOnFocus="true" AllowBlank="false">
Button form submit bit
<ext:Button runat="server" ID="ButtonEmailTaskAccept" Text="OK">
<Listeners>
<Click Handler="if (PanelUnlinked.isVisible() && !$form.validate( [SelectProject, SelectEnquiry])) return false;">
</Click>
</Listeners>
<DirectEvents>
<Click Url='<%# Url.Action("CompleteEmailTask") %>' AutoDataBind="true"
Success="window.$messageBus.publish('task-admin', 'inbox-changed');
window.$messageBus.publish('task-admin', 'task-changed');
WindowAssignEmail.close()" Failure="$shell.requestFailedHandler(response, null)"
Json="true">
<EventMask ShowMask="true"></EventMask>
<ExtraParams>
<ext:Parameter Name="emailResponseId" Value="<%# Model.EmailResponse.Id %>" Mode="Value"
AutoDataBind="true" />
<ext:Parameter Name="enquiryId" Value="SelectEnquiry.getValues()" Mode="Raw" />
<ext:Parameter Name="documentList" Value="buildSelectionList()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
With <ext:MultiCombo> you can just call .getValue() to return an Array of selected values. I'll look into adding .getValues() as well, so it's consistent with the <ext:ComboBox> api.
Edit
It appears the ComboBox does not have a client-side .getValues() function, so we won't be adding to the MultiCombo. Just use .getValue(), which is standardised across all Form Fields.
The problem seemed to be that it could not locate the control I was try to get the value from.
So managed to solve it by doing:
#{SelectEnquiry}.getSelectedValues()

Resources