Correct. I am in the Part Maintenance screen, trying to use the SalesOrderAdapter.
Dan Godfrey
(805) 389-1935 x 251
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Jose Gomez
Sent: Thursday, April 18, 2013 5:58 PM
To: Vantage
Subject: RE: [Vantage] Vantage 8x: SalesOrder Adapter Update function
Just so that I am clear you are not in the sales order screen correct?
Dan Godfrey
(805) 389-1935 x 251
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Jose Gomez
Sent: Thursday, April 18, 2013 5:58 PM
To: Vantage
Subject: RE: [Vantage] Vantage 8x: SalesOrder Adapter Update function
Just so that I am clear you are not in the sales order screen correct?
On Apr 18, 2013 7:48 PM, "Dan Godfrey" <dgodfrey@...> wrote:
> **
>
>
> Let me see if I can clarify more. Since I can only activate the
> special code from the TEST button, I can save the form with CheckBox05
> changed and not call my code and EVERYTHING is happy. I definitely know it is my code.
>
> Now, with the function the only problem is that the SalesOrderAdpater
> just won't update the appropriate OrderDtl records. When my function
> is called I log my steps.
> - I have identified that I get the appropriate rows in the
> SalesOrderAdapter.
> - I do get to the point of calling the SalesOrderAdpater.Update method.
> - The update method returns false and then the code moves on happy and
> closes the function normally.
> There are no errors to report.
>
> So I think that there is something that I am missing like how to
> re-apply the dataset to the adapter before calling the update method
> or something like that. The problem is that I have found that the
> SalesOrderAdapter.SalesOrderData dataset is readonly is Vantage 8x. So
> trying to assign the dataset that I get from GetRows back to the
> SalesOrderAdapter.SalesOrderData dataset I get an error ("Property
> 'SalesOrderData' is 'ReadOnly'."). So I don't know how to alter the
> datasest in the adapter so that it will update anything.
>
> Dan Godfrey
> (805) 389-1935 x 251
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
> Behalf Of Jose Gomez
> Sent: Thursday, April 18, 2013 4:19 PM
> To: Vantage
> Subject: Re: [Vantage] Vantage 8x: SalesOrder Adapter Update function
>
> So just for testing try doing a blank customization calling get by I'd
> and changing one field and calling updates. If that works we can
> narrow it down to your code vs a different system bpm or data problem
> On Apr 9, 2013 3:30 PM, "dgodfrey_amc" <dgodfrey@...> wrote:
>
> > **
> >
> >
> > Has anyone ever use the Sales Order Adapter in customization? I am
> > not looking to added a line or release. I just want to edit current SO lines?
> > for whatever reason I can not get the update to work.
> >
> > Here is my code:
> >
> > Private Function GetStringFromPartDataView(ByVal ColumnName AS
> > String) As String Dim sRet AS String = String.Empty Dim edvPart As
> > EpiDataView = CType(oTrans.EpiDataViews("Part"),
> > EpiDataView)
> > If(edvPart.Row > -1) Then
> > IF(edvPart.dataView(edvPart.Row)(ColumnName).GetType().Equals(sRet.G
> > et
> > Type()))
> > Then
> > sRet = edvPart.dataView(edvPart.Row)(ColumnName)
> > End If
> > End If
> > return sRet
> > End Function
> >
> > Private Sub UpdateSOFromQualityHoldChange() WriteToLogFile("Inside
> > UpdateSOFromQualityHoldChange::chkQualityHold.Checked = " &
> > chkQualityHold.Checked & "; bQualityHoldChanged = " &
> > bQualityHoldChanged) Try Dim sMessage AS String = ""
> > Dim sPartNum AS String = GetStringFromPartDataView("PartNum")
> > IF (bQualityHoldChanged = True) Then Dim bDirty AS Boolean = False
> > Dim adSalesOrder As SalesOrderAdapter = New
> > SalesOrderAdapter(PartForm) Dim dsSalesOrder AS Data.DataSet' =
> > adSalesOrder.GetCurrentDataSet(Epicor.Mfg.UI.Searches.DataSetMode.Ro
> > ws
> > DataSet)
> > adSalesOrder.BOConnect()
> > Dim whereClause As String = "whereClause: PartNum = '" & sPartNum & "'
> > AND OpenLine = True"
> > Dim MorePages As Boolean
> > opts.NamedSearch.WhereClauses.Clear()
> > opts.NamedSearch.WhereClauses.Add("OrderHed", "OpenOrder = True")
> > WriteToLogFile(whereClause)
> > opts.NamedSearch.WhereClauses.Add("OrderDtl", whereClause)
> > 'dsSalesOrder = adSalesOrder.GetRows(opts, MorePages)
> > adSalesOrder.GetRows(opts, MorePages) 'WriteToLogFile("Open Sales
> > Orders Lines found(" &
> > adSalesOrder.Tables("OrderDtl").Rows.Count() & ") for: " & sPartNum)
> > WriteToLogFile("Open Sales Orders Lines found(" &
> > adSalesOrder.SalesOrderData.OrderDtl.Rows.Count() & ") for: " &
> > sPartNum) WriteToLogFile("Setting the Sales Order Hold Status to: "
> > &
> > chkQualityHold.Checked)
> > IF(chkQualityHold.Checked = True) Then
> > '/**************************************/
> >
> > 'If (dsSalesOrder.Tables("OrderDtl").Rows.Count() > 0) Then If
> > (adSalesOrder.SalesOrderData.OrderDtl.Rows.Count() > 0) Then 'For
> > Each dr AS DataRow In dsSalesOrder.Tables("OrderDtl").Rows
> > For Each dr AS DataRow In adSalesOrder.SalesOrderData.OrderDtl.Rows
> > dr.Item("CheckBox02") = dr.Item("CheckBox01")
> > dr.Item("CheckBox01") = chkQualityHold.Checked
> > dr.Item("RowMod") = "U"
> > bDirty = True
> > WriteToLogFile("SO#: " & dr.Item("OrderNum").ToString() & " should
> > be
> > updated.")
> > Next
> > End If
> > '/**************************************/
> > sMessage = sPartNum & " is placed on Quality HOLD."
> > Else'IF(chkQualityHold.Checked = True) Then 'If
> > (dsSalesOrder.Tables("OrderDtl").Rows.Count() > 0) Then If
> > (adSalesOrder.SalesOrderData.OrderDtl.Rows.Count() > 0) Then 'For
> > Each dr AS DataRow In dsSalesOrder.Tables("OrderDtl").Rows
> > For Each dr AS DataRow In adSalesOrder.SalesOrderData.OrderDtl.Rows
> > dr.Item("CheckBox01") = dr.Item("CheckBox02")
> > dr.Item("CheckBox02") = chkQualityHold.Checked
> > dr.Item("RowMod") = "U"
> > bDirty = True
> > WriteToLogFile("SO#: " & dr.Item("OrderNum").ToString() & " should
> > be
> > updated.")
> > Next
> > End If
> > sMessage = sPartNum & " is taken off Quality HOLD."
> > End IF'IF(chkQualityHold.Checked = True) Then IF(bDirty = True) Then
> > WriteToLogFile("Updating all Sales Orders edited.")
> > adSalesOrder.Update()
> > End If
> > adSalesOrder.Dispose()
> > 'dsSalesOrder.Dispose()
> > bQualityHoldChanged = False
> > 'Emailing(ucbDefaultEmailAddress.Value, sMessage, "Part OnHold
> > Status") End If WriteToLogFile("Closing
> > UpdateSOFromQualityHoldChange
> > Function") Catch ex As System.Exception
> > ExceptionBox.Show(ex)
> > End Try
> > End Sub
> >
> > Private Sub chkQualityHold_Click(ByVal Sender As Object, ByVal Args
> > As
> > System.EventArgs) Handles chkQualityHold.Click '// ** Place Event
> > Handling Code Here ** bQualityHoldChanged = NOT bQualityHoldChanged
> > End Sub
> >
> > Private Sub btnQualityHold_Click(ByVal Sender As Object, ByVal Args
> > As
> > System.EventArgs) Handles btnQualityHold.Click '// ** Place Event
> > Handling Code Here **
> > UpdateSOFromQualityHoldChange()
> > End Sub
> >
> >
> >
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must
> have already linked your email address to a yahoo id to enable access.
> )
> (1) To access the Files Section of our Yahoo!Group for Report Builder
> and Crystal Reports and other 'goodies', please goto:
> http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto:
> http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto:
> http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
> CONFIDENTIALITY NOTICE: The data attached/enclosed may contain
> information (including technology and technical data) which is subject to the U.S.
> International Traffic in Arms Regulations (ITAR) or Export
> Administration Regulations (EAR). This information may not be
> exported, released, or disclosed to foreign persons either inside or
> outside the United States without first obtaining the proper U.S.
> export license or written authorization. In addition, the information
> and articles described herein are either patented or proprietary, and
> the copying or reproduction thereof is prohibited without ADVANCED
> Motion Controls prior written consent. If you are not the intended
> recipient (or have received this e-mail in error), please notify the
> sender immediately and destroy this e-mail. Any unauthorized copying,
> disclosure or distribution of the material in this e-mail is strictly forbidden. Thank you for your compliance.
>
>
[Non-text portions of this message have been removed]
------------------------------------
Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links