Dear experts, In Journal Entry form GroupID is autogenerated & set as ReadOnly. After generating web form, ReadOnly property is not working in EWA.
Could you please suggest how to resolve this issue?
Dear experts, In Journal Entry form GroupID is autogenerated & set as ReadOnly. After generating web form, ReadOnly property is not working in EWA.
Could you please suggest how to resolve this issue?
How did you set it as Readonly? Can you share your code.
On the top of my head I can recommend:
I have used below mentioned code
// **************************************************
// Custom code for GLJournalEntryForm
// Created: 6/6/2018 10:59:36 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.Adapters;
using Erp.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
public class Script
{
public void InitializeCustomCode()
{
SetExtendedProperties();
}
public void DestroyCustomCode()
{
}
private void SetExtendedProperties()
{
EpiDataView edvGroup = ((EpiDataView)(this.oTrans.EpiDataViews["Group"]));
if (edvGroup.dataView.Table.Columns.Contains("GroupID"))
{
edvGroup.dataView.Table.Columns["GroupID"].ExtendedProperties["ReadOnly"] = true;
}
}
}
I see in the oTrans Code that GLJournalEntry has a RowRule
Perhaps it is overwriting the Extended Property, try using a RowRule instead, using the Wizards on the Script Editor.
Edit:
Epicor Web Access handles Row Rules and Extended Properties in a different way the smart client framework code does.
In EWA, the EpiControl.RefreshProperties function found EpiControls.js file checks the row rules and sets the properties on these fields when a control is bound to data. This file is located in the script folder of the EWA site.
– EWA Guide (Code Patterns Section)
I guess in for it to work well in EWA you should use RowRules.