Hi,
For now, our biggest concern is to include weekends for transit days calcs...Below I have included the "meat" of the formulas I used for my calculations and verified manually and in Excel. If anyone wants to test themselves, just let me know if you find anything incorrect.
Karen
'//Check Need By Date lands on Sunday or Saturday
IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate")) = 1 THEN
wknd = wknd + 1
Else IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate")) = 7 THEN
wknd = wknd + 1
Else
wknd = wknd + 0
END If
myNumber = myNumber + wknd
edv.dataView(edv.Row)("ReqDate") = edv.dataView(edv.Row)("NeedByDate").AddDays(myNumber * -1)
'//Check Days Between lands on Sunday or Saturday
For X = 1 to myNumber
IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate").AddDays(X * -1)) = 1 THEN
calcwknd = calcwknd + 1
Else IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate").AddDays(X * -1)) = 7 THEN
calcwknd = calcwknd + 1
Else
calcwknd = calcwknd + 0
End If
Next X
myNumber = myNumber + calcwknd
edv.dataView(edv.Row)("ReqDate") = edv.dataView(edv.Row)("NeedByDate").AddDays(myNumber * -1)
'//Check Calculated Ship By Date lands on Sunday or Saturday
IF WEEKDAY(edv.dataView(edv.Row)("ReqDate")) = 1 THEN
endwknd = endwknd + 2
Else IF WEEKDAY(edv.dataView(edv.Row)("ReqDate")) = 7 THEN
endwknd = endwknd + 1
Else
endwknd = endwknd + 0
End If
myNumber = myNumber + endwknd
edv.dataView(edv.Row)("ReqDate") = edv.dataView(edv.Row)("NeedByDate").AddDays(myNumber * -1)
For now, our biggest concern is to include weekends for transit days calcs...Below I have included the "meat" of the formulas I used for my calculations and verified manually and in Excel. If anyone wants to test themselves, just let me know if you find anything incorrect.
Karen
'//Check Need By Date lands on Sunday or Saturday
IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate")) = 1 THEN
wknd = wknd + 1
Else IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate")) = 7 THEN
wknd = wknd + 1
Else
wknd = wknd + 0
END If
myNumber = myNumber + wknd
edv.dataView(edv.Row)("ReqDate") = edv.dataView(edv.Row)("NeedByDate").AddDays(myNumber * -1)
'//Check Days Between lands on Sunday or Saturday
For X = 1 to myNumber
IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate").AddDays(X * -1)) = 1 THEN
calcwknd = calcwknd + 1
Else IF WEEKDAY(edv.dataView(edv.Row)("NeedByDate").AddDays(X * -1)) = 7 THEN
calcwknd = calcwknd + 1
Else
calcwknd = calcwknd + 0
End If
Next X
myNumber = myNumber + calcwknd
edv.dataView(edv.Row)("ReqDate") = edv.dataView(edv.Row)("NeedByDate").AddDays(myNumber * -1)
'//Check Calculated Ship By Date lands on Sunday or Saturday
IF WEEKDAY(edv.dataView(edv.Row)("ReqDate")) = 1 THEN
endwknd = endwknd + 2
Else IF WEEKDAY(edv.dataView(edv.Row)("ReqDate")) = 7 THEN
endwknd = endwknd + 1
Else
endwknd = endwknd + 0
End If
myNumber = myNumber + endwknd
edv.dataView(edv.Row)("ReqDate") = edv.dataView(edv.Row)("NeedByDate").AddDays(myNumber * -1)
--- In vantage@yahoogroups.com, "karen_schoenung" <kschoenung@...> wrote:
>
> Hi,
>
> I used this as a sample and did create the foreign key, sub key and code to update the ship by date after updating need by date...But, now I would like to incorporate the Production? calendar in Vantage. Any ideas where to start?
>
> Thanks,
> Karen
>
> --- In vantage@yahoogroups.com, "Lynn" <lynn.khalife@> wrote:
> >
> > That sounds like good advice. I'm probably going to take that advice.
> >
> > I think that I will launch the Transit Days field into the live
> > database now. Then at some later date, I can work on the
> > calendar/date math when I am no longer under pressure to get the
> > customization quickly deployed to the users.
> >
> > That way, I can take my time and consider those weekends & holidays
> > issues brought up by Charlie which I had not thought about before.
> >
> > Lynn
> >
> >
> >
> > --- In vantage@yahoogroups.com, Robert Brown <robertb_versa@>
> > wrote:
> > >
> > > My pleasure Lynn. Some great experienced power users out there
> > helped me (and still do) when we 1st started on Vantage and I like
> > returning the favor.
> > >
> > > Advice? - Don't get into the date math yet. (As you suggested) -
> > See if just displaying the info (and letting people do the simple
> > mental math) gives you the desired productivity boost.
> > >
> > > It is all too easy to incrementally overcustomize and wake up one
> > day to discover you have seriously impact application performance.
> > >
> > > If you reach a point where you think it really would help to do the
> > calc for the users, re-post and there is probably some code that
> > could be shared to save you time.
> > >
> > > Rob
> > > --- On Wed, 10/15/08, Lynn <lynn.khalife@> wrote:
> > >
> > > From: Lynn <lynn.khalife@>
> > > Subject: [Vantage] Re: Customization for Transit Days
> > > To: vantage@yahoogroups.com
> > > Date: Wednesday, October 15, 2008, 2:33 PM
> > >
> > >
> > >
> > >
> > >
> > >
> > > It works!
> > >
> > > Thank you, thank you, thank you Rob.
> > >
> > > I had never before heard of a SubTable View.
> > >
> > > Following the instructions in your email, I created the SubTable
> > > View, then I re-added a control box back onto the Order Entry
> > screen
> > > and connected it to my newly added (SubTable View) Datasource,
> > > ShipToInfo.Number01 . Then I exited Customization and went into
> > Order
> > > Entry. As soon as I opened an existing order, the value for Transit
> > > Days immediately appeared!
> > >
> > > Now I can move on to the issue to working with calandar and date
> > > math. However, even if I cannot get the date math to work
> > perfectly,
> > > the Order Entry users will be very happy that they can see the
> > > Transit Days value on the Order Entry Header screen; then at least
> > > they have a number to do their own calendar calculation to
> > determine
> > > a ShipBy date.
> > >
> > > I have been trying to get this Transit Days field to work for a
> > very,
> > > very long time. Now that I know about a SubTable View in Vantage,
> > > I'm sure that I will be using this knowledge in future
> > customizations.
> > >
> > > Thank you again.
> > >
> > > Lynn
> > >
> > > --- In vantage@yahoogroups .com, Robert Brown <robertb_versa@ ...>
> > > wrote:
> > > >
> > > > Lynn,
> > > > Â
> > > > Don't quit on it yet. You're on the right track.
> > > >
> > > > It is (seems more often than not unfortunately) not always
> > possible
> > > to create a DIRECT FKV from a seemingly appropriate native table to
> > > the foreign table you want to join & bind to the app.
> > > >
> > > > You have to get creative and relying on some trial and error luck
> > > as a result of the lack of documentation (and the poor environment
> > > provided that offers little error resolution guidance).
> > > >
> > > > Try creating a simple FKV from the native OrderRel table to table
> > > Customer.
> > > >
> > > > Then (from your FKV Customer) try creating a SubTable View to
> > table
> > > ShipTo.
> > > >
> > > > SubTable Views allow YOU to decide what fields to create the join
> > > through.
> > > >
> > > > Typically, you are always going to have Company as the 1st joined
> > > field but, depending upon what version you are on (and what bugs it
> > > has), it is possible company data isn't populated in the tables you
> > > are trying to connect the dots through. (Look at the tables raw via
> > a
> > > simple BAQ dump or via odbc SQL if you encounter problems.)
> > > >
> > > > I'd guess your joins would be through Company, CustID & ShipToID.
> > > >
> > > > It can be a very frustrating trial and error process. I've had to
> > > go as deep as 3 FKVs until I finally can get a SubTable to bring in
> > > the data I'm after.
> > > >
> > > > If all else fails (and it might), open the Custom Object Explorer
> > > (Adapter tab) and look at the methods and properties (as well as
> > > sample code for each) for the ShipToAdapter. Make note of the
> > > assemblies required for the adapter as you will likely have to add
> > > them to the app as Custom Assemblies (to support the adapter).
> > > >
> > > > You should find a suitable search ("Get...") method that you can
> > > build a subroutine around that will allow you to retrieve your
> > > ShipTo.Number01 value associated with each order/line/release' s
> > > Customer & ShipTo ID.
> > > >
> > > > Store it in a defined temp variable or an array (or permanently
> > > save it to an OrderRel.Number# # field).
> > > >
> > > > Then you are ready to start doing some date math.
> > > >
> > > > ...I know... (yuck!) It can be done though... It takes some
> > > persistence and in the end, you'll learn a lot more about how
> > Vantage
> > > works than you might have if it was as easy as falsely advertised.
> > > >
> > > > Rob
> > > >
> > > >
> > > >
> > > > --- On Wed, 10/15/08, Lynn <lynn.khalife@ ...> wrote:
> > > >
> > > > From: Lynn <lynn.khalife@ ...>
> > > > Subject: [Vantage] Re: Customization for Transit Days
> > > > To: vantage@yahoogroups .com
> > > > Date: Wednesday, October 15, 2008, 11:45 AM
> > > >
> > > > Yes, that sums it up exactly.
> > > >
> > > > I finished the Customer Maintenance customization. And I have
> > > > already entered TransitDays data for several Ship-To locations.
> > > >
> > > > Then, I downloaded information on FKV's from the Epicor website
> > and
> > > > tried to create a FKV to the ShipTo table from the OrderHed. This
> > > is
> > > > where I am completely unsuccessful.
> > > >
> > > > Following the instructions in Answerbook # 6415MPS, I create a
> > new
> > > > custom view named "CustShipToInfo" . I select OrderHed as my
> > Parent
> > > > View Name. Then I move to Column Name. I think this is where I
> > run
> > > > into a problem. CustNum is available as a Column Name. But there
> > > > are 2 issues I that I don't know how to overcome. First,
> > ShipToNum
> > > > is not one of the available Column Names for the Parent View
> > > > OrderHed. Second, when I choose CustNum, I still need to tell the
> > > > database which ShipToNum I want and there is not a place to add a
> > > > second Column Name for the same FKV.
> > > >
> > > > The situation is the same if I select OrderDtl as the Parent View
> > > > Name.
> > > >
> > > > The situation is different when I select OrderRel as the
> > ParentView
> > > > Name. When OrderRel is the Parent, I am allowed to choose
> > ShipToNum
> > > > as my column name; however, the LikeColumnValue populates
> > > > as "ShipHead.ShipToNum ". There are 2 issues here. First, the
> > > > ShipHead table does not contain my data. My data is in the ShipTo
> > > > table. Second, I still need to tell the database which CustNum to
> > > > use with the ShipToNum.
> > > >
> > > > I don't know what to do.
> > > >
> > > > Thanks.
> > > >
> > > > Lynn
> > > >
> > > > --- In vantage@yahoogroups .com, Robert Brown
> > <robertb_versa@ ...>
> > > > wrote:
> > > > >
> > > > > Lynn,
> > > > >
> > > > > OK. Let me see if I get your planned intent by repeating - then
> > I
> > > > can recommend:
> > > > >
> > > > > You either already have (or plan to) store an integer "Transit
> > > > Days" value in the ShipTo table (presumably in a ud field like
> > > > ShipTo.Number01) .
> > > > >
> > > > > That means Customer Maintenance will require a customization to
> > > > expose ShipTo.Number01 and display it as read-only false so your
> > > > people can edit it and add the info as new addresses are added
> > over
> > > > time.
> > > > >
> > > > > Once that data is available, in Order Entry you'll want to add
> > > the
> > > > custom assemblies needed to support the adapter & BO methods
> > > > associated with the Ship To table. Then you can create a Foreign
> > > Key
> > > > View to the ShipTo table from the native OrderRel view.
> > > > >
> > > > > That then makes ShipTo.Number01 available to the Order Entry
> > app
> > > to
> > > > display or use in VB subroutines and/or functions to do the
> > offset
> > > > days calculation.
> > > > >
> > > > > In order to do that offset days calculation, you need a
> > calendar
> > > > that defines your normal business/shipping days. You can either
> > > > create one specifically for shipping or use your default company
> > > > calendar stored in the ProdCal table (with exceptions - holidays -
> >
> > > > stored in ProdCalDay).
> > > > >
> > > > > (We found these calendars ridiculously conceived so, while we
> > > must
> > > > use & maintain them for resource capacity, etc., we actually
> > > maintain
> > > > a very simple holiday calender schema in a SQL server db. At some
> > > > point we may move that to a UD table.)
> > > > >
> > > > > Once you've settled upon the source of your calendar, you'll
> > need
> > > > to write some functions to use the calendar data and your
> > > > ShipTo.Number01 offset field to backwards calculate you Ship Date
> > > > from the customer Need By date (or vice-versa if that is your
> > > > process).
> > > > >
> > > > >
> > > > > Am I understanding your need now?
> > > > >
> > > > > If so, does what I describe (as a possible way to obtain it)
> > make
> > > > sense to you?
> > > > >
> > > > > Rob
> > > > >
> > > > > --- On Wed, 10/15/08, Lynn <lynn.khalife@ ...> wrote:
> > > > >
> > > > > From: Lynn <lynn.khalife@ ...>
> > > > > Subject: [Vantage] Re: Customization for Transit Days
> > > > > To: vantage@yahoogroups .com
> > > > > Date: Wednesday, October 15, 2008, 8:47 AM
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Hi Rob:
> > > > >
> > > > > For some customers, we use our own trucks. For others, the
> > > customer
> > > > > has determined the carrier and we have been using the same
> > > carrier
> > > > > for the same shipto location for years.
> > > > >
> > > > > In nearly every case for every customer, we use the same
> > Carrier
> > > > for
> > > > > all product that goes to a specific location. Therefore, in our
> > > > > case, the Transit Days will rarely, if ever, change for a
> > > specific
> > > > > Shipto location.
> > > > >
> > > > > Hence, it makes sense for us to use a single Transit Days field
> > > in
> > > > > the ShipTo table. If we were constantly using different
> > carriers,
> > > > it
> > > > > would be much more complicated. This is probably why Epicor
> > > didn't
> > > > > build this feature into the Order Entry design. If we used many
> > > > > carriers for a single shipto address, I would probably have to
> > > add
> > > > a
> > > > > separate userdefined table to store this information.
> > > > >
> > > > > And even though the Transit Days will always be estimates, it
> > is
> > > > more
> > > > > efficient and effective if the Order Entry clerks could see the
> > > > > Transit Days on the same screen during Order Entry.
> > > > >
> > > > > As it is now, they have to leave that screen and go back to the
> > > > main
> > > > > menu and open the Customer file, search for the Customer, then
> > do
> > > a
> > > > > second Search for the correct Customer ShipTo code in order to
> > > get
> > > > > the Transit Days to calculate a reliable "Ship By" date based
> > > upon
> > > > > the Customer's "Need By" date.
> > > > >
> > > > > Prior to this, our Transit days are in our old database
> > software
> > > > > which matches a Carrier Name with the customer ShipTo address.
> > We
> > > > > are implementing Vantage and want to have the same feature in
> > > > Vantage
> > > > > that we do with our old software.
> > > > >
> > > > > But nothing will work until I can figure out how to pass the
> > > field
> > > > > from ShipTo to OrderHed.
> > > > >
> > > > > I appreciate your input and hints very much.
> > > > >
> > > > > Lynn
> > > > >
> > > > > --- In vantage@yahoogroups .com, Robert Brown
> > > <robertb_versa@ ...>
> > > > > wrote:
> > > > > >
> > > > > > Lynn
> > > > > >
> > > > > > How do you know the working day offset to apply between the
> > > > > customer Need By date and your Ship Date for individual order
> > > line
> > > > > releases? What is your data source for this info?
> > > > > >
> > > > > > Some simple 'rule of thumb' based on ship to address and/or
> > > ship
> > > > > via method or do you have the info in some data format from
> > your
> > > > > commonly used carriers? (Example: NextDay Air is 1 business day
> > > no
> > > > > matter what destination it is. UPS provides ground service
> > > transist
> > > > > times based upon your ship from zip and the ship to zip zones.
> > > Big
> > > > > LTL carriers can provide general guesstimate transist times
> > with
> > > > > about the same reliability of UPS. Small LTL's are often a
> > sheer
> > > > > guess, etc.,.)
> > > > > >
> > > > > > The date math itself is pretty straight forward (at least
> > using
> > > > VB)
> > > > > once you have an accessible source for the offset data. We've
> > got
> > > a
> > > > > number of customizations that do business day offset math.
> > > > > >
> > > > > > (No sense in doing the math unless you have a source of data
> > > for
> > > > > the math to be done with.)
> > > > > >
> > > > > > Rob
> > > > > >
> > > > > > --- On Tue, 10/14/08, Lynn <lynn.khalife@ ...> wrote:
> > > > > > From: Lynn <lynn.khalife@ ...>
> > > > > > Subject: [Vantage] Re: Customization for Transit Days
> > > > > > To: vantage@yahoogroups .com
> > > > > > Date: Tuesday, October 14, 2008, 9:15 PM
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > I didn't think it would be possible to put a
> > > > > calculation on an Epicor
> > > > > >
> > > > > > field. No, there isn't any reason that I need to add my own
> > > > custom
> > > > > >
> > > > > > Ship By date. You are correct, I would much prefer to update
> > > the
> > > > > >
> > > > > > Epicor-provided Ship-by date field.
> > > > > >
> > > > > >
> > > > > >
> > > > > > But, my biggest hurdle right now is that I don't know how to
> > > pass
> > > > > the
> > > > > >
> > > > > > TransitDays from the ShipTo table to the OrderHed table.
> > > > > >
> > > > > >
> > > > > >
> > > > > > Lynn
> > > > > >
> > > > > >
> > > > > >
> > > > > > --- In vantage@yahoogroups .com, "CharlieSmith" <CSmith@>
> > wrote:
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > Why not just update the ship by date with the transit days
> > > > > through
> > > > > >
> > > > > > your
> > > > > >
> > > > > > > customization. This will be much more advantageous because
> > > many
> > > > > of
> > > > > >
> > > > > > the
> > > > > >
> > > > > > > reports, defaults and analysis is based on the ship-by date.
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > Is there a business reason why you would need a custom ship
> > > by
> > > > > date?
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > Charlie Smith
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > 2W Technologies LLC
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > From: vantage@yahoogroups .com [mailto:vantage@
> > > > yahoogroups .com]
> > > > > On
> > > > > >
> > > > > > Behalf
> > > > > >
> > > > > > > Of Lynn
> > > > > >
> > > > > > > Sent: Tuesday, October 14, 2008 4:20 PM
> > > > > >
> > > > > > > To: vantage@yahoogroups .com
> > > > > >
> > > > > > > Subject: [Vantage] Customization for Transit Days
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > On the Order Entry screens, the "Ship By" date defaults to
> > > the
> > > > > same
> > > > > >
> > > > > > > date as the "Need By" date.
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > I have added a field (ShipTo.Number01) to Customer Ship To
> > > > entry
> > > > > >
> > > > > > and
> > > > > >
> > > > > > > labeled it "Transit Days".
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > On the Order Entry screens, I would like to hide the Epicor-
> > > > > >
> > > > > > > supplied "Ship By" date field (OrderHed.RequestDa te) and
> > add
> > > > my
> > > > > own
> > > > > >
> > > > > > > Ship By date field (OrderHed.Date01) .
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > During Order Entry, upon selecting a Customer ShipTo code,
> > I
> > > > want
> > > > > >
> > > > > > to
> > > > > >
> > > > > > > automatically pull the Transit Days number
> > (ShipTo.Number01)
> > > > from
> > > > > >
> > > > > > the
> > > > > >
> > > > > > > Customer ShipTo table and bring that value into a field
> > named
> > > > > >
> > > > > > > OrderHed.Number01. Then I would like to subtract that value
> > > > from
> > > > > >
> > > > > > the
> > > > > >
> > > > > > > Need By date to automatically populate the correct Ship By
> > > date
> > > > > in
> > > > > >
> > > > > > my
> > > > > >
> > > > > > > new OrderHed.Date01 field.
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > I cannot figure out how to get the Transit Days data from
> > > > > >
> > > > > > > ShipTo.Number01 to OrderHed.Number01.
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > Can someone shed some light on what I am missing with this
> > > > > >
> > > > > > > Customization?
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > I have pulled information on FKV's from the Epicor website
> > &
> > > I
> > > > am
> > > > > >
> > > > > > > still in the dark about how to transfer this data from one
> > > > table
> > > > > to
> > > > > >
> > > > > > > the next.
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > And how do other people working in Order Entry determine
> > what
> > > > to
> > > > > >
> > > > > > > enter for a "Ship By" date in order to ship the product
> > early
> > > > > >
> > > > > > enough
> > > > > >
> > > > > > > to meet the Customer's Need By Date?
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > I'm in Vantage 8.03.404
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > Lynn
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > >
> > > > > >
> > > > > > > [Non-text portions of this message have been removed]
> > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>