Copy dimensions from
jme
Member Posts: 3
I have a question about advanced job management
I want to add the functionality to copy the dimensions which are set on the Job qoute to a Job.
I added this code but it not working
note that iRecJob = Job Quote and lRecJob is the Job.
IF lRecJob.GET(iRecJob."No.") THEN BEGIN
lRecJob.VALIDATE("Global Dimension 1 Code",iRecJob."Global Dimension 1 Code");
lRecJob.VALIDATE("Global Dimension 2 Code",iRecJob."Global Dimension 2 Code");
lRecJob.MODIFY();
END;
Can anyone help please?
thanks in advance
Joran van de Mast
I want to add the functionality to copy the dimensions which are set on the Job qoute to a Job.
I added this code but it not working
note that iRecJob = Job Quote and lRecJob is the Job.
IF lRecJob.GET(iRecJob."No.") THEN BEGIN
lRecJob.VALIDATE("Global Dimension 1 Code",iRecJob."Global Dimension 1 Code");
lRecJob.VALIDATE("Global Dimension 2 Code",iRecJob."Global Dimension 2 Code");
lRecJob.MODIFY();
END;
Can anyone help please?
thanks in advance
Joran van de Mast
0
Comments
-
Could have to do with where you placed your code. It's very easy for something to come along and change the values, especially dimensions, after your code has executed.
Go through the debugger, as painful as it is, and see if that is the case.0 -
I have solved the problem for you
see the code here below
WITH lRecDefaultDim DO BEGIN
SETRANGE("Table ID", DATABASE::Job);
SETRANGE("No.", iJobNoFrom);
IF FINDSET THEN BEGIN
REPEAT
lRecDefaultDim2 := lRecDefaultDim;
lRecDefaultDim2."No." := iJobNoTo;
lRecDefaultDim2.INSERT();
UNTIL NEXT = 0;
END;
END;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
- 333 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
