Problem with bit data type of SQL in NAV 2009

havhav Member Posts: 299
edited 2009-03-26 in NAV Three Tier
Hi all,
I have use-case mentioned below for resolving my problem.
WMDATA db. //3rd party database
Table --> WMProductionBatch
Column --> Issued
Data type --> bit
NAVDATA db. //NAV demo database
Linked Table --> WMProductionBatch
Column --> Issued
Data type --> Integer
A tabular form 'ProductionBatches' is created for WMProductionBatch linked table in NAV.
A menubuttion "Production Batch" is added to this form having menuitem as 'Card'.
The Card menu-item has OnPush() trigger defined as below:
Card-OnPush()
{
   TestUnit.OpenProductionBatch(Rec);
   //where TestUnit is a codeunit
   //Rec is a record variable of type WMProductionBatch linked table
}
The function is defined as below:
OpenProductionBatch(VAR WMProductionBatch : Record WMProductionBatch)
{
   //IssuedBefore is of type Integer
   //IssuedAfter is of type Integer
   IssuedBefore := WMProductionBatch.Issued;

   //do some processing on batch
   .....................

   CLEAR(WMProductionBatch);

   //Check if batch is issued
   IF WMProductionBatch.GET(LocNo, BatchNo) THEN    
   [color=#FF0000]IssuedAfter := WMProductionBatch.Issued;[/color]
   IF (IssuedBefore = 0) AND (IssuedAfter = 1) THEN
         //do some task
}
The problem i face is that when i process the batch, the Issued column (bit type) in WMDATA db. changes from 0 to 1.
This means that the mapping Issued column in NAVDATA db. should change from 0 to 1. But what happens actually is that when
IssuedAfter := WMProductionBatch.Issued;
is executed, the var. IssuedAfter (of type Integer) does not contain the current value as 1.

I tried debugging in VS2005 but i didn't got any idea as to why the bit value is not assigned to Integer value.

I need some help to resolve this.

Thanks
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)

Comments

  • havhav Member Posts: 299
    Any help relating this problem will be appreciated.

    Regards,
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • strykstryk Member Posts: 645
    Have you set the property "LinkedInTransaction" to "Yes" of your "Linked Object" table?
    Jörg A. Stryk (MVP - Dynamics NAV)
    NAV/SQL Performance Optimization & Troubleshooting
    STRYK System Improvement
    The Blog - The Book - The Tool
  • havhav Member Posts: 299
    No.
    The LinkedInTransaction property is set to No.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • strykstryk Member Posts: 645
    If you set it to "Yes", does it work then?
    Jörg A. Stryk (MVP - Dynamics NAV)
    NAV/SQL Performance Optimization & Troubleshooting
    STRYK System Improvement
    The Blog - The Book - The Tool
Sign In or Register to comment.