C# Customization: Defaulting Checkbox to True on Tracker

Thanks Ted!

Worked perfectly.  

Hello, 


I've been trying to do this all morning and I keep having an issue with :


CS0103 the name checkBox does not exist in the current context


Which I thought was bizarre.  Basically, on Form_Load I want a checkbox to default to True.


my custom code is:


private void MainController_Load(object sender, EventArgs args)

{

// Add Event Handler Code

epiCashHeadPosted = (Epicor.Mfg.UI.FrameWork.EpiCheckBox)csm.GetNativeControlReference("ef684526-fd74-4723-bc77-241ff775cf45");

epiCashHeadPosted = true;

}


So I'm guessing I'm missing a declaration somewhere but being a C# novice I'm a bit lost.


THanks for any advice.




You aren't setting the Checked property of the checkbox.

epiCashHeadPosted.Checked = true;



From: "jockthemotie@... [vantage]" <vantage@yahoogroups.com>
To: vantage@yahoogroups.com
Sent: Friday, February 19, 2016 11:37 AM
Subject: [Vantage] C# Customization: Defaulting Checkbox to True on Tracker



Hello, 

I've been trying to do this all morning and I keep having an issue with :

CS0103 the name checkBox does not exist in the current context

Which I thought was bizarre.  Basically, on Form_Load I want a checkbox to default to True.

my custom code is:

private void MainController_Load(object sender, EventArgs args)
{
// Add Event Handler Code
epiCashHeadPosted = (Epicor.Mfg.UI.FrameWork.EpiCheckBox)csm.GetNativeControlReference("ef684526-fd74-4723-bc77-241ff775cf45");
epiCashHeadPosted = true;
}

So I'm guessing I'm missing a declaration somewhere but being a C# novice I'm a bit lost.

THanks for any advice.







Oop, thanks.

However, I still get the same error:

Error: CS0103 - line 55 (130) - The name 'epiCashHeadPosted' does not exist in the current context
 Error: CS0103 - line 56 (131) - The name 'epiCashHeadPosted' does not exist in the current context

private void MainController_Load(object sender, EventArgs args)
{
// Add Event Handler Code
epiCashHeadPosted = (Epicor.Mfg.UI.FrameWork.EpiCheckBox)csm.GetNativeControlReference("ef684526-fd74-4723-bc77-241ff775cf45");
epiCashHeadPosted.Checked = true;
}


This is how you would declare and initialize epiCashHeadPosted.

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

    // End Wizard Added Module Level Variables **

    // Add Custom Module Level Variables Here **
    private EpiCheckBox epiCashHeadPosted;

    public void InitializeCustomCode()
    {
        // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
        // Begin Wizard Added Variable Initialization

        // End Wizard Added Variable Initialization

        // Begin Wizard Added Custom Method Calls

        // End Wizard Added Custom Method Calls
        epiCashHeadPosted = (EpiCheckBox)csm.GetNativeControlReference("ef684526-fd74-4723-bc77-241ff775cf45");
    }

    public void DestroyCustomCode()
    {
        // ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
        // Begin Wizard Added Object Disposal

        // End Wizard Added Object Disposal

        // Begin Custom Code Disposal

        // End Custom Code Disposal
        epiCashHeadPosted = null;
    }
}




From: "jockthemotie@... [vantage]" <vantage@yahoogroups.com>
To: vantage@yahoogroups.com
Sent: Friday, February 19, 2016 11:52 AM
Subject: Re: [Vantage] C# Customization: Defaulting Checkbox to True on Tracker

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950 --

#ygrps-yiv-103945846yiv6329426950 .ygrps-yiv-103945846yiv6329426950ygrp-photo-title{
clear:both;font-size:smaller;height:15px;overflow:hidden;text-align:center;width:75px;}
#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950ygrp-photo{
background-position:center;background-repeat:no-repeat;background-color:white;border:1px solid black;height:62px;width:62px;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950photo-title
a,
#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950photo-title a:active,
#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950photo-title a:hover,
#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950photo-title a:visited {
text-decoration:none;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950attach-table div.ygrps-yiv-103945846yiv6329426950attach-row {
clear:both;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950attach-table div.ygrps-yiv-103945846yiv6329426950attach-row div {
float:left;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 p {
clear:both;padding:15px 0 3px 0;overflow:hidden;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950ygrp-file {
width:30px;}
#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950attach-table div.ygrps-yiv-103945846yiv6329426950attach-row div div a {
text-decoration:none;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950attach-table div.ygrps-yiv-103945846yiv6329426950attach-row div div span {
font-weight:normal;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 div.ygrps-yiv-103945846yiv6329426950ygrp-file-title {
font-weight:bold;}
#ygrps-yiv-103945846
#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950
#ygrps-yiv-103945846yiv6329426950ygrp-mkp {
border:1px solid #d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950ygrp-mkp hr {
border:1px solid #d8d8d8;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950ygrp-mkp #ygrps-yiv-103945846yiv6329426950hd {
color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 0;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950ygrp-mkp #ygrps-yiv-103945846yiv6329426950ads {
margin-bottom:10px;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950ygrp-mkp .ygrps-yiv-103945846yiv6329426950ad {
padding:0 0;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950ygrp-mkp .ygrps-yiv-103945846yiv6329426950ad p {
margin:0;}

#ygrps-yiv-103945846 #ygrps-yiv-103945846yiv6329426950 #ygrps-yiv-103945846yiv6329426950ygrp-mkp .ygrps-yiv-103945846yiv6329426950ad a {
color:#0000ff;text-decoration:none;}
#ygrps-yiv-103945846



Oop, thanks.


However, I still get the same error:

Error: CS0103 - line 55 (130) - The name ‘epiCashHeadPosted’ does not exist in the current context
 Error: CS0103 - line 56 (131) - The name ‘epiCashHeadPosted’ does not exist in the current context

private void MainController_Load(object sender, EventArgs args)
{
// Add Event Handler Code
epiCashHeadPosted = (Epicor.Mfg.UI.FrameWork.EpiCheckBox)csm.GetNativeControlReference(“ef684526-fd74-4723-bc77-241ff775cf45”);
epiCashHeadPosted.Checked = true;
}