Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

YSOD when trying to edit purchase order in commerce manager

Vote:
 

Hi,

we are receiving a YSOD when trying to edit a purchase order in commerce manager. Versions: CMS = 7.18.0.0 , Commerce = 8.5.0.366

We have verified against the default install of commerce manager and our appsettings and so on is the same as on a fresh install of commerce manager.

The stacktrace:

The file '/Apps/Core/MetaData/Controls/.ascx' does not exist.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The file '/Apps/Core/MetaData/Controls/.ascx' does not exist.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): The file '/Apps/Core/MetaData/Controls/.ascx' does not exist.]
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +12327668
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +203
System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) +192
System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) +164
Mediachase.Commerce.Manager.Core.MetaData.EditTab.CreateMetaControls(MetaClass metaClass, Dictionary`2 metaObjects, String defaultLanguage) +723
Mediachase.Commerce.Manager.Core.MetaData.EditTab.DataBind() +497
Mediachase.Commerce.Manager.Apps.Order.Modules.OrderMetaDataEdit.Page_Load(Object sender, EventArgs e) +16
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Control.LoadRecursive() +190
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3178

#117379
Feb 19, 2015 13:50
Vote:
 

Seems like a xml view is not configured properly.  How do you publish commerce manager.  Did you add the apps folder to the project.  Did you check if any files that were not included the project have been added.  Did you make any customizations to any view files

#117386
Feb 19, 2015 17:11
Vote:
 

Hi,

It also might be you forgot to delete the virtual directory Apps in IIS. It's required after upgrading to later version of Commerce Manager.

Regards.

/Q

#117398
Feb 20, 2015 5:15
Vote:
 

@Mark Hall, we are using standard files from the latest nuget package, only have one customization in the commerce manager files, in that is in configs/baf.fata.manager.config where we have added types for a few new meta classes for business foundation. All files from the nuget package is included in the project, the problem happens on local dev machines as well. Deployment is via xcopy or web deploy.

Could you point me the to correct file where you expect there to be issues?.

@Quan Mai, we do not have an Apps virtual directory in any environment.

#118127
Feb 27, 2015 13:20
Vote:
 

@Mark Hall and @Quan Mai, any updates to this? otherwise I will have to make a developer incident, we have a prod site crippled by this right now.

#118330
Mar 04, 2015 15:00
Vote:
 

From the stack trace it seems it cannot find the type of one of the meta fields when it tries to load the control.  You can see it has Controls\"Empty".ascx.  Can you check the meta fields on the purchase order class.  What are the types on those fields?

#118332
Mar 04, 2015 15:05
Vote:
 
#118383
Mar 05, 2015 11:39
Vote:
 

Seems field 8 is incorrect.  One is not able to choose that type from the interface when creating a metafield.  There is also no control registered for that type so it cannot render.  

#118384
Mar 05, 2015 11:48
Vote:
 

We create the meta fields in migration code through the commerce api basically. Would you suggest we change the datatype or create a control to be able to render this?

#118387
Mar 05, 2015 12:27
Vote:
 

Yes change the type or create the control.  If you want to create the control do this

In "~/Apps/Core/MetaData/Controls/" place a file called

PurchaseOrder.field8.ascx for just purchase order or field8.ascx for all classes

The ascx should be something like

<tr>  
     <td class="FormLabelCell"><asp:Label id="MetaLabelCtrl" runat="server" Text="<%$ Resources:SharedStrings, Label %>"></asp:Label>:</td> 
     <td class="FormFieldCell">
		<asp:TextBox MaxLength="255" Width="350" id="MetaValueCtrl" runat="server"></asp:TextBox><br/>
		<asp:Label CssClass="FormFieldDescription" id="MetaDescriptionCtrl" runat="server" Text="<%$ Resources:SharedStrings, Label %>"></asp:Label>      
		<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ErrorMessage="*" Display="Dynamic" ControlToValidate="MetaValueCtrl"></asp:RequiredFieldValidator>	
        <asp:RegularExpressionValidator id="RegExValidator" runat="server" ErrorMessage="The only special character allowed is dash (-)" Display="Dynamic" ControlToValidate="MetaValueCtrl" ValidationExpression="^[a-zA-Z0-9-]*$"></asp:RegularExpressionValidator>
     </td> 
   </tr>


The code behind simlar to 

public partial class MyControl : CoreBaseUserControl, IMetaControl
	{
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
		protected void Page_Load(object sender, System.EventArgs e)
		{
		}

        /// <summary>
        /// Binds a data source to the invoked server control and all its child controls.
        /// </summary>
        public override void DataBind()
        {
            BindData();
            base.DataBind();
        }
        /// <summary>
        /// Check status order create or edit
        /// </summary>
        /// <value>true is create , false is edit</value>
        public bool IsCreate { get; set; }
        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            RequiredFieldValidator1.Enabled = !MetaField.AllowNulls;
            
            

            if (MetaField.MultiLanguageValue)
                MetaLabelCtrl.Text = String.Format("{0} ({1})", MetaField.FriendlyName, LanguageCode);
            else
                MetaLabelCtrl.Text = MetaField.FriendlyName;

            var value = (MetaObject == null ? null : MetaObject[MetaField.Name]) as string;
            MetaValueCtrl.Text = value ?? string.Empty;

			MetaDescriptionCtrl.Text = MetaField.Description;
			RequiredFieldValidator1.ErrorMessage = String.Format("The {0} field is required", MetaField.FriendlyName);
		}

        

        #region IMetaControl Members

        /// <summary>
        /// Gets or sets the validation group.
        /// </summary>
        /// <value>The validation group.</value>
        public string ValidationGroup
        {
            get
            {
                return RequiredFieldValidator1.ValidationGroup;
            }
            set
            {
                RequiredFieldValidator1.ValidationGroup = value;
            }
        }

        private MetaField _MetaField;
        /// <summary>
        /// Gets or sets the meta field.
        /// </summary>
        /// <value>The meta field.</value>
        public MetaField MetaField
        {
            get
            {
                return _MetaField;
            }
            set
            {
                _MetaField = value;
            }
        }


        MetaObject _MetaObject;
        /// <summary>
        /// Gets or sets the meta object.
        /// </summary>
        /// <value>The meta object.</value>
        public MetaObject MetaObject
        {
            get
            {
                return _MetaObject;
            }
            set
            {
                _MetaObject = value;
            }
        }

        private string _LanguageCode;
        /// <summary>
        /// Gets or sets the language code.
        /// </summary>
        /// <value>The language code.</value>
        public string LanguageCode
        {
            get
            {
                return _LanguageCode;
            }
            set
            {
                _LanguageCode = value;
            }
        }

        /// <summary>
        /// Updates this instance.
        /// </summary>
        public void Update()
        {
            MetaHelper.SetMetaFieldValue(MDContext, MetaObject, MetaField.Name, new object[] { MetaValueCtrl.Text });
        }
        #endregion
    }
#118397
Edited, Mar 05, 2015 14:06
Vote:
 

@Mark Hall, I think we will change the fieldtype to a string and then parse back and forth between Guids, this should allow for easier upgrades with the commerce nuget packages which seems to include all the files in /Apps. I think that is the most optimal route going forward.

#118425
Mar 06, 2015 7:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.