Hello Everyone !!!
I have created a custom sharepoint list (not using code) directly from site and new, display and edit forms are customized using Infopath.
I have created a feautre that uses the custom action to add a button on these form.
But this button is getting add on every sharepoint list in which the forms are infopath customized.
<CustomAction
Description="Add button on Infopath Edit Form of custom List"
Title="Add Report button"
Id="{5001ED3A-E1D1-4940-B9B0-3764E4BAF9EF}"
Location="CommandUI.Ribbon"
Sequence="0"
xmlns="http://schemas.microsoft.com/sharepoint/"><CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/"><CommandUIDefinitions><CommandUIDefinition Location="Ribbon.ContextualTabs.InfoPathListTab.Commit.Controls._children"><Button Id="{B511A716-54FF-4EAE-9CBE-EA02B51B626E}"
Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}"
Image32by32="~site/_layouts/1033/Images/report-icon32.png"
Image16by16="~site/_layouts/1033/Images/report-icon16.png"
Sequence="1000"
LabelText="report redirect"
Description="report redirect"
TemplateAlias="o1"
CommandType="General"
/></CommandUIDefinition></CommandUIDefinitions><CommandUIHandlers><CommandUIHandler Command="{4E2F5DC0-FE2C-4466-BB2D-3ED0D1917763}"
CommandAction="javascript: showreport();"
EnabledScript="javascript: hideButton('test'); "
/></CommandUIHandlers></CommandUIExtension></CustomAction>Also used the EnabledScript function to hide the button if the current list is not my expected list. but this javascritp code taking some time to execute and button are visible to other list for some time.
how to add the button to specific list for infopath.