Customization to Add a Misc Charge

Joe,



I already tried that with the BeginEdit/EndEdit - same thing occurred.
Thanks though.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
Joe Rojas
Sent: Tuesday, December 21, 2010 12:40 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: Customization to Add a Misc Charge





Hi Kevin,

Have you tried wrapping your assignment statements in between BeginEdit
and EndEdit methods?

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0].BeginEdit();

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["MiscCode"] = MChgCode;

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["Description"] = MDesc;

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["FreqCode"] = MFreq;

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0].EndEdit();

I'm not sure if this will help and if it does, I'm not sure why but I
have seen code examples that look like this.

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of ksimon8fw
Sent: Tuesday, December 21, 2010 10:04 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Re: Customization to Add a Misc Charge

Giving this a bump...

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> ,
"ksimon8fw" <ksimon@...> wrote:
>
> I'm writing some code to add a misc charge to a sales order based on
data sitting in a UD table. I've written code before that adds records
to a UD table without a problem, but for some reason, can't get this
code to work.
>
> If anyone has done anything similar and would like to share that cod,
or if you see what I'm doing wrong, it would be greatly appreciated.
>
> Thanks.
> Kevin
>
> Here's a snippet of what I'm doing(code is in C#):
> // Get the sales order
> SalesOrderAdapter adOrd = new SalesOrderAdapter(oTrans);
> adOrd.BOConnect();
> adOrd.GetByID(MOrderNum);
> // Get a new Misc Charge Record
> adOrd.GetNewOHOrderMsc(MOrderNum, 0);
> // Set Misc Charge fields
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["MiscCode"] =
MChgCode;
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["Description"] =
MDesc;
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["FreqCode"] = MFreq;
> Continue on from here...
>
> My code is working fine down to where I start setting the Misc Charge
fields. It gets to that point, and just exits the rest of the code. I
don't get any error messages. I've thrown a number of "MessageBox.Show"
commands in, so I know it's getting to that point and no further.
>
> Thanks!
>

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... <mailto:jrojas%40matsinc.com> | www.matsinc.com Ask us
about our clean, green and beautiful matting and flooring

This message is intended only for the individual named. If you are not the
named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this
e-mail by mistake. Please note that any views or opinions presented in this
email are solely those of the author and do not necessarily represent those
of the company.

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





[Non-text portions of this message have been removed]
I'm writing some code to add a misc charge to a sales order based on data sitting in a UD table. I've written code before that adds records to a UD table without a problem, but for some reason, can't get this code to work.

If anyone has done anything similar and would like to share that cod, or if you see what I'm doing wrong, it would be greatly appreciated.

Thanks.
Kevin

Here's a snippet of what I'm doing(code is in C#):
// Get the sales order
SalesOrderAdapter adOrd = new SalesOrderAdapter(oTrans);
adOrd.BOConnect();
adOrd.GetByID(MOrderNum);
// Get a new Misc Charge Record
adOrd.GetNewOHOrderMsc(MOrderNum, 0);
// Set Misc Charge fields
adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["MiscCode"] = MChgCode;
adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["Description"] = MDesc;
adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["FreqCode"] = MFreq;
Continue on from hereÂ…

My code is working fine down to where I start setting the Misc Charge fields. It gets to that point, and just exits the rest of the code. I don't get any error messages. I've thrown a number of "MessageBox.Show" commands in, so I know it's getting to that point and no further.

Thanks!
Giving this a bump...

--- In vantage@yahoogroups.com, "ksimon8fw" <ksimon@...> wrote:
>
> I'm writing some code to add a misc charge to a sales order based on data sitting in a UD table. I've written code before that adds records to a UD table without a problem, but for some reason, can't get this code to work.
>
> If anyone has done anything similar and would like to share that cod, or if you see what I'm doing wrong, it would be greatly appreciated.
>
> Thanks.
> Kevin
>
> Here's a snippet of what I'm doing(code is in C#):
> // Get the sales order
> SalesOrderAdapter adOrd = new SalesOrderAdapter(oTrans);
> adOrd.BOConnect();
> adOrd.GetByID(MOrderNum);
> // Get a new Misc Charge Record
> adOrd.GetNewOHOrderMsc(MOrderNum, 0);
> // Set Misc Charge fields
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["MiscCode"] = MChgCode;
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["Description"] = MDesc;
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["FreqCode"] = MFreq;
> Continue on from hereÂ…
>
> My code is working fine down to where I start setting the Misc Charge fields. It gets to that point, and just exits the rest of the code. I don't get any error messages. I've thrown a number of "MessageBox.Show" commands in, so I know it's getting to that point and no further.
>
> Thanks!
>
Hi Kevin,



Have you tried wrapping your assignment statements in between BeginEdit
and EndEdit methods?



adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0].BeginEdit();

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["MiscCode"] = MChgCode;

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["Description"] = MDesc;

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["FreqCode"] = MFreq;

adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0].EndEdit();



I'm not sure if this will help and if it does, I'm not sure why but I
have seen code examples that look like this.







From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of ksimon8fw
Sent: Tuesday, December 21, 2010 10:04 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Customization to Add a Misc Charge





Giving this a bump...

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"ksimon8fw" <ksimon@...> wrote:
>
> I'm writing some code to add a misc charge to a sales order based on
data sitting in a UD table. I've written code before that adds records
to a UD table without a problem, but for some reason, can't get this
code to work.
>
> If anyone has done anything similar and would like to share that cod,
or if you see what I'm doing wrong, it would be greatly appreciated.
>
> Thanks.
> Kevin
>
> Here's a snippet of what I'm doing(code is in C#):
> // Get the sales order
> SalesOrderAdapter adOrd = new SalesOrderAdapter(oTrans);
> adOrd.BOConnect();
> adOrd.GetByID(MOrderNum);
> // Get a new Misc Charge Record
> adOrd.GetNewOHOrderMsc(MOrderNum, 0);
> // Set Misc Charge fields
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["MiscCode"] =
MChgCode;
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["Description"] =
MDesc;
> adOrd.SalesOrderData.Tables["OrderMsc"].Rows[0]["FreqCode"] = MFreq;
> Continue on from here...
>
> My code is working fine down to where I start setting the Misc Charge
fields. It gets to that point, and just exits the rest of the code. I
don't get any error messages. I've thrown a number of "MessageBox.Show"
commands in, so I know it's getting to that point and no further.
>
> Thanks!
>












Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191
jrojas@... | www.matsinc.com Ask us about our clean, green and beautiful matting and flooring


This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.


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