Thanks Don,
I got it working! Hit the new button, and both columns populate as needed. Thank you for the nudge in the right direction.
Final Code below:
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 **
EpiDataView edvRMAdtl;
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
this.epiButtonC1.Click += new System.EventHandler(this.epiButtonC1_Click);
this.edvRMAdtl = ((EpiDataView)(this.oTrans.EpiDataViews["RMADtl"]));
// End Wizard Added Custom Method Calls
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
this.epiButtonC1.Click -= new System.EventHandler(this.epiButtonC1_Click);
this.edvRMAdtl = null;
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void epiButtonC1_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
foreach(DataRow row in edvRMAdtl.dataView.Table.Rows)
{
row["CheckBox01"] = true;
row["Number02"] = row["ReturnQty"];
}
}
}
---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:Sorry, one more thing... it should be RMADtl not RMAdtl. Its case sensitive.
---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:You'll also want to probably throw an
oTrans.Update();
and an
oTrans.Refresh();
when the code is done to save and then refresh the dataview with the current information.
---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:First you would probably want to use the event wizard to start the script for "click" of the button you created
//This will access the dataview of the RMAdtl's
EpiDataView edvRMAdtl = (EpiDataView)oTrans.EpiDataViews["RMAdtl"];
//This will write the check to true.edvRMAdtl.dataView[edvRMAdtl.Row]["CheckBox01"] = true;//Since you are probably writing to multiple lines you'll have to setup a for each dtl row where you would replace the row value where edvRMAdtl.Row is.You should be able to manipulate this code into the other fields that you need.Good luck!
---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:First of all, lemme say that I don't like this new Yahoo! Group format. How do you search past posts?!?!?
Ok, on with the topic at hand. I am attempting my first c# customization, and I am not sure exactly where to begin. Here is what I need:
I have added a button to my RMA Processing screen. When you click the button, I want it to populate 2 columns in the 'Details' grid below. One column is a check box(RMADtl.Checkbox01) that I am going to mark 'true' and the other is a number column(RMADtl.Number02) that I am going to populate with the RMADTL.ReturnQty.
I don't think it would be hard, but just not sure where to begin. Anyone have any hints?
Thank you, in advance!
--Matt Caldwell