Customization - Default Values for checkbox

Because you are defining
Â
Dim edvOrder As EpiDataView = CType(oTrans. EpiDataViews( "Order"),
EpiDataView)

within your after adapter event, you need to destroy the object after setting your checkbox.
Â
Case "GetNewOrder"
Dim edvOrder As EpiDataView = CType(oTrans. EpiDataViews( "Order"),
EpiDataView)
edvOrder.dataView( 0)("SndAlrtShp" ) = true

          edvOrder = Nothing
Â
Case (some other adapter method case)
Â
Frankly, you should probably set edvOrder epiDataView as an object available to the entire module - rather than the just Sub.
Â
Rob Brown


--- On Tue, 5/20/08, howelllabs <nhutchins@...> wrote:

From: howelllabs <nhutchins@...>
Subject: [Vantage] Re: Customization - Default Values for checkbox
To: vantage@yahoogroups.com
Date: Tuesday, May 20, 2008, 4:06 PM






Hello,

I was trying this code mentioned below to set the "Alert on Shipment"
check box to true by default in Order Entry. I'm using the code below,
when I test the code it passes successfully, but when I try making a new
Order it does not check the check box. Any ideas???

FYI, this is my 1st time customizing a form using the script editor, I
might be doing something wrong......

Thanks in advance!

Norman Hutchins
Network Administrator
Howell Laboratories, Inc.

'//********* ********* ********* ********* ********* *****
'// Custom VB.NET code for PartForm
'// Created: 5/4/2007 5:55:12 AM
'//********* ********* ********* ********* ********* *****
Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows. Forms
Imports System.ComponentMod el
Imports Microsoft.VisualBas ic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI. FrameWork
Imports Epicor.Mfg.UI. ExtendedProps
Imports Epicor.Mfg.UI. FormFunctions
Imports Epicor.Mfg.UI. Customization
Imports Epicor.Mfg.UI. Adapters
Imports Epicor.Mfg.UI. Searches
Imports Epicor.Mfg.BO

Module Script
'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added
Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **

Private WithEvents oTrans_adapter As EpiBaseAdapter
'// End Wizard Added Module Level Variables **

'// Add Custom Module Level Variables Here **

Sub InitializeCustomCod e()

'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added
Variable Intialization' lines **
'// Begin Wizard Added Variable Intialization

oTrans_adapter = csm.TransAdaptersHT ("oTrans_ adapter")
'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls

'// End Custom Method Calls
End Sub

Sub DestroyCustomCode( )

'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added
Object Disposal' lines **
'// Begin Wizard Added Object Disposal

oTrans_adapter = Nothing
'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal

'// End Custom Code Disposal
End Sub

Private Sub oTrans_adapter_ AfterAdapterMeth od(ByVal sender As object,
ByVal args As AfterAdapterMethodA rgs) Handles
oTrans_adapter. AfterAdapterMeth od
'// ** Argument Properties and Uses **
'// args.MethodName
'
'Add Event Handler Code
'
'MessageBox. Show(args. MethodName) ' use this to find method

Select Case args.MethodName

Case "GetNewOrder"
Dim edvOrder As EpiDataView = CType(oTrans. EpiDataViews( "Order"),
EpiDataView)
edvOrder.dataView( 0)("SndAlrtShp" ) = true

Case Else
End Select
End Sub
End Module

--- In vantage@yahoogroups .com, "p51ace99" <p51ace99@.. .> wrote:
>
> Here's are links to the EpicWeb site that might help. I followed the
> instructions for setting the ultracombo default and it worked for
> me. Just add a "Then" to the last If statement (If
> (lastAdapterMethod = "GetNewOrderDtl" ).
>
> ------------ -----
>
> How to set the checkbox to default to true? (Answerbook # 3555ESC)
> https://epicweb. epicor.com/ ReportServer/ Pages/ReportView er.aspx?/ ePort
> al/ABDetail& rs:Command= Render&rc: Toolbar=true& Card_ID=3555ESC& Answerbo
> ok=Vantage%2fVista+ 8.0+-+General+ Information+ documents
>
> How to set the default of an ultracombo? (Answerbook # 3554ESC)
> https://epicweb. epicor.com/ ReportServer/ Pages/ReportView er.aspx?/ ePort
> al/ABDetail& rs:Command= Render&rc: Toolbar=true& Card_ID=3554ESC& Answerbo
> ok=Vantage%2fVista+ 8.0+-+General+ Information+ documents

> --- In vantage@yahoogroups .com, "Babette Welch" bwelch@ wrote:
> >
> >
> > We are preparing Vantage 8 by customizing screens.
> > We have added 'UltroCombo' , textbox, and checkBox.
> > All work well.
> >
> > How do I set the DEFAULT value for a CheckBox?
> > The 'Properties' window has the CONTROL area grayed out.
> >
> > Thanks you for any hints.
> >
> >
> > Babette Welch
> > IT Director
> > bwelch@
> > (906)226-9747 ext: 235
> > ARGONICS, INC.
> > Performance Polyurethanes

[Non-text portions of this message have been removed]
We are preparing Vantage 8 by customizing screens.
We have added 'UltroCombo', textbox, and checkBox.
All work well.

How do I set the DEFAULT value for a CheckBox?
The 'Properties' window has the CONTROL area grayed out.

Thanks you for any hints.


Babette Welch
IT Director
bwelch@...
(906)226-9747 ext: 235
ARGONICS, INC.
Performance Polyurethanes



[Non-text portions of this message have been removed]
The default value for a checkbox would depend on whether it is coming from a table or a calculated value. If all you need to do is set the values which are greyed out in the properties view, this example code customization does the trick:

Dim edvPORel as EpiDataView = CType(oTrans.EpiDataViews("PORel"), EpiDataView)
edvPORel.dataView.Table.Columns("LockQty").ExtendedProperties("Enabled") = True
This can be called in the needed method.


Unfortunately, from experience, making/changing a checkbox's default state when a form loads or does something is a wee bit tricky. You can use this code to set the state when something happens (in a method):

Dim edv As EpiDataView = CType(oTrans.EpiDataViews("PORel"), EpiDataView)
edv.dataView(edv.Row)("LockQty") = True

Thanks,
Kunal



----- Original Message ----
From: Babette Welch <bwelch@...>
To: vantage@yahoogroups.com
Sent: Thursday, May 8, 2008 10:22:51 AM
Subject: [Vantage] Customization - Default Values for checkbox



We are preparing Vantage 8 by customizing screens.
We have added 'UltroCombo' , textbox, and checkBox.
All work well.

How do I set the DEFAULT value for a CheckBox?
The 'Properties' window has the CONTROL area grayed out.

Thanks you for any hints.

Babette Welch
IT Director
bwelch@argonics. com
(906)226-9747 ext: 235
ARGONICS, INC.
Performance Polyurethanes

[Non-text portions of this message have been removed]




____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

[Non-text portions of this message have been removed]
Here's are links to the EpicWeb site that might help. I followed the
instructions for setting the ultracombo default and it worked for
me. Just add a "Then" to the last If statement (If
(lastAdapterMethod = "GetNewOrderDtl").

-----------------

How to set the checkbox to default to true? (Answerbook # 3555ESC)
https://epicweb.epicor.com/ReportServer/Pages/ReportViewer.aspx?/ePort
al/ABDetail&rs:Command=Render&rc:Toolbar=true&Card_ID=3555ESC&Answerbo
ok=Vantage%2fVista+8.0+-+General+Information+documents

How to set the default of an ultracombo? (Answerbook # 3554ESC)
https://epicweb.epicor.com/ReportServer/Pages/ReportViewer.aspx?/ePort
al/ABDetail&rs:Command=Render&rc:Toolbar=true&Card_ID=3554ESC&Answerbo
ok=Vantage%2fVista+8.0+-+General+Information+documents

--- In vantage@yahoogroups.com, "Babette Welch" <bwelch@...> wrote:
>
>
> We are preparing Vantage 8 by customizing screens.
> We have added 'UltroCombo', textbox, and checkBox.
> All work well.
>
> How do I set the DEFAULT value for a CheckBox?
> The 'Properties' window has the CONTROL area grayed out.
>
> Thanks you for any hints.
>
>
> Babette Welch
> IT Director
> bwelch@...
> (906)226-9747 ext: 235
> ARGONICS, INC.
> Performance Polyurethanes
>
>
>
> [Non-text portions of this message have been removed]
>
Hello,

I was trying this code mentioned below to set the "Alert on Shipment"
check box to true by default in Order Entry. I'm using the code below,
when I test the code it passes successfully, but when I try making a new
Order it does not check the check box. Any ideas???

FYI, this is my 1st time customizing a form using the script editor, I
might be doing something wrong......

Thanks in advance!

Norman Hutchins
Network Administrator
Howell Laboratories, Inc.

'//**************************************************
'// Custom VB.NET code for PartForm
'// Created: 5/4/2007 5:55:12 AM
'//**************************************************
Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Microsoft.VisualBasic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization
Imports Epicor.Mfg.UI.Adapters
Imports Epicor.Mfg.UI.Searches
Imports Epicor.Mfg.BO

Module Script
'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added
Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **

Private WithEvents oTrans_adapter As EpiBaseAdapter
'// End Wizard Added Module Level Variables **


'// Add Custom Module Level Variables Here **

Sub InitializeCustomCode()

'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added
Variable Intialization' lines **
'// Begin Wizard Added Variable Intialization

oTrans_adapter = csm.TransAdaptersHT("oTrans_adapter")
'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls

'// End Custom Method Calls
End Sub

Sub DestroyCustomCode()

'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added
Object Disposal' lines **
'// Begin Wizard Added Object Disposal

oTrans_adapter = Nothing
'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal

'// End Custom Code Disposal
End Sub

Private Sub oTrans_adapter_AfterAdapterMethod(ByVal sender As object,
ByVal args As AfterAdapterMethodArgs) Handles
oTrans_adapter.AfterAdapterMethod
'// ** Argument Properties and Uses **
'// args.MethodName
'
'Add Event Handler Code
'
'MessageBox.Show(args.MethodName) ' use this to find method

Select Case args.MethodName

Case "GetNewOrder"
Dim edvOrder As EpiDataView = CType(oTrans.EpiDataViews("Order"),
EpiDataView)
edvOrder.dataView(0)("SndAlrtShp") = true

Case Else
End Select
End Sub
End Module

--- In vantage@yahoogroups.com, "p51ace99" <p51ace99@...> wrote:
>
> Here's are links to the EpicWeb site that might help. I followed the
> instructions for setting the ultracombo default and it worked for
> me. Just add a "Then" to the last If statement (If
> (lastAdapterMethod = "GetNewOrderDtl").
>
> -----------------
>
> How to set the checkbox to default to true? (Answerbook # 3555ESC)
> https://epicweb.epicor.com/ReportServer/Pages/ReportViewer.aspx?/ePort
> al/ABDetail&rs:Command=Render&rc:Toolbar=true&Card_ID=3555ESC&Answerbo
> ok=Vantage%2fVista+8.0+-+General+Information+documents
>
> How to set the default of an ultracombo? (Answerbook # 3554ESC)
> https://epicweb.epicor.com/ReportServer/Pages/ReportViewer.aspx?/ePort
> al/ABDetail&rs:Command=Render&rc:Toolbar=true&Card_ID=3554ESC&Answerbo
> ok=Vantage%2fVista+8.0+-+General+Information+documents


> --- In vantage@yahoogroups.com, "Babette Welch" bwelch@ wrote:
> >
> >
> > We are preparing Vantage 8 by customizing screens.
> > We have added 'UltroCombo', textbox, and checkBox.
> > All work well.
> >
> > How do I set the DEFAULT value for a CheckBox?
> > The 'Properties' window has the CONTROL area grayed out.
> >
> > Thanks you for any hints.
> >
> >
> > Babette Welch
> > IT Director
> > bwelch@
> > (906)226-9747 ext: 235
> > ARGONICS, INC.
> > Performance Polyurethanes



[Non-text portions of this message have been removed]