I set the button to become enabled when OrderDtl was initialized/added/changed using the Form Event Wizard.
The only thing I didn't do was set it to become read only again when the clear function is called.
The only thing I didn't do was set it to become read only again when the clear function is called.
--- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@...> wrote:
>
> Just out of curiousity, what were the tweaks?
>
> Calvin
>
>
>
> --- In vantage@yahoogroups.com, "Ian" <ianwhardy@> wrote:
> >
> > With a few tweaks, it works beautifully.
> >
> > Thanks for your help guys.
> >
> >
> > --- In vantage@yahoogroups.com, "Ian" <ianwhardy@> wrote:
> > >
> > > Thanks Calvin. I'll give it a shot and Let you know how it goes.
> > >
> > >
> > >
> > > --- In vantage@yahoogroups.com, "c.krusen1" <ckrusen1@> wrote:
> > > >
> > > >
> > > > It's been a while since I did a customization, so the following is just
> > > > an overview.
> > > >
> > > > * Open the customization
> > > > * Add btnSpecial.enabled = FALSE to the forms SalesOrderForm_Load
> > > > function. (Obviously the name of your button probably isn't
> > > > "btnSpecial".)
> > > > * Add btnSpecial.enabled = TRUE to the forms OrderDtl_AfterRowChange
> > > > function. If there isn't a OrderDtl_AfterRowChange function, you'll
> > > > have to create it with the Form Event Wizard.
> > > >
> > > > This basically just makes the form start with the special button
> > > > disabled and then enables it when ever you switch between order lines.
> > > >
> > > > It's far from bullet proof, and has the following limits (and probably
> > > > more):
> > > >
> > > > * It does not disable the button if all order lines have been
> > > > deleted.
> > > > * It also might not enable the button if you order only has one line.
> > > > The work around might be to add a new line, then just delete.
> > > > * The button may stay disabled when opening an existing Order, even
> > > > with multiple lines. The work around might be to jump to a different
> > > > order line, or use the above mentioned add/delete.
> > > >
> > > > Obviously a robust implementation would check for existing lines (when
> > > > opening, adding lines, or deleting lines), and set the button's enabled
> > > > property accordingly.
> > > >
> > > > And for heavens sake, make a backup of the customization before you
> > > > start messing with it. I've learned the hard way.
> > > >
> > > > Calvin
> > > >
> > > >
> > > > --- In vantage@yahoogroups.com, "Ian" <ianwhardy@> wrote:
> > > > >
> > > > > Good idea, how would I go about this?
> > > > >
> > > > > --- In vantage@yahoogroups.com, "c.krusen1" ckrusen1@ wrote:
> > > > > >
> > > > > > Would it be easier to have the custom buttom disabled, and then only
> > > > enable it after a Order Line has been created?
> > > > > >
> > > > > > Calvin
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, Waffqle <waffqle@> wrote:
> > > > > > >
> > > > > > > If I'm following you right, you just want to check for the
> > > > existence of
> > > > > > > lines when a button is clicked. That is much easier.
> > > > > > > All you really need to do is add the button to the form and create
> > > > on 'on
> > > > > > > click' event using the wizard. (I'm assuming your familiar with
> > > > this
> > > > > > > process, if not let me know.)
> > > > > > >
> > > > > > > The code that goes behind the button should look something like
> > > > this:
> > > > > > >
> > > > > > > SalesOrderAdapter salesOrderAdapter = (SalesOrderAdapter)
> > > > > > > csm.TransAdaptersHT["oTrans_adapter"];if
> > > > > > > (salesOrderAdapter.salesOrderData.OrderDtl.Count < 1)
> > > > > > > {
> > > > > > > // Oh no! We don't have any lines! // Let's do some stuff!}
> > > > > > >
> > > > > > > That basically just gets an instance of the order adapter and then
> > > > > > > looks to see how many rows there are.
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Aug 25, 2011 at 8:32 AM, Ian <ianwhardy@> wrote:
> > > > > > >
> > > > > > > > **
> > > > > > > >
> > > > > > > >
> > > > > > > > I thought that too. However, I have slightly changed what I want
> > > > to do, and
> > > > > > > > I want it to fire when the user clicks on a custom button.
> > > > > > > >
> > > > > > > > Would you have an idea where I should start?
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com, Waffqle <waffqle@> wrote:
> > > > > > > > >
> > > > > > > > > You will likely need to write some code on the screen.
> > > > Something that
> > > > > > > > fires
> > > > > > > > > when the user tries to close the order or the form.
> > > > > > > > > What you're doing is a bit trickier than you might expect as
> > > > Epicor
> > > > > > > > requires
> > > > > > > > > that an order be saved before lines can be added.
> > > > > > > > >
> > > > > > > > > On Thu, Aug 25, 2011 at 5:30 AM, Ian <ianwhardy@> wrote:
> > > > > > > > >
> > > > > > > > > > **
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Morning All,
> > > > > > > > > >
> > > > > > > > > > I am trying to raise an exception on sales orders when the
> > > > user hasn't
> > > > > > > > > > entered a sales order line before they save.
> > > > > > > > > >
> > > > > > > > > > Can this be done via a BPM, or will it be coding?
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > *Waffqle Driggers*
> > > > > > > > > *High End Dev, System Design, Profit Drinking
> > > > > > > > > *
> > > > > > > > > *:: 904.962.2887*
> > > > > > > > > *:: waffqle@*
> > > > > > > > > *:: NO FAXES*
> > > > > > > > >
> > > > > > > > > *
> > > > > > > > >
> > > > > > > > > *
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > [Non-text portions of this message have been removed]
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > *Waffqle Driggers*
> > > > > > > *High End Dev, System Design, Profit Drinking
> > > > > > > *
> > > > > > > *:: 904.962.2887*
> > > > > > > *:: waffqle@*
> > > > > > > *:: NO FAXES*
> > > > > > >
> > > > > > > *
> > > > > > >
> > > > > > > *
> > > > > > >
> > > > > > >
> > > > > > > [Non-text portions of this message have been removed]
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> >
>