Skip to main content

I have 3 actions on a custom form.  I set the IsLockedOnToolbar to true.

        public PXAction<ICSFSSSchedule> DeleteScheduleDetails;
        PXUIField(DisplayName = "Delete Schedule Details", Enabled = true, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
        >PXButton(IsLockedOnToolbar = true, Category = "Other", CommitChanges = true)]
        public void deleteScheduleDetails()
 

This was addressed in the following topic, but the solution there does not fix my issue.

All of my actions show in the title bar of the screen:

I have reset the caches, restarted the application but the menu items still show.

I want them to appear in the More (ellipse) menu.

In the project editor, the items are in the correct category.

 

Do I need to “instantiate” the More menu somehow since this is a custom form and there are no default action items?

 

 

 

I set the IsLockedOnToolbar to true.

Pretty sure this the opposite of what you want to do, although I doubt setting it to false will change anything. This is an example of an action locked to the toolbar:

 

Most of the screens that have said menu are workflow screens. You may need to implement workflow on the screen to accomplish this, although I don’t know for sure.


Hi @Joe Schmucker 

 

Try this

public class CustomGraph_Workflow : PXGraphExtension<CustomGraph>
{
public static bool IsActive() => true;
public sealed override void Configure(PXScreenConfiguration config) =>
Configure(config.GetScreenConfigurationContext<CustomGraph, CustomDac>());
protected static void Configure(WorkflowContext<CustomGraph, CustomDac> context)
{
#region Categories
var myCategory = context.Categories.CreateNew("MyCategory",
category => category.DisplayName("My Category"));
#endregion
context.AddScreenConfigurationFor(screen =>
{
return screen
.WithActions(actions =>
{
actions.Add(g => g.Action1, a => a.WithCategory(myCategory).WithDisplayOnToolbar(DisplayOnToolBar.Always));
actions.Add(g => g.Action2, a => a.WithCategory(myCategory));
actions.Add(g => g.Action3, a => a.WithCategory(myCategory));
});
});
}
}

 


Hi @taras 

Thank you for taking the time to give me that code.  I gave it a whirl.  It doesn’t seem to make anything change.  

This is the code I used after putting in my values.  I even tried making the second menu item Hidden.  Nothing changed on the screen.

    public class CustomGraph_Workflow : PXGraphExtension<FSSScheduleMaint>
{
public static bool IsActive() => false;
public sealed override void Configure(PXScreenConfiguration config) =>
Configure(config.GetScreenConfigurationContext<FSSScheduleMaint, ICSFSSSchedule>());
protected static void Configure(WorkflowContext<FSSScheduleMaint, ICSFSSSchedule> context)
{
#region Categories
var myCategory = context.Categories.CreateNew("Other",
category => category.DisplayName("Other"));
#endregion
context.AddScreenConfigurationFor(screen =>
{
return screen
.WithActions(actions =>
{
actions.Add(g => g.DeleteScheduleDetails, a => a.WithCategory(myCategory).WithDisplayOnToolbar(DisplayOnToolBar.Always));
actions.Add(g => g.ValidateCurrentSchedule, a => a.WithCategory(myCategory).WithDisplayOnToolbar(DisplayOnToolBar.Hidden));
actions.Add(g => g.ValidateSchedules, a => a.WithCategory(myCategory));
});
});
}
}

I have already delivered the project to the customer, so it is no urgent thing.  I actually just wanted to put the actions in the ellipse menu so that it looks like a regular Acumatica screen.

 

If you have any other ideas, that is great.   I truly thank you and the community for all the kind assistance you provide!


Uh…

public static bool IsActive() => false;

 


Hi @darylbowman I thought that the bool flag on locked on toolbar was backwards too.  But that is what Naveen said needed to be done on the other topic which was exactly what am trying to do.

I set IsActive = true.  It is still showing all the menu items and no ellipse.  I tried changing IsLockedOnToolbar to true and tried it with false.  That didn’t make any different as you mentioned it probably wouldn’t.


Just for kicks, restart the application from Apply Updates


@darylbowman  No joy.  😥 I reset caches too just to be sure.  I definitely have had to do that in the past when adding actions to existing screens in order to get them to “refresh” properly.  I did that a bunch of times during my efforts to get this working.

Just a side note...when you compile in VS, that usually “seems” to cause a restart on the site.  I’ve always wondered if compiling the library actually restarts the site.  It sure takes a long time to reload after a compile.  Then, after the screen finally refreshes after a compile, I don’t think that actually resets the caches either.  That’s why I have Apply Updates saved as a favorite and I locked Reset Caches on the menu.  

 


You could try this yet. Not sure if it’s necessary or not:

//...
return screen
.WithActions(actions =>
{
actions.Add(g => g.DeleteScheduleDetails, a => a.WithCategory(myCategory).WithDisplayOnToolbar(DisplayOnToolBar.Always));
actions.Add(g => g.ValidateCurrentSchedule, a => a.WithCategory(myCategory).WithDisplayOnToolbar(DisplayOnToolBar.Hidden));
actions.Add(g => g.ValidateSchedules, a => a.WithCategory(myCategory));
});
.WithCategories(categories =>
{
categories.Add(myCategory);
}
//...

 


@darylbowman No luck with that change.  If anyone wants to see my code, I will upload the Acumatica project and my VSS code.  Be aware that if you install my project, it will add tables, SQL views and custom fields.  If you unpublish it, you will have to do DB cleanup.

I am a 100% self taught programmer.  My code is pretty bad but it works.  I’ve programmed in VB since 2000 and I only started with C# and Acumatica dev in 2019.  I am also a lone ranger.  I have no one to get help from except the web and this forum.  If anyone looks at my VS code and wants to give me a code review, I would be thrilled.  I am sure I do a lot of things the “wrong way” but I can get my projects to work.  

Thanks God for you folks.  

 


Hi @Joe Schmucker The code above should be fine but for some reason workflow is not applied immediately. I have tried it in my local instance and your screen works.

 

I would suggest you to follow this instruction and check if you have any errors.

Also general suggestion is to restart IIS one more time)


@taras No luck.  Would you be able to export your project for me?  Maybe I just need to start clean.  

I should have mentioned this is on 24R1.


@darylbowman , @taras 

you guys won’t believe this.  I noticed Taras used My Category 123 for the title in the menu.

I changed mine to “Other Options” and it worked!  I changed it back to “Other” and it failed.

Maybe “Other” is reserved?  What a kick in the pants.


@Joe Schmucker you can also try approach without workflow https://asiablog.acumatica.com/2019/01/easier-way-on-adding-action-menu-in-existing-graph.html


Quick update.  I removed all changes you guys suggested and simply changed the menu title to Other Options.  I restarted IIS.  The menu now works perfectly.

Apparently, using “Other” as the category on a custom form is a bad idea.  I suppose there is some other thing that could be done to get the Other menu to show up, but Other Options works just fine.

Unbelievable.  What a waste of time for me and YOU!  

Thanks for taking the time to give me support with this.  I am so grateful for your help!

I HATE to give one person the win.  I wish there was a way to spit the win here.  Since Taras clued me in on the change to the menu category, I think I will have to give it to Taras.  Sorry @darylbowman.  😒

 


Reply