Import new column into G/L Budget Entry
CobaltSS
Member Posts: 137
Hi all,
I've been asked to add a Description to the Excel sheet that gets imported via the Budget -> Import From Excel function that can change line by line. So I've made a few mods.
In the OnAfterGetRecord of BudgetBuf, I've made this mod:
When I disable the Excel Buffer DELETEALL, I reviewed the data and it appears to be stored in the Excel Buffer table properly:
But the G/L Budget Description remains blank. And I don't get any CONFIRM dialogue. In the Excel spreadsheet, the column is called "Description".
Any advice greatly appreciated.
cheers,
I've been asked to add a Description to the Excel sheet that gets imported via the Budget -> Import From Excel function that can change line by line. So I've made a few mods.
-
In table 371 Budget Buffer I've added the field "Description" (text 50).
In report 81, I've added the Text constant "CN_Text001" and assigned it "Description"
In the Analyze Data function of Report 81, I've added the following code (I've included existing code so you can see where it was placed):
Text022:
TempBudgetBuf."Dimension Value Code 8" :=
COPYSTR(
ExcelBuf."Cell Value as Text",
1,MAXSTRLEN(TempBudgetBuf."Dimension Value Code 8"));
// >> CN1.78
CN_Text001:
BEGIN
booOK := CONFIRM('Description: %1', booOK, ExcelBuf."Cell Value as Text");
TempBudgetBuf.Description :=
COPYSTR(
ExcelBuf."Cell Value as Text",
1,MAXSTRLEN(TempBudgetBuf.Description));
END;
// << CN1.78
Text014:
BEGIN
IF TempBudgetBuf."G/L Account No." <> '' THEN BEGIN
In the OnAfterGetRecord of BudgetBuf, I've made this mod:
// >> CN1.78 // original - GLBudgetEntry.Description := Description; GLBudgetEntry.Description := BudgetBuf.Description; // << CN1.78
When I disable the Excel Buffer DELETEALL, I reviewed the data and it appears to be stored in the Excel Buffer table properly:
But the G/L Budget Description remains blank. And I don't get any CONFIRM dialogue. In the Excel spreadsheet, the column is called "Description".
Any advice greatly appreciated.
cheers,
0
Answers
-
I needed to add one more bit of code into the Analyze Data function, as the "header row" checks only look for the G/L Account No, Dimensions, and valid dates (related to the period) (look for the tags - excess code given to show placement):
ExcelBuf."Row No." = HeaderRowNo: BEGIN TempExcelBuf := ExcelBuf; CASE TRUE OF TempDim.FIND('-'): BEGIN TempDim.MARK(FALSE); CountDim := CountDim + 1; IF (CountDim > 8) THEN ERROR(Text008); TempExcelBuf.Comment := Text013 + FORMAT(CountDim); TempExcelBuf.INSERT; DimCode[CountDim] := TempDim.Code; END; EVALUATE(TestDate,ExcelBuf."Cell Value as Text"): BEGIN TempExcelBuf.Comment := Text014; TempExcelBuf.INSERT; END; // >> CN1.78 ExcelBuf."Cell Value as Text" = CN_Text001: BEGIN TempExcelBuf.Comment := CN_Text001; TempExcelBuf.INSERT; END; // << CN1.78 END; END; (ExcelBuf."Row No." > HeaderRowNo) AND (HeaderRowNo > 0):
I hope this proves useful to someone else.
cheers,0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 327 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions