I have a situation where I'm trying to dataport some information in to create sales orders.
I initially set up my dataport to have two dataitems (sales header and sales lines), and set up some variables to assist with the validation.
The problem I'm having is that we are using 4 dimensions and I need all 4 in order to be able to post the sales order.
The first two dimensions (globals) are on the sales order header and line but the other two are on the document dimension table.
I don’t want to have to read in the information for the other two dimensions on the input file, as it is always the same.
I assume I will need to create a variable with the information for the document dimension table. This is no problem. However, where do I put the code to get the information populated into the document dimension table? Would it go in the OnAfterRecord section, and if so, for what dataitem?
Do I need to put document dimension into the dataitem area of the dataport, even though I am not reading in any fields related to it?
So far, all my experimentation has not worked.
Hope this makes sense, and thanks in advance for any help.
0
Comments
are these other two dimensions filled in on the sales header? If so & they are always the same just add it to you OnAfterGetRecord
Dimension 3 := whaterver
dimension 4 := whatever
if it's on both sales line & sales header you can add it to both dataitems.
http://www.BiloBeauty.com
http://www.autismspeaks.org
the other two dimensions are not on the header. In the sales order form, they show on the lines, but they are actually on table 357, not on the sales order line.
GLSetup - Record -"General Ledger Setup"
DimValue - Record - "Dimension Value"
DocDims - Record - "Document Dimensions"
DimCode - Code - 10 [Array Dimensions 8]
LineDims - Code - 20 [Array Dimensions 8]
i integer
Pre Dataport Code:
Add LineDims[1] to LineDims[8] to the dataport Import line fields, it does not matter how many dimensions you bring in, and blanks will not error.
On Before Import remember to INIT the sales line and CLEAR(LineDims);
Sales Line After Import and after assigning the "line No."call the function CreateDims()
Function:
We use the IF statement because when you validate the accounts some dims are created, and duplicate would cause an error, so optional Code:
This could be changed to:
IF NOT DocDim.INSERT THEN
DocDim.MODIFY;
That ends the lesson for today!
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
read your post again, if the data is static for all lines, and does not have to be in the Import then insert them into the Document Dimensions Table, DataItem "Sales Line" and OnAfterImportRecord(). use some the code above.
I will leave the full previous post as it may help someone else!
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
I also import Sales Header & Sales Lines in one dataport. And I see all the dimensions in the table & i'm not even entering anything. Perhaps your not validating the proper fields on import????
How are those other field usually filled in, manually?
old version of my dataport is here
http://www.mibuso.com/forum/viewtopic.php?t=8753
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thats the way I read it, but if there is a dimension one to one, then setup the Defaults Dimensions on the various accounts, and you will not need to use any code.
Note:
The Customer Default Dimensions, will populate in the header as you validate the "Sell-to Customer", these will copy to the line, when you create the "Sales Line", when you Validate the line "No." field, this also copies Default Dimensions from Item, G/L Account etc:
The code above is to add Non Default Dimensions that the user might do manually as they create the Sales Lines.
This would be used more on the Purchase Side, for say a expenses or utillity bills that has several lines to the same "G/L Account" where you are using a mandatory dimension to assign values to different Departments (Cost Centres).
David
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com