Monday, January 11, 2016

Create Code128 Bar Code in NAV 2009

Hi all,
Today I posted how you can Create Code128 Bar Code.

//------Define parameter-------->>
Var Name DataType Subtype Length
No CodeString Text 250
//<<------------END-------------------

//------Define Return Value-------->>
Name 128BCodeString
Return Type Text
Length 250
//<<------------END-------------------

//------Define Variables-------->>
Name DataType Subtype Length
Offset Integer
HighAscii Integer
Total Integer
iCounter Integer
Holder Integer
Check Integer
ASCIIValue Integer
CheckDigit Integer
Character Char
//<<------------END-------------------

//------Define Functions-------------->>
CreateCode128BFont(CodeString : Text[250]) "128BCodeString" : Text[250]
//--------------START----------------->>
CLEAR(Offset);
CLEAR(HighAscii);
CLEAR(Total);
CLEAR(iCounter);
CLEAR(Holder);
CLEAR(Check);
CLEAR(Character);
CLEAR(ASCIIValue);
CLEAR(CheckDigit);

Offset := 32;
HighAscii := 66;
"128BCodeString"[1] := Offset + HighAscii + 104;
Total := 104;

FOR iCounter := 1 TO STRLEN(CodeString) DO BEGIN
  Character := CodeString[iCounter];
  ASCIIValue := Character;
  CheckDigit := ((ASCIIValue - Offset) * (iCounter));
  Total += CheckDigit;
  "128BCodeString"[iCounter + 1] := ASCIIValue;
END;
Check := Total MOD 103;
Holder := 0;

IF (Check + Offset >= 127) THEN
  Holder := Check + Offset + HighAscii
ELSE
  Holder := Check + Offset;


"128BCodeString"[STRLEN("128BCodeString")+1] := Holder;
Holder := 106 + Offset + HighAscii;
"128BCodeString"[STRLEN("128BCodeString")+1] := Holder;

CLEAR(iCounter);
FOR iCounter := 1 TO STRLEN("128BCodeString") DO
  IF("128BCodeString"[iCounter] = 32) THEN
    "128BCodeString"[iCounter] := 177;

EXIT("128BCodeString");
//<<----------------END-------------------


Thanks & Best Wishes
Binesh Singh Rajput
(MCP, MS, MCTS)

Thursday, January 7, 2016

Get the days that are not holiday or weekend

Hi all,
Today I posted how you can Get the days that are not holiday or weekend.

// Get the days that are not holiday or weekend
//-----Define Local Parameters---------
{
Var Name DataType Subtype Length
No StartDate Date
No EndDate Date
//-----Define Return type---------
Name WorkDays
ReturnType Integer
//-----Define Local variabls---------
Name DataType Subtype Length
DateRec Record Date [where Table ID: 2000000007]
HolidayRec Record Shop Calendar Holiday     [where Table ID: 99000753]
}
//-----Define Function---------
GetWorkingDays(StartDate : Date;EndDate : Date) WorkDays : Integer
// Strat ---------------------->>
WorkDays := 0;
DateRec.RESET;
HolidayRec.RESET;

DateRec.SETRANGE("Period Type",DateRec."Period Type"::Date);
DateRec.SETRANGE("Period Start",StartDate,EndDate);
DateRec.SETRANGE("Period No.",1,5);  // Get only weekdays
IF DateRec.FINDFIRST THEN
  REPEAT
    IF NOT HolidayRec.GET('HLP',DateRec."Period Start") THEN
      WorkDays += 1;
  UNTIL DateRec.NEXT = 0;
EXIT(WorkDays);
// End <<------------------------


Thanks & Best Wishes
Binesh Singh Rajput
(MCP, MS, MCTS)


Monday, December 28, 2015

All Virtual Tables in Microsoft Dynamics NAV 2016

Hi all,
Today I posted All Virtual Tables in Microsoft Dynamics NAV 2016,

Table No.
Table Name
2000000001
Object
2000000007
Date
2000000009
Session
2000000020
Drive
2000000022
File
2000000024
Monitor
2000000026
Integer
2000000028
Table Information
2000000029
System Object
2000000038
AllObj
2000000039
Printer
2000000040
License Information
2000000041
Field
2000000042
OLE Control
2000000043
License Permission
2000000044
Permission Range
2000000045
Windows Language
2000000046
Automation Server
2000000047
Server
2000000048
Database
2000000049
Code Coverage
2000000055
SID - Account ID
2000000058
AllObjWithCaption
2000000063
Key
2000000070
Error List
2000000101
Debugger Call Stack
2000000102
Debugger Variable
2000000103
Debugger Watch Value
2000000135
Table Synch. Setup
2000000136
Table Metadata
2000000137
CodeUnit Metadata
2000000138
Page Metadata
2000000139
Report Metadata
2000000140
Event Subscription
2000000141
Table Relations Metadata
2000000164
Time Zone
2000000167
Aggregate Permission Set


Popular Posts