BPM in Transfer Order Entry

I forgot the DateTime.Parse..



 DateTime needDate = DateTime.Parse (edvOrderHed.dataView[0]["NeedByDate"].ToString());

 DateTime shipDate= DateTime.Parse (edvOrderHed.dataView[0]["ShipByDate"].ToString());




---In vantage@yahoogroups.com, <don.n.doan@...> wrote:

Here's the code i use for plugging projectID into sales orders.. I modified it for dates but it isn't tested. Make sure to use the wizard to create the beforeadaptermethod.



  private void oTrans_ordAdapter_BeforeAdapterMethod(object sender, BeforeAdapterMethodArgs args)

{

// ** Argument Properties and Uses **

// ** args.MethodName **

// ** Add Event Handler Code **


// ** Use MessageBox to find adapter method name

// EpiMessageBox.Show(args.MethodName)

switch (args.MethodName)

{

case "Update":

EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));

EpiDataView edvOrderHed = ((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"]));

if (edvOrderDtl.dataView.Count != 0)

{

DateTime needDate = edvOrderHed.dataView[0]["NeedByDate"].ToString();

DateTime shipDate = edvOrderHed.dataView[0]["ShipByDate"].ToString();

if (needDate != "")

{

for(int i = 0; i < edvOrderDtl.dataView.Count; i++) 

{

edvOrderDtl.dataView[i]["NeedByDate"] = needDate;

edvOrderDtl.dataView[i]["ShipByDate"] = shipDate;

}

}

}

break;

}


}


Let me know how it works out.


---In vantage@yahoogroups.com, <clederer@...> wrote:

Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to the date that is entered in the previous line.

Ideally, I'd like to have the code say, "set table.date to previous line table.date" but I'm not sure how to say it
Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to date that is entered in the order number.

The point of this is so that for each additional line entered for that order number, the dates default to the same date. It gets redundant for employees to enter the same dates 10 times per order.

 Are you more familiar with BPMs or VB/C#?



---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:

Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to date that is entered in the order number.

The point of this is so that for each additional line entered for that order number, the dates default to the same date. It gets redundant for employees to enter the same dates 10 times per order.
C#

--- In vantage@yahoogroups.com, <don.n.doan@...> wrote:
>
> Are you more familiar with BPMs or VB/C#?
>
>
> ---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:
>
> Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to date that is entered in the order number.
>
> The point of this is so that for each additional line entered for that order number, the dates default to the same date. It gets redundant for employees to enter the same dates 10 times per order.
>

 I'm not completely sure of what version you are on but on 607+ from my experience dates automatically pull from the need by/ship by dates when creating a new order line.  I had to create a script that put in project IDs on each line if an additional line was created on that order. 


That should apply to what you want to do.  


All you would want to do is create a BeforeAdapterMethod, Case "Update" and then DateTime the OrderHed date and run a for each on the OrderDtl plugging in the OrderHed DateTime on the appropriate fields.  Of course check the orderdtl dataview count and the orderhed dataview dates before hand to make sure there is any data yet.


Basically the dates would remain blank until save.  Then the script would populate all the lines.


I hope im going in the right direction.  



---In vantage@yahoogroups.com, <clederer@...> wrote:

C#

--- In vantage@yahoogroups.com, <don.n.doan@...> wrote:
>
> Are you more familiar with BPMs or VB/C#?
>
>
> ---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:
>
> Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to date that is entered in the order number.
>
> The point of this is so that for each additional line entered for that order number, the dates default to the same date. It gets redundant for employees to enter the same dates 10 times per order.
>
I'm on 702a and my dates do not do that. Epicor suggested a BPM as the only way to have dates automatically pull from the need by/ship by dates when creating a new order line. I will try and follow your steps, thank you

--- In vantage@yahoogroups.com, <don.n.doan@...> wrote:
>
> I'm not completely sure of what version you are on but on 607+ from my experience dates automatically pull from the need by/ship by dates when creating a new order line. I had to create a script that put in project IDs on each line if an additional line was created on that order.
>
>
> That should apply to what you want to do.
>
>
> All you would want to do is create a BeforeAdapterMethod, Case "Update" and then DateTime the OrderHed date and run a for each on the OrderDtl plugging in the OrderHed DateTime on the appropriate fields. Of course check the orderdtl dataview count and the orderhed dataview dates before hand to make sure there is any data yet.
>
>
> Basically the dates would remain blank until save. Then the script would populate all the lines.
>
>
> I hope im going in the right direction.
>
>
> ---In vantage@yahoogroups.com, <clederer@> wrote:
>
> C#
>
> --- In vantage@yahoogroups.com mailto:vantage@yahoogroups.com, <don.n.doan@> wrote:
> >
> > Are you more familiar with BPMs or VB/C#?
> >
> >
> > ---In vantage@yahoogroups.com mailto:vantage@yahoogroups.com, <vantage@yahoogroups.com mailto:vantage@yahoogroups.com> wrote:
> >
> > Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to date that is entered in the order number.
> >
> > The point of this is so that for each additional line entered for that order number, the dates default to the same date. It gets redundant for employees to enter the same dates 10 times per order.
> >
>
C#

--- In vantage@yahoogroups.com, <don.n.doan@...> wrote:
>
> Are you more familiar with BPMs or VB/C#?
>
>
> ---In vantage@yahoogroups.com, <vantage@yahoogroups.com> wrote:
>
> Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to date that is entered in the order number.
>
> The point of this is so that for each additional line entered for that order number, the dates default to the same date. It gets redundant for employees to enter the same dates 10 times per order.
>
Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to the date that is entered in the previous line.

Ideally, I'd like to have the code say, "set table.date to previous line table.date" but I'm not sure how to say it

Here's the code i use for plugging projectID into sales orders.. I modified it for dates but it isn't tested. Make sure to use the wizard to create the beforeadaptermethod.



  private void oTrans_ordAdapter_BeforeAdapterMethod(object sender, BeforeAdapterMethodArgs args)

{

// ** Argument Properties and Uses **

// ** args.MethodName **

// ** Add Event Handler Code **


// ** Use MessageBox to find adapter method name

// EpiMessageBox.Show(args.MethodName)

switch (args.MethodName)

{

case "Update":

EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));

EpiDataView edvOrderHed = ((EpiDataView)(this.oTrans.EpiDataViews["OrderHed"]));

if (edvOrderDtl.dataView.Count != 0)

{

DateTime needDate = edvOrderHed.dataView[0]["NeedByDate"].ToString();

DateTime shipDate = edvOrderHed.dataView[0]["ShipByDate"].ToString();

if (needDate != "")

{

for(int i = 0; i < edvOrderDtl.dataView.Count; i++) 

{

edvOrderDtl.dataView[i]["NeedByDate"] = needDate;

edvOrderDtl.dataView[i]["ShipByDate"] = shipDate;

}

}

}

break;

}


}


Let me know how it works out.


---In vantage@yahoogroups.com, <clederer@...> wrote:

Trying to change 2 sets of dates in Transfer Order Entry (Line --> Detail) that currently default to "blank," to default to the date that is entered in the previous line.

Ideally, I'd like to have the code say, "set table.date to previous line table.date" but I'm not sure how to say it