Solved

4GL Table Copy ?

Posted on 2008-10-30
5
543 Views
Last Modified: 2013-12-25
I am using epicor Vantage and i am trying to get one table copy to another.
I have two fields from the same table.

Mfgsys.RcvDtl.PONum
Mfgsys.RcvDtl.Lotnum

For Each RcvDtl Where RcvDtl.Lotnum <> 0
DO: RcvDtl.lotnum = Rcvdtl.PONum

I know that this code doesnt work obviously it totally wrong. but this is what im trying to accomplish. I want The LotNum to Equal the POnum. I only need there the Relationship statment. the program will know how to execute it.
* EDIT*
I had Figured out a Solution my self, and the Code for this to happen is as follows. However

For each ttrcvdtl where ttrcvdtl.RowMod = 'A' and
ttrcvdtl.PONum <> 0:
       assign ttrcvdtl.LotNum = string(ttrcvdtl.PONum).
       end.

I would also like to Add that when the the Supplier Qty is 0 that it would not get a lot number so. this is what i have tried so far but it doesnt Seem to work. If you need more infor on whats happening i will try my best to explain
For Each ttrcvdtl where ttrcvdtl.RowMod = 'A' and

  ttrcvdtl.POnum <> 0 and ttrcvdtlMassRecepitsupplierqty > 0:

       Assign ttrcvdtl.LotNum = string(ttrcvdtl.POnum).

End.

Open in new window

0
Comment
Question by:Collegeguyes
5 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 400 total points
Comment Utility
Collegeguyes,

Can you be more specific as to how this "doesnt Seem to work" ?

Your code seems to be logically correct.

The only problem I noticed is that you missed a "." in your reference to SupplierQty.  On line 2, it seems like:

> ttrcvdtl.POnum <> 0 and ttrcvdtlMassRecepitsupplierqty > 0:

Should be:

ttrcvdtl.POnum <> 0 and ttrcvdtl.MassRecepitsupplierqty > 0:

An undeclared variable, if it does not cause a compile error, will likely default to zero in a numeric comparison.  

For example, if ttrcvdtlMassRecepitsupplierqty is indeed a typo, the condition
ttrcvdtlMassRecepitsupplierqty > 0
will never be met, because the typo ttrcvdtlMassRecepitsupplierqty will be treated as a zero.
0
 
LVL 4

Assisted Solution

by:progressor
progressor earned 100 total points
Comment Utility
Maybe it doesn't seem to work because you have a big table and you are not using an index?
What are the indexes on that table.
If POnum is the first field of an index and cannot be negative then change <> 0 for > 0. That would at least help progress finding the right ( or an ) index.

Casper
0
 

Author Closing Comment

by:Collegeguyes
Comment Utility
JUst wanted to say thanks for you input i Actually Changed the way that i wrote the table in the end so the question is now void.
for each ttrcvdtl where ttrcvdtl.RowMod = 'A' and

                        ttrcvdtl.PONum <> 0 and ttrcvdtl.vendorqty = ttrcvdtl.OurQty.

                       

If ttrcvdtl.CheckBox01 = false THEN do:

Assign ttrcvdtl.lotnum = string(ttrcvdtl.POnum).

end.

If ttrcvdtl.checkbox01 = true then do:

Assign ttrcvdtl.lotnum = "".

end.

 

end.

 

0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now