I am Unable to Open Cash Sale Screen in Customization Editor of Acumatica, after I have added a new tab control with a Grid inside. I have assigned a custom DataView in the data member property of the Grid Control.
It Gives up the following error "The Customization Project Must Be Published before the screen can be edited. Error : The View CommissionCalcView does not exist".
Here "CommissionCalcView" is the name of my custom view, and it is Present in ARCashSaleEntry Extension of my project.
My Code Goes here....
using COMMISSIONMAPPING;
using PX.Objects.AR.Standalone;
namespace PX.Objects.AR
{
public class ARCashSaleEntry_Extension : PXGraphExtension<ARCashSaleEntry>
{
public PXSelect<CommissionCalculation,
Where<CommissionCalculation.cashSaleDocType,
Equal<ARCashSale.docType>,
And<CommissionCalculation.cashSaleRefNbr,
Equal<ARCashSale.refNbr>>>> CommissionCalcView;
#region Event Handlers
#endregion
}
}
Error Image
I have experienced this many times as well. The problem for me tends to be an error in how I define fields in a DAC extension or in improperly defining the view in the form.
In this case, you have BQL that is trying to compare CommissionCalculation (table selected in the BQL) to ARCashSale (table not selected in the BQL). Try adding Current<> on the ARCashSale references in the view so that it pulls the current value from the cache for ARCashSale in the base graph.
using COMMISSIONMAPPING;
using PX.Objects.AR.Standalone;
namespace PX.Objects.AR
{
public class ARCashSaleEntry_Extension : PXGraphExtension<ARCashSaleEntry>
{
public PXSelect<CommissionCalculation,
Where<CommissionCalculation.cashSaleDocType,
Equal<Current<ARCashSale.docType>>,
And<CommissionCalculation.cashSaleRefNbr,
Equal<Current<ARCashSale.refNbr>>>>> CommissionCalcView;
#region Event Handlers
#endregion
}
}
This was an issue with the development process and missing dlls, i removed the dll from the bin folder of my website and removed any key fields from my DAC, and rebuilt the project,
The problem was resolved
I'm sure this is a simple solution, but I am just learning a lot of this and also and not a developer. Know enough to get lost. Apologies for the newb question and thanks for the help ahead of time.
I am creating custom fields that are visible and editable on the BAccount form but don't want to show the fields in that column if the BAccount type isn't Customer.
Any guidance would be great.
Navigate to Business Accounts page CR303000. Use the Inspect Element feature in customization menu (top right) to find out the name of that screen graph (aka BLC/business logic controller) and the customer type field:
In Acumatica Customization Project Editor create a BusinessAccountMaint graph extension for that screen or use the shortcut from inspect element to create it:
In the graph extension you can put the logic to hide the custom fields when BAccount type is different than customer. By convention RowSelected is an appropriate event handler for those type of visibility validations:
using PX.Data;
namespace PX.Objects.CR
{
public class BusinessAccountMaint_Extension : PXGraphExtension<BusinessAccountMaint>
{
public void BAccount_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
BAccount account = e.Row as BAccount;
if (account != null)
{
PXUIFieldAttribute.SetVisible<BAccount.status>(sender, account, account.Type == BAccountType.CustomerType);
}
}
}
}
Consider following T100 training which is about making simple customizations: https://openuni.acumatica.com/courses/development/t100-introduction-to-acumatica-framework/
I'm showing a custom task pane in an excel VSTO add-in, I'm building it and showing it as thus:
var ctrl = new CellTaskPane();
var pane = CustomTaskPanes.Add(ctrl, "Custom Sheet");
pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
pane.Visible = true;
This is being done in the ThisAddin.cs file and it working just fine on my machine, both under a Debug session and with the add-in installed via the click-once installer.
However, installing the add-in on a colleague's machine is proving troublesome.
The add-in is functioning and the context menu / ribbon is working perfectly, but the pane just refuses to show.
I have a toggle button on the ribbon which toggles the Visible property on the pane and even clicking that isn't forcing the pane to show.
Any help on this would be greatly appreciated, Google is proving useless for this.
Thanks.
I should mention that CellTaskPane is just a UserControl as per the docs on MSDN: http://msdn.microsoft.com/en-us/library/aa942846.aspx
Turns out it wasn't anything we were doing directly!
There was another add-in installed (third party) which for some bizarre reason was interfering with the pane being shown (no idea why or how).
Shame that Excel doesn't show any sort of error or at least throw an exception.
Ah well.
I suggest you try a very, very simple custom task pane first to see if this works. I put together the most simple example I could think of, basically a single text box that gets a value pushed into it and this is returned to the ribbon when a button is pushed.
If you were to try this then I would do it as a new solution. Create a new VSTO project with a "Designer mode" ribbon. Add a toggle button and a normal button below it. Then copy in this code:
ThisAddIn.cs
using System;
using Office = Microsoft.Office.Core;
namespace ExcelAddIn1
{
public partial class ThisAddIn
{
private Microsoft.Office.Tools.CustomTaskPane pane;
private CellTaskPane ctrl = new CellTaskPane();
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
pane = CustomTaskPanes.Add(ctrl, "Custom Sheet");
pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
pane.Visible = true;
pane.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
ctrl.SetName("test");
}
private void taskPaneValue_VisibleChanged(object sender, System.EventArgs e)
{
Globals.Ribbons.Ribbon1.toggleButton1.Checked = pane.Visible;
}
public Microsoft.Office.Tools.CustomTaskPane TaskPane
{
get
{
return pane;
}
}
public CellTaskPane MyContainer
{
get
{
return ctrl;
}
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
Add a new class called CellTaskPane.cs:
using System;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
namespace ExcelAddIn1
{
public class CellTaskPane : System.Windows.Forms.UserControl
{
public System.Windows.Forms.TextBox test;
public CellTaskPane()
{
InitializeComponent();
}
public void InitializeComponent()
{
test = new System.Windows.Forms.TextBox();
test.Location = new System.Drawing.Point(120, 8);
test.Size = new System.Drawing.Size(232, 20);
test.TabIndex = 0;
Controls.AddRange(new System.Windows.Forms.Control[] { test });
Size = new System.Drawing.Size(375, 150);
}
public void SetName(string text)
{
test.Text = text;
}
public string GetName()
{
return test.Text;
}
}
}
Add the following code to Ribbon1.cs:
using System;
using Microsoft.Office.Tools.Ribbon;
namespace ExcelAddIn1
{
public partial class Ribbon1
{
private void toggleButton1_Click(object sender, RibbonControlEventArgs e)
{
Globals.ThisAddIn.TaskPane.Visible = ((RibbonToggleButton)sender).Checked;
}
private void button1_Click(object sender, RibbonControlEventArgs e)
{
button1.Label = Globals.ThisAddIn.MyContainer.GetName();
}
}
}
Obviously you will need to do a little tweaking to get this to work, I tried to take the default names for a new project and the buttons.
When you run this you should get a custom task pane. When you switch to the "TabAddIn" and click the toggle button it should show/ hide the task pane. When you click the normal button the contents of the only field in the task pane should be copied as the button name. I defaulted this to "test", so even if the task pane isn't visible you can see if it is in memory or not?
I tested this and it appears to work fine. Basically this is just a hacked up version of the examples on MSDN. If you wanted you could probably do this yourself anyway? If nothing else this will enable you to see if there is anything in the more complex ribbon you are working on that causes issues... or if this is a fundamental problem with your colleague's machine.
I had the same problem, but it was not any addin I could disable (COM+ or Excel).
I had my excel configured to open files at startup
(Excel Options -> Advanced -> General)
There, I had an .XLAM that customized the ribbon.
When I cleared this configuration, my addin started working.
I ran into exactly this problem while trying to get the Microsoft sample code for "Walkthrough: Synchronizing a Custom Task Pane with a Ribbon Button" working. Here's a link to the page:
http://msdn.microsoft.com/en-us/library/bb608590.aspx
After starting from scratch about three times and scouring the Internet for a clue as to what I might have been doing wrong, I came across this question and Clint's answer that an add-in was causing his problem. I had a few add-ins enabled, but with some trial and error I found the culprit: Microsoft's own "Analysis Toolpack"!
Once I disabled Analysis Toolpack, the custom pane started appearing and disappearing as expected.
So, as Clint discovered, the first thing you should probably try if you run into this issue is to disable all add-ins and see if that does the trick. If so, then you can go back and begin turning them on until you find the one that is interfering with your custom pane visibility.
Well, after following #GaryP's advice, disabling my other add-ins, and thinking that I'd solved the problem (albeit without access to my other add-ins), I discovered that the add-in would disappear whenever I opened more than one workbook.
But at that point, I didn't just get a missing taskpane or a silent fail, I actually got an error:
The taskpane has been deleted or is otherwise no longer valid
So it seems that disabling add-ins isn't solving the problem in itself, but rather disabling add-ins is reducing the number of open workbooks (even if add-ins aren't visible, they can still have a Ribbon handle)...
The underlying cause is the use of SDI in 2013 and later.
So, now I can have all of my add-ins loaded.
Create a new instance of the task pane for each workbook. Make the following changes to your code and the task pane works even with addins enabled.
private void Application_WorkbookActivate(Microsoft.Office.Interop.Excel.Workbook wb)
{
pane = CustomTaskPanes.Add(ctrl, "Custom Sheet");
pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight;
pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange;
pane.Visible = true;
pane.VisibleChanged += new EventHandler(taskPaneValue_VisibleChanged);
ctrl.SetName("test");
}
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.WorkbookActivate += new Excel.AppEvents_WorkbookActivateEventHandler(
Application_WorkbookActivate);
}
If you find that even after closing all other add-ins, the TaskPane still doesn't show, it may be because it is loaded in your "Personal.xlsb" workbook. After closing it, I tried making the pane visible again and I received an error that it had been closed.
I had the same problem and didn't fix it by disableing the analysis toolpack, but, rather i had to move the XLAM out of its installed folder (Break the reference to it, since you couldn't remove it through Excel) and it started working.
I've sense added the files back and it continues to work. Activating the addin does cause my custom taskbar to break. Not sure what this long term fix is here.
I know this is very old, but it can be useful for anyone who may look up for an answer, but here we go:
if you are adding the new taskpane under ThisAddIn_Startup, it will only add it once at the start of the excel, and it will not be present for any other Excel session, so based on the following link that shows how to handle multiple sessions:
https://learn.microsoft.com/en-us/previous-versions/office/developer/office-2007/bb264456(v=office.12)?redirectedfrom=MSDN#Anchor_2
I came up with the conclusion that I should create a new taskpane under the other events that can fire when I needed the taskpane, then validate if the current window has the taskpane or not, and create a new one if not and show it. the event can be any trigger like ribbon button, open document, etc.
Dim CurrentTaskPane As Microsoft.Office.Tools.CustomTaskPane = Nothing
Globals.ThisAddIn.RemoveOrphanedTaskPanes() 'to remove any unused taskpane
For Each ctp As Microsoft.Office.Tools.CustomTaskPane In Globals.ThisAddIn.CustomTaskPanes
If ctp.Window.Hwnd = Excel.Application.ActiveWindow.Hwnd Then
CurrentTaskPane = ctp
Exit For
End If
Next
If CurrentTaskPane Is Nothing Then
CurrentTaskPane = Globals.ThisAddIn.CustomTaskPanes.Add(New ControlName, "My TaskPane", Excel.Application.ActiveWindow)
End If
CurrentTaskPane.Visible = True
You can find the 'RemoveOrphanedTaskPanes' code from the link provided.
Summarizing other answers: It appears that this is due to loading other Add-ins, .XLAM files, etc. These can be loaded from many different places, and you need to check them all, and remove them. You may be able to reenable them later, so back everything up. Here is a checklist:
File -> Options -> Advanced -> General -> "At startup, open all files in..." Remove those files and disable the option.
File -> Options -> Add-ins -> Check all the Active application add-ins. Near the bottom of the dialog, use the Mange: Excel/Com Add-ins to view the Add-ins and disable or remove them. Even the Microsoft included ones could be causing it, so disable them as well. They do not allow you to remove them, which is fine, as long as they are disabled.
C:\Users\$USERNAME\AppData\Roaming\Microsoft\Excel\XLSTART Remove all files from this directory.
C:\Users\$USERNAME\AppData\Roaming\Microsoft\AddIns Remove all files from this directory.
After this, try again to load the Add-In. Then, add back the things you need one by one and keep testing. They may break it again, or not, there does not appear to be consensus on what kind of Add-In does and does not break the task pane.
If anyone discovers more places to look for Add-Ins, I will add them to the list.
We're using MVVMCross within our application and I've come up against something that I'm not sure I've solved in the best way possible.
One of our ViewModels contains 3 other view models - a dashboard and 2 lists. In iOS this is presented using a MvxTabBarViewController which works great. Android and WP present this view in a similar manner. An example of the object model is below:
public class ProjectViewModel : MvxViewModel
{
public DashboardViewModel Dashboard {get;set;}
public FirstListViewModel FirstList {get;set;}
public SecondListViewModel SecondList {get;set;}
}
We're now in the situation where if a certain action happens within the DashboardViewModel we would like to instruct the navigation to change the tab in iOS and the same thing to happen on the other platforms.
The only way I've been able to get the tab to change on iOS is to use this.SelectedIndex = 1; from within the iOS ProjectView.
At the moment also the only way I've managed to trigger this change is to fire an event from the DashboardViewModel and then the ProjectViewModel subscribes to this and fires another event which is subscribed to by the ProjectView to instruct it to change the tab in whatever device specific way it needs to. I can't help but think there is a better way to do this.
I've tried taking a look at a custom ViewPresenter for iOS and calling ShowViewModel FirstListViewModel from within the DashboardViewModel but the presenter doesn't appear to be getting used so we just transition normally. My idea was I could get in the middle, cancel the navigation request and then flip the active tab on the ProjectView.
Any suggestions would be appreciated on how we could do this in a better cross platform way using MVVMCross to handle the change if at all possible.
You should be able to do this in any of several ways:
using a custom presenter with overridden Show as you suggest
using a custom presenter with overridden ChangePresentation - and using a custom hint
using a custom binding or a binding to a property within the ProjectView to drive the transition
using a custom IMvxInteraction property
using a custom event from VM to View
using a messenger to send a message from the ViewModels to the Views.
Ultimately lots of these could work and which of these I might choose would depend on which one worked and which one the team are happy with - shipping the working app is always the ultimate goal.
Given where I am with MvvmCross experience, I'd probably opt today for trying the approach of trying a custom IMvxInteraction property. But this might not be for everyone... it certainly might be overkill for this sample...
However, to do this, I would try:
add a public enum Display { Dash, First, Second } to the Core project
add a ProjectViewModel property:
private MvxInteraction<Display> _display = new MvxInteraction< Display >();
public IMvxInteraction<Display> DisplayChange { get { return _display; } }
whenever this ViewModel wants to fire the change it can fire it using e.g. _display.Raise(Display.First)
the ProjectView could then bind Display to its own property which might be implemented like:
private IDisposable _subscription;
private IMvxInteraction<Display> _displayInteraction;
public IMvxInteraction<Display> ChangeDisplay
{
get { return _displayInteraction; }
set
{
if (_subscription != null)
{
_subscription.Dispose();
_subscription = null;
}
_displayInteraction = value;
if (_displayInteraction != null)
{
_subscription = _displayInteraction.WeakSubscribe(DoDisplayChange);
}
}
}
private void DoDisplayChange(Display which)
{
// change the tab display here
}
the binding would be added in ViewDidLoad like:
set.Bind(this).For(v => v.ChangeDisplay).To(vm => vm.DisplayChange);
I am trying to create an Entry page, and one of the options is to select an Item. the list can go more than a 1000 and it makes sense to show the search enabled page where the items are listed.
When the user clicks the "select item" from the Edit / create screen, I can pass the navigation parameter to that screen, and on selecting the item i can do a Frame.GoBack(). However, i cant pass any parameter back to the page. Is there a better way to do this?
At the moment I am thinking of using Global variables to store this data :(
Have you tried looking at the LayoutAwarePage.cs class in the Common folder and looking into the:
protected virtual void GoBack(object sender, RoutedEventArgs e)
{
if ((base.get_Frame() != null) && base.get_Frame().get_CanGoBack())
{
base.get_Frame().GoBack();
}
}
to see if you can pass an object?