Monday, March 21, 2011

Combining jQuery Deferred with the HTML5 Web Workers API

Long running calculations in JavaScript are generally a bad idea. This is because JavaScript is a single-threaded environment; anything we do takes place on the UI thread, and when a script is running, the UI is unresponsive. To prevent this happening all the time, browsers have implemented various warning messages that allow the user to stop execution after a certain threshold.

Bezier curve for the Microsoft Web Chart control

 The Microsoft Web Chart control (which is actually the Dundas chart control) is a powerful control..


Wednesday, March 16, 2011

JD Edwards Batch and Company Within Batch Out of Balance

Sometime its dificult to find wich batch is making company out of balance , in order to find this you have to run following program for that company
R09706,

Tuesday, March 15, 2011

JD Edwards fix onhand quantity in F41021 from F4111

SELECT a.LOCN,a.MCU,a.ITM,PQOH,TRQT into zdev.dbo.temp_pqoh
FROM
(SELECT MCU=LTRIM(RTRIM(LIMCU)),ITM=CAST(LIITM as INT),PQOH=SUM(LIPQOH),LOCN=LILOCN
   FROM JDE_PRODUCTION.PRODDTA.F41021
   GROUP BY LIMCU,LILOCN, LIITM) a INNER JOIN
       (SELECT LOCN=ILLOCN, MCU=LTRIM(RTRIM(ILMCU)),ITM=CAST(ILITM as INT),TRQT=SUM(ILTRQT)
               FROM JDE_PRODUCTION.PRODDTA.F4111
                        GROUP BY ILMCU,ILLOCN,ILITM) b ON a.ITM=b.ITM AND a.MCU=b.MCU and a.LOCN=b.LOCN
                        WHERE PQOH!=TRQT
                             ORDER BY 1,2

select * from zdev.dbo.temp_pqoh

--drop table zdev.dbo.temp_pqoh
select lipqoh,TRQT,liitm,itm,lilocn,locn
--UPDATE proddta.f41021 SET lipqoh =trqt
from proddta.f41021
INNER JOIN zdev.dbo.temp_pqoh  on liITM=itm and rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and lilocn=locn
where rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and liITM=itm  and lilocn=locn and
rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and lipqoh<>trqt
 

 

Join and update F41021 PQOH field

select ilmcu,ilitm,illocn,sum(iltrqt) TRQT  into QOH_USA
from proddta.f4111
where ilmcu like '% USA'
group by ilmcu,ilitm,illocn
order by ilmcu,ilitm,illocn
 
select * from proddta.f4111 where ilmcu ='         tor'
--UPDATE proddta.f41021 SET lipqoh =trqt
select lipqoh,TRQT,*
from proddta.f41021
INNER JOIN QOH_USA on ilITM=liitm and rtrim(ltrim(limcu))=rtrim(ltrim(ilmcu)) and illocn=lilocn
where rtrim(ltrim(limcu))=rtrim(ltrim(ilmcu)) and ilITM=liitm  and illocn=lilocn and
limcu   = '         USA'  and lipqoh<>trqt
select lipqoh,TRQT,*
--UPDATE proddta.f41021 SET lipqoh =trqt
from proddta.f41021
INNER JOIN QOH_SHYE on ilITM=liitm and rtrim(ltrim(limcu))=rtrim(ltrim(ilmcu))
where rtrim(ltrim(limcu))=rtrim(ltrim(ilmcu)) and ilITM=liitm  and illocn=lilocn and
limcu   = '        SHYE' and lipqoh<>trqt
 

--UPDATE jde_production.proddta.f4102 SET ibprp1 =imprp1
--select imlitm,imprp1,ibprp1,iblitm,ibmcu
from jde_production.proddta.f4102
left outer JOIN jde_production.proddta.f4101 on imitm=ibitm
where iblitm is not null and imprp1='ETC'

 

JD Edwards Date Calculate Julian Calendar etc

--Normal Date to Julian Date
declare @rpdivj as int
declare @datea as datetime
set @rpdivj='102015'
set @datea= DATEADD(dy, @rpdivj % 1000, DATEADD(yy, @rpdivj / 1000,-1))
print DATEADD(dy, @rpdivj % 1000, DATEADD(yy, @rpdivj / 1000, -1))
print DATEPART(month, @datea)
print DATEPART(day, @datea)
print DATEPART(year, @datea)

--Julian Date to Normal Date
        declare @y as varchar(10)
        declare @dy as varchar(10)       
        declare @date1 as datetime       
        declare @szupmj as varchar(10)
      set @date1= getdate()--'10/01/02'
--        set @date1= '10/1/2002'
 set @y =(datepart(yy,@date1) - 1900) * 1000;
 set @dy = datepart(dy,@date1);
 set @szupmj = @y + cast(@dy as int);
        print  'Date ====>>> '+ @szupmj
in Select Statement
DATEADD(dy, cast(SDTRDJ as varchar(10)) % 1000, DATEADD(yy, cast(SDTRDJ as varchar(10)) / 1000,-1))
select (datepart(yy,getdate()) - 1900) * 1000+ cast(datepart(dy,getdate())as int)
select CONVERT(CHAR(15),GETDATE(),101)
CONVERT(CHAR(10),DATEADD(dy, cast(pDTRDJ as varchar(10)) % 1000, DATEADD(yy, cast(PDTRDJ as varchar(10)) / 1000,-1)),101) OHDate
SELECT DATEPART(Week, getdate())

Wednesday, March 9, 2011

Find form/Application type in JDE E1

Many developer wants to know how to get a particular form application like power form , portlet form etc, you can use following steps to find them:-
 
Go at UDC->98/ft to find form type

Go to UTB ->F9865 browse put form type(eg PT ->Portlet etc) SWFMPT, click on find

Example FDA Portlets Forms JD Edwards

  • P42S05 Sales Order Status
  • P42S03 Account Information Alerts
  • P07PTLET Payroll Portlets
  • P43S801 Supplier Self Service Search
  • JD Edwards report for Order transfer to the warehouse

    Listing of ER for Report: Report : Data-   [V] (R554268I)

    ***********************************************************************
         GLOBALS: Global Variables [V]
    ***********************************************************************
         rpt_DocumentOrderInvoiceE
         rpt_OrderType
         rpt_ABShipTo_Owner
         rpt_NameGiven
         rpt_NameSurname
         rpt_LineNumber
         rpt_PhoneNumberType
         rpt_PhoneAreaCode1
         rpt_PhoneNumber
         rpt_SequenceNumber70
         rpt_Count
         rpt_Count1
         rpt_CompanyKeyOrderNo
         rpt_StatusCodeNext
         rpt_LineType
         rpt_StatusCodeLast
         rpt_CompanyKeyOrderNo_Header
         rpt_LineNumberHeader
         rpt_UnitOfMeasure_1
         rpt_UnitOfMeasure_2
         rpt_RelatedUnitOfMeasure_1
         rpt_RelatedUnitOfMeasure_2
         rpt_ConversionFactor_1
         rpt_ConversionFactor_2
         rpt_DateBeginningEffective
         rpt_ReportCodeAddBook009
         rpt_ReportCodeAddBook008
         rpt_GroupUnitOfMeasure
         rpt_LineNumberDetail
         rpt_GroupUnitOfMeasureH1
         rpt_GroupUnitOfMeasureH2
         rpt_GroupUnitOfMeasureH3
         rpt_DateForDataExtr
         rpt_CountWOConf
         rpt_CallDetailWO_CF
         rpt_GT_DateForConf
         rpt_DateRequested_detail
         rpt_Qty_ship_C1
         rpt_Qty_ship_C2
         rpt_Qty_ship_C3
         rpt_ShippingConditionsCode_1
         rpt_AC03_YN
         rpt_AC07YN
         rpt_TimeLastUpdated
         rpt_CountLineNumber
         rpt_CountLineNumberTot
         rpt_QuantityTimeSeries01
         rpt_QuantityTimeSeries02
         rpt_QuantityTimeSeries03

    =======================================================================
         SECTION: F4201 + F0101 + F0116 on  SHAN [GROUP SECTION] ()
    =======================================================================
         OBJECT:  SECTION
         EVENT:  Initialize Section [V]
    -----------------------------------------------------------------------
    0001 VA rpt_CountLineNumber = 0
    0002 VA rpt_DateForDataExtr = add_days(date_today(),1)
    0003 Set Selection Append Flag( <Yes>)
    0004 Set User Selection(BC Date - Requested (F4201),  <Less Than or Equal To>, VA rpt_DateForDataExtr,  <None>)

    -----------------------------------------------------------------------
         EVENT:  Do Section [V]
    -----------------------------------------------------------------------
    0001 VA rpt_Count = 0
    0002 VA rpt_CountLineNumber = 1
    0003 ! RV RL5 = "."
    0004 RV SHC5 = "."
    0005 //
    0006 VA rpt_CountWOConf = 0
    0007 VA rpt_CallDetailWO_CF = ""
    0008 //
    0009 VA rpt_DocumentOrderInvoiceE = 0
    0010 VA rpt_OrderType = ""
    0011 VA rpt_StatusCodeLast = ""
    0012 VA rpt_StatusCodeNext = ""
    0013 VA rpt_StatusCodeNext = ""
    0014 VA rpt_DateRequested_detail = ""
    0015 ! VA rpt_Count = 0
    0016 VA rpt_ReportCodeAddBook009 = ""
    0017 VA rpt_ReportCodeAddBook008 = ""
    0018 RV From_MCU = BC Business Unit (F4201)
    0019 //
    0020 F4211.Fetch Single
            VA rpt_CompanyKeyOrderNo_Header <- TK Order Company (Order Number)
            BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
            BC Order Type (F4201) =  TK Order Type
            VA rpt_LineNumberHeader <- TK Line Number
            VA rpt_DateRequested_detail <- TK Date - Requested
            VA rpt_LineType <- TK Line Type
            VA rpt_StatusCodeNext <- TK Status Code - Next
            VA rpt_StatusCodeLast <- TK Status Code - Last
            RV SHC3 <- TK Route Code
    0021 While SV File_IO_Status is equal to CO SUCCESS
    0022    If VA rpt_LineType is equal to "S"
            And VA rpt_StatusCodeNext is equal to "540"
            And VA rpt_StatusCodeLast is not equal to "980"
    0023       F5542324.Fetch Single
                  VA rpt_CompanyKeyOrderNo_Header =  TK Order Company (Order Number)
                  BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
                  BC Order Type (F4201) =  TK Order Type
                  VA rpt_LineNumberHeader =  TK Line Number
    0024       If SV File_IO_Status is equal to CO SUCCESS
    0025       Else
    0026          VA rpt_Count = 1+[VA rpt_Count]
    0027          VA rpt_CountWOConf = VA rpt_Count
    0028          //
    0029          VA rpt_DocumentOrderInvoiceE = BC Document (Order No, Invoice, etc.) (F4201)
    0030          VA rpt_OrderType = BC Order Type (F4201)
    0031          VA rpt_CompanyKeyOrderNo = BC Document Company (Original Order) (F4201)
    0032          //
    0033       End If
    0034    Else
    0035    End If
    0036    F4211.Fetch Next
               VA rpt_CompanyKeyOrderNo_Header <- TK Order Company (Order Number)
               BC Document (Order No, Invoice, etc.) (F4201) <- TK Document (Order No, Invoice, etc.)
               BC Order Type (F4201) <- TK Order Type
               VA rpt_LineNumberHeader <- TK Line Number
               VA rpt_DateRequested_detail <- TK Date - Requested
               VA rpt_LineType <- TK Line Type
               VA rpt_StatusCodeNext <- TK Status Code - Next
               VA rpt_StatusCodeLast <- TK Status Code - Last
    0037 End While
    0038 //
    0039 // Date Requested
    0040 ! RV DRQJ_Detail = VA rpt_DateRequested_detail
    0041 RV DRQJ_Detail = BC Date - Requested (F4201)
    0042 //
    0043 // End Date Requested
    0044 VA rpt_GroupUnitOfMeasureH1 = ""
    0045 VA rpt_GroupUnitOfMeasureH2 = ""
    0046 VA rpt_GroupUnitOfMeasureH3 = ""
    0047 VA rpt_QuantityTimeSeries03 = 0
    0048 VA rpt_QuantityTimeSeries02 = 0
    0049 VA rpt_QuantityTimeSeries01 = 0
    0050 F5541261.Fetch Single
            BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
            BC Order Type (F4201) =  TK Order Type
            VA rpt_QuantityTimeSeries01 <- TK Quantity - Time Series 01
            VA rpt_QuantityTimeSeries02 <- TK Quantity - Time Series 02
            VA rpt_QuantityTimeSeries03 <- TK Quantity - Time Series 03
            VA rpt_GroupUnitOfMeasureH1 <- TK Group - Unit of Measure (Level 1)
            VA rpt_GroupUnitOfMeasureH2 <- TK Group - Unit of Measure (Level 2)
            VA rpt_GroupUnitOfMeasureH3 <- TK Group - Unit of Measure (Level 3)
    0051 If SV File_IO_Status is equal to CO SUCCESS
    0052    //
    0053    If VA rpt_QuantityTimeSeries01 is equal to <Zero>
            And VA rpt_QuantityTimeSeries02 is equal to <Zero>
            And VA rpt_QuantityTimeSeries03 is equal to <Zero>
    0054       VA rpt_Count = 0
    0055    Else
    0056    End If
    0057 Else
    0058    // 092804
    0059    If VA rpt_CountWOConf is not equal to <Zero>
    0060       VA rpt_CallDetailWO_CF = "99999"
    0061    Else
    0062    End If
    0063    // End 092804
    0064    VA rpt_Count = 0
    0065 End If
    0066 //
    0067 // End F5541261
    0068 //
    0069 //
    0070 F554247T.Fetch Single
            BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
    0071 If SV File_IO_Status is equal to CO SUCCESS
    0072 Else
    0073    VA rpt_Count = 0
    0074 End If
    0075 //
    0076 //
    0077 // Order Status
    0078 RV OrderStatus = "N"
    0079 //
    0080 // 112304
    0081 // Commented - Header Line Was Missing
    0082 F5542324.Fetch Single
            BC Order Company (Order Number) (F4201) =  TK Order Company (Order Number)
            BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
    0083 If SV File_IO_Status is equal to CO SUCCESS
    0084    VA rpt_Count = 0
    0085    Suppress Section Write
    0086 Else
    0087 !    RV OrderStatus = "N"
    0088 End If
    0089 // 112304
    0090 //
    0091 // File F5541261 Test For Conf.
    0092 //
    0093 //
    0094 //
    0095 // Start IF For Cancled Line
    0096 //
    0097 If VA rpt_Count is not equal to <Zero>
    0098    // Ship To BP
    0099    F41001.Fetch Single
               RV Shipto_MCU <- TK Business Unit
               BC Address Number - Ship To (F4201) =  TK Address Number
    0100    // End Ship To BP
    0101    // Ship To Name
    0102    VA rpt_LineNumber = 0
    0103    F0111.Fetch Single
               BC Address Number - Ship To (F4201) =  TK Address Number
               VA rpt_LineNumber =  TK Who's Who Line Number - ID
               VA rpt_NameGiven <- TK Name - Given
               VA rpt_NameSurname <- TK Name - Surname
    0104    RV ShipOwnerName = concat(concat(rtrim([VA rpt_NameGiven],' ')," "),ltrim([VA rpt_NameSurname],' '))
    0105    // End Ship To Name
    0106    //
    0107    // Phone No
    0108    VA rpt_PhoneAreaCode1 = " "
    0109    VA rpt_PhoneNumber = " "
    0110    VA rpt_SequenceNumber70 = 1
    0111    VA rpt_LineNumber = 0
    0112    RV PhoneNo = " "
    0113    F0115.Fetch Single
               BC Address Number - Ship To (F4201) =  TK Address Number
               VA rpt_LineNumber =  TK Who's Who Line Number - ID
               VA rpt_SequenceNumber70 =  TK Line Number ID - 5.0
               VA rpt_PhoneAreaCode1 <- TK Phone Prefix
               VA rpt_PhoneNumber <- TK Phone Number
    0114    If VA rpt_PhoneAreaCode1 is equal to <Blank>
    0115       RV PhoneNo = [VA rpt_PhoneNumber]
    0116    Else
    0117       RV PhoneNo = concat(concat(rtrim([VA rpt_PhoneAreaCode1],' '),"-"),ltrim([VA rpt_PhoneNumber],' '))
    0118    End If
    0119    //
    0120    // End Phone No
    0121    //
    0122 !    RV PhoneNo = ltrim([VA rpt_PhoneNumber],' ')
    0123    VA rpt_DocumentOrderInvoiceE = BC Document (Order No, Invoice, etc.) (F4201)
    0124    VA rpt_OrderType = BC Order Type (F4201)
    0125    VA rpt_CompanyKeyOrderNo = BC Document Company (Original Order) (F4201)
    0126    RV OrderDate_1 = concat(concat(concat(concat(lpad(date_month([BC Date - Order/Transaction (F4201)]),'0',2),"/"),lpad(date_day([BC Date - Order/Transaction (F4201)]),'0',2)),"/"),date_year([BC Date - Order/Transaction (F4201)]))
    0127    RV DateRequested = concat(concat(concat(concat(lpad(date_month([BC Date - Requested (F4201)]),'0',2),"/"),lpad(date_day([BC Date - Requested (F4201)]),'0',2)),"/"),date_year([BC Date - Requested (F4201)]))
    0128    RV SHC6_MCU = [BC Business Unit (F4201)]
    0129    Add a Carrige Return to String
               RV CarriageRet <> szString
    0130    //
    0131    // Else Testing Next Status
    0132    // No of Records
    0133    VA rpt_CountLineNumberTot = [VA rpt_CountLineNumberTot]+[VA rpt_CountLineNumber]
    0134 Else
    0135    Suppress Section Write
    0136    // 092804
    0137 !    VA rpt_DocumentOrderInvoiceE = 0
    0138 !    VA rpt_OrderType = ""
    0139 !    VA rpt_StatusCodeLast = ""
    0140 !    VA rpt_StatusCodeNext = ""
    0141 !    VA rpt_StatusCodeNext = ""
    0142 !    VA rpt_Count = 0
    0143    // 092804
    0144 End If
    0145 // End Testing Next Status
    0146 // 11/29/2004 ===== Ship To Address From F4008
    0147 F4006.Fetch Single
            BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
            BC Order Type (F4201) =  TK Order Type
    0148 If SV File_IO_Status is equal to CO SUCCESS
    0149    F4006.Fetch Single
               BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
               BC Order Type (F4201) =  TK Order Type
               BC Name - Alpha (F0101) <- TK Name - Mailing
               BC Address Line 1 (F0116) <- TK Address Line 1
               BC Address Line 2 (F0116) <- TK Address Line 2
               BC Postal Code (F0116) <- TK Postal Code
               BC City (F0116) <- TK City
               BC State (F0116) <- TK State
               BC Country (F0116) <- TK Country
    0150 Else
    0151 End If
    0152 //
    0153 //
    0154 //
    0155 // End        11/29/2004 ===== Ship To Address From F4008
    0156 RV SHC7_AN8 = [BC Address Number (F4201)]
    0157 F0101.Fetch Single
            BC Address Number (F4201) =  TK Address Number
            RV AN8_CompanyName <- TK Name - Alpha
            VA rpt_DateBeginningEffective <- TK Date - Beginning Effective
    0158 F0116.Fetch Single
            BC Address Number (F4201) =  TK Address Number
            VA rpt_DateBeginningEffective =  TK Date - Beginning Effective
            RV AN8_Add1 <- TK Address Line 1
            RV AN8_Add2 <- TK Address Line 2
            RV AN8_Zip <- TK Postal Code
            RV AN8_City <- TK City
            RV AN8_State <- TK State
            RV AN8_Country <- TK Country
    0159 // Address Book - ShipTo
    0160 //
    0161 ! If BC Address Number (F4201) is equal to "296091,356091"
    0162    F550145.Fetch Single
               BC Company (F4201) =  TK Order Company (Order Number)
               BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
               BC Order Type (F4201) =  TK Order Type
    0163    If SV File_IO_Status is equal to CO SUCCESS
    0164       F550145.Fetch Single
                  BC Company (F4201) =  TK Order Company (Order Number)
                  BC Document (Order No, Invoice, etc.) (F4201) =  TK Document (Order No, Invoice, etc.)
                  BC Order Type (F4201) =  TK Order Type
                  RV SHAN_AC03 <- TK Category Code - Address Book 01
                  RV SHAN_AC04 <- TK Category Code - Address Book 02
                  RV SHAN_AC05 <- TK Category Code - Address Book 03
                  RV SHAN_AC06 <- TK Category Code - Address Book 04
                  RV SHAN_AC07 <- TK Category Code - Address Book 05
                  RV SHC4 <- TK Category Code - Address Book 06
                  RV ShipOwnerName <- TK Name - Alpha
                  RV PhoneNo <- TK Phone Number
                  RV SHAN_AC08 <- TK Delivery Instructions Line 1
                  RV SHAN_AC09 <- TK Delivery Instructions Line 2
                  RV SHAN_DEL1 <- TK Description 10
                  RV SHAN_DEL2 <- TK Automatic Accounting Inst Purpose
                  RV CompName_01A <- TK Company Name - ACHA
                  RV Add1_01A <- TK Address Line 1
                  RV Add2_01A <- TK Address Line 2
                  RV City_01A <- TK City
                  RV State_01A <- TK State
                  RV Zip_01A <- TK Postal Code
                  RV Counrty_01A <- TK Country
    0165    Else
    0166 !    Else
    0167       F03012.Fetch Single
                  BC Address Number - Ship To (F4201) =  TK Address Number
                  RV SHAN_DEL1 <- TK Delivery Instructions Line 1
                  RV SHAN_DEL2 <- TK Delivery Instructions Line 2
                  RV SHAN_AC03 <- TK Category Code - Address Book 03
                  RV SHAN_AC04 <- TK Category Code - Address Book 04
                  RV SHAN_AC05 <- TK Category Code - Address Book 05
                  RV SHAN_AC06 <- TK Category Code - Address Book 06
                  RV SHAN_AC07 <- TK Category Code - Address Book 07
                  VA rpt_ReportCodeAddBook008 <- TK Category Code - Address Book 08
                  VA rpt_ReportCodeAddBook009 <- TK Category Code - Address Book 09
    0168       Get UDC Description
                  UNDEFINED X szDataDictionaryItem
                  "01" -> szSystemCode
                  "08" -> szUserDefinedCodes
                  UNDEFINED X cUserDefinedCode
                  VA rpt_ReportCodeAddBook008 -> szUserDefinedCode
                  RV SHAN_AC08 <- szDescription01
                  UNDEFINED X szDescription02
                  UNDEFINED X cErrorCode
                  UNDEFINED X szSpecialHandlingCode
    0169       Get UDC Description
                  UNDEFINED X szDataDictionaryItem
                  "01" -> szSystemCode
                  "09" -> szUserDefinedCodes
                  UNDEFINED X cUserDefinedCode
                  VA rpt_ReportCodeAddBook009 -> szUserDefinedCode
                  RV SHAN_AC09 <- szDescription01
                  UNDEFINED X szDescription02
                  UNDEFINED X cErrorCode
                  UNDEFINED X szSpecialHandlingCode
    0170    End If
    0171 ! End If
    0172 //
    0173 RV SHAN_WH_Pro = "1"
    0174 RV SHAN_Pallet = "1"
    0175 //
    0176 ! Add a Carrige Return to String
         !    RV SHC5 <> szString
    0177 //
    0178 // Carrier No
    0179 RV CarrierNo = BC Carrier Number (F4201)
    0180 F0101.Fetch Single
            RV CarrierNo =  TK Address Number
            RV Carr_ALPH <- TK Name - Alpha
    0181 //
    0182 // PO No.
    0183 RV PONO1 = BC Reference (F4201)
    0184 //
    0185 //
    0186 //

    -----------------------------------------------------------------------
         EVENT:  Init Break Section [V]
    -----------------------------------------------------------------------
    0001 ! If VA rpt_Count is not equal to <Zero>
    0002 !    Do Custom Section(RS Union F4211 & F42119 -All Fields)
    0003 ! Else
    0004 ! End If

    -----------------------------------------------------------------------
         EVENT:  End Break Section [V]
    -----------------------------------------------------------------------
    0001 //
    0002 //
    0003 //
    0004 F03012.Fetch Single
            BC Address Number - Ship To (F4201) =  TK Address Number
            VA rpt_AC03_YN <- TK Category Code - Address Book 03
            VA rpt_AC07YN <- TK Category Code - Address Book 07
    0005 ! VA rpt_CallDetailWO_CF = "99999"
    0006 If VA rpt_CallDetailWO_CF is equal to "99999"
    0007    If BC Order Type (F4201) (DCTO) is equal to "S6,SW"
    0008       F5542528.Insert
                  BC Document (Order No, Invoice, etc.) (F4201) -> TK Document (Order No, Invoice, etc.)
                  BC Order Type (F4201) -> TK Order Type
                  BC Address Number (F0101) -> TK Address Number
                  BC Address Number - Ship To (F4201) -> TK Address Number - Ship To
                  BC Date - Order/Transaction (F4201) -> TK Date - Order/Transaction
                  VA rpt_AC03_YN -> TK Category Code - Address Book 03
                  VA rpt_AC07YN -> TK Category Code - Address Book 07
                  SL UserID                          -> TK User ID
                  SL DateToday                       -> TK Date - Updated
    0009    End If
    0010    Do Custom Section(RS Union F4211 & F42119 -All Fields)
    0011 Else
    0012    If VA rpt_Count is not equal to <Zero>
    0013       If BC Order Type (F4201) (DCTO) is equal to "S6,SW"
    0014          F5542528.Insert
                     BC Document (Order No, Invoice, etc.) (F4201) -> TK Document (Order No, Invoice, etc.)
                     BC Order Type (F4201) -> TK Order Type
                     BC Address Number (F0101) -> TK Address Number
                     BC Address Number - Ship To (F4201) -> TK Address Number - Ship To
                     BC Date - Order/Transaction (F4201) -> TK Date - Order/Transaction
                     VA rpt_AC03_YN -> TK Category Code - Address Book 03
                     VA rpt_AC07YN -> TK Category Code - Address Book 07
                     SL UserID                          -> TK User ID
                     SL DateToday                       -> TK Date - Updated
    0015       End If
    0016       Do Custom Section(RS F5541261 - All Fields)
    0017    Else
    0018    End If
    0019 End If

    =======================================================================
         SECTION: Union F4211 & F42119 -All Fields [GROUP SECTION] ()
    =======================================================================
         OBJECT:  SECTION
         EVENT:  Initialize Section
    -----------------------------------------------------------------------
    0001 Set Selection Append Flag( <Yes>)
    0002 Set User Selection(BC Document (Order No, Invoice, etc.) (F4211), <Equal To>, VA rpt_DocumentOrderInvoiceE, <And>)
    0003 ! Set User Selection(BC Document Company (F4211), <Equal To>, VA rpt_CompanyKeyOrderNo, <And>)
    0004 Set User Selection(BC Status Code - Last (F4211),  <Not Equal To>, "980", <And>)
    0005 Set User Selection(BC Status Code - Next (F4211),  <Equal To>, "540", <And>)
    0006 Set User Selection(BC Line Type (F4211),  <Equal To>, "S", <And>)
    0007 Set User Selection(BC Line Number (F4211), <Equal To>, VA rpt_LineNumberDetail, <And>)
    0008 Set User Selection(BC Order Type (F4211), <Equal To>, VA rpt_OrderType, <None>)

    -----------------------------------------------------------------------
         EVENT:  Do Section
    -----------------------------------------------------------------------
    0001 ! RV SpIns. = "  "
    0002 //
    0003 RV SplIns = "."
    0004 // Unit Of Measure
    0005 //
    0006 If VA rpt_CallDetailWO_CF is equal to "99999"
    0007 Else
    0008    //
    0009    F5541251.Fetch Single
               BC 2nd Item Number (F4211) =  TK 2nd Item Number
               BC Business Unit (F4211) =  TK Business Unit
               RV ContainerNo <- TK Description
               RV ItemPack <- TK Pieces MTD
               RV ItemNonWeight <- TK Weight per - Level 2
               RV ItemDepth <- TK Length
               RV ItemWidth <- TK Width per - Level 1
               RV ItemHt <- TK Height per - Level 1
               RV Tie <- TK Height per - Level 2
               RV High <- TK Height per - Level 3
               RV CountPallet <- TK Height per - Level 4
               VA rpt_GT_DateForConf <- TK Date - Ending Effective
               VA rpt_GroupUnitOfMeasure =  TK Unit of Measure as Input
    0010    RV ConfCode = VA rpt_GroupUnitOfMeasure
    0011    //
    0012    //
    0013    RV ItemWtUnit = "L"
    0014    //
    0015 End If
    0016 //
    0017 // End Unit Of Measure
    0018 RV ReqDelDate = BC Date - Promised Delivery (F4211)
    0019 RV Line_ID = [BC Line Number (F4211)]*1000
    0020 // No.of Pallets
    0021 //
    0022 RV New_No_ofPallets = ([BC Units - Order/Transaction Quantity (F4211)]/[RV ItemPack])/[RV CountPallet]
    0023 //
    0024 // Ship Qty.
    0025 //
    0026 RV ShipQty = [VA rpt_Qty_ship_C1]
    0027 //
    0028 F5542324.Fetch Single
            BC Order Company (Order Number) (F4211) =  TK Order Company (Order Number)
            BC Document (Order No, Invoice, etc.) (F4211) =  TK Document (Order No, Invoice, etc.)
            BC Order Type (F4211) =  TK Order Type
            BC Line Number (F4211) =  TK Line Number
            RV ConfCode =  TK Unit of Measure as Input
    0029 ! F5542324.Fetch Single
         !    BC Order Company (Order Number) (F4211) =  TK Order Company (Order Number)
         !    BC Document (Order No, Invoice, etc.) (F4211) =  TK Document (Order No, Invoice, etc.)
         !    BC Order Type (F4211) =  TK Order Type
    0030 If SV File_IO_Status is equal to CO SUCCESS
    0031    Suppress Section Write
    0032 Else
    0033    F554247T.Fetch Single
               BC Document (Order No, Invoice, etc.) (F4211) =  TK Document (Order No, Invoice, etc.)
    0034    If SV File_IO_Status is equal to CO SUCCESS
    0035       F5542324.Insert
                  BC Order Company (Order Number) (F4211) -> TK Order Company (Order Number)
                  BC Document (Order No, Invoice, etc.) (F4211) -> TK Document (Order No, Invoice, etc.)
                  BC Order Type (F4211) -> TK Order Type
                  BC Line Number (F4211) -> TK Line Number
                  RV ConfCode -> TK Unit of Measure as Input
                  SL DateToday                       -> TK Date - Updated
                  SL UserID                          -> TK User ID
    0036       VA rpt_CountLineNumberTot = [VA rpt_CountLineNumberTot]+[VA rpt_CountLineNumber]
    0037    End If
    0038 End If
    0039 ! Add a Carrige Return to String
         !    RV CarriageRet_detail <> szString
    0040 ! Add a Carrige Return to String
         !    RV SplIns <> szString
    0041 //
    0042 //
    0043 VA rpt_GroupUnitOfMeasureH1 = ""
    0044 VA rpt_GroupUnitOfMeasureH2 = ""
    0045 VA rpt_GroupUnitOfMeasureH3 = ""
    0046 //
    0047 // Re-verification
    0048 //
    0049 F554247T.Fetch Single
            BC Document (Order No, Invoice, etc.) (F4211) =  TK Document (Order No, Invoice, etc.)
    0050 If SV File_IO_Status is equal to CO SUCCESS
    0051 Else
    0052    Suppress Section Write
    0053 End If
    0054 //
    0055 //
    0056 F5541261.Fetch Single
            BC Document (Order No, Invoice, etc.) (F4211) =  TK Document (Order No, Invoice, etc.)
            BC Order Type (F4211) =  TK Order Type
            RV ContainerNo <- TK Description
            VA rpt_QuantityTimeSeries01 <- TK Quantity - Time Series 01
            VA rpt_QuantityTimeSeries02 <- TK Quantity - Time Series 02
            VA rpt_QuantityTimeSeries03 <- TK Quantity - Time Series 03
            VA rpt_GroupUnitOfMeasureH1 <- TK Group - Unit of Measure (Level 1)
            VA rpt_GroupUnitOfMeasureH2 <- TK Group - Unit of Measure (Level 2)
            VA rpt_GroupUnitOfMeasureH3 <- TK Group - Unit of Measure (Level 3)
    0057 If SV File_IO_Status is equal to CO SUCCESS
    0058    //
    0059    If VA rpt_QuantityTimeSeries01 is equal to <Zero>
            And VA rpt_QuantityTimeSeries02 is equal to <Zero>
            And VA rpt_QuantityTimeSeries03 is equal to <Zero>
    0060       Suppress Section Write
    0061    Else
    0062    End If
    0063 Else
    0064    Suppress Section Write
    0065 End If
    0066 //
    0067 //
    0068 F4102.Fetch Single
            BC Item Number - Short (F4211) =  TK Item Number - Short
            BC Business Unit (F4211) =  TK Business Unit
            VA rpt_ShippingConditionsCode_1 <- TK Shipping Conditions Code
    0069 RC 70 = VA rpt_ShippingConditionsCode_1
    0070 If VA rpt_ShippingConditionsCode_1 is equal to "85"
    0071    RC N = "Y"
    0072 Else
    0073 End If
    0074 //
    0075 //

    =======================================================================
         SECTION: F5541261 - All Fields [GROUP SECTION] ()
    =======================================================================
         OBJECT:  SECTION
         EVENT:  Initialize Section
    -----------------------------------------------------------------------
    0001 Clear User Selection
    0002 Set Selection Append Flag( <Yes>)
    0003 Set User Selection(BC Document (Order No, Invoice, etc.) (F5541261), <Equal To>, VA rpt_DocumentOrderInvoiceE, <And>)
    0004 ! Set User Selection(BC Order Company (Order Number) (F5541261), <Equal To>, VA rpt_CompanyKeyOrderNo, <And>)
    0005 Set User Selection(BC Order Type (F5541261), <Equal To>, VA rpt_OrderType,  <None>)

    -----------------------------------------------------------------------
         EVENT:  Do Section
    -----------------------------------------------------------------------
         evt_UnitsQuantityShipped
    0001 VA rpt_LineNumberDetail = 0
    0002 VA rpt_GroupUnitOfMeasure = ""
    0003 VA rpt_Qty_ship_C1 = 0
    0004 ! VA rpt_Qty_ship_C2 = 0
    0005 ! VA rpt_Qty_ship_C3 = 0
    0006 //
    0007 VA rpt_LineNumberDetail = BC Line Number (F5541261)
    0008 ! If BC Quantity - Time Series 01 (F5541261) is not equal to <Zero>
         ! And BC Quantity - Time Series 01 (F5541261) is not equal to <Blank>
    0009    If BC Group - Unit of Measure (Level 1) (F5541261) is not equal to <Blank>
    0010       VA rpt_GroupUnitOfMeasure = ""
    0011       VA rpt_GroupUnitOfMeasure = [BC Group - Unit of Measure (Level 1) (F5541261)]
    0012       VA rpt_Qty_ship_C1 = [BC Quantity - Time Series 01 (F5541261)]
    0013       Do Custom Section(RS Union F4211 & F42119 -All Fields)
    0014    End If
    0015 ! End If
    0016 ! If BC Quantity - Time Series 02 (F5541261) is not equal to <Zero>
         ! And BC Quantity - Time Series 02 (F5541261) is equal to <Blank>
    0017    If BC Group - Unit of Measure (Level 2) (F5541261) is not equal to <Blank>
    0018       VA rpt_GroupUnitOfMeasure = ""
    0019       VA rpt_GroupUnitOfMeasure = [BC Group - Unit of Measure (Level 2) (F5541261)]
    0020       VA rpt_Qty_ship_C1 = [BC Quantity - Time Series 02 (F5541261)]
    0021       Do Custom Section(RS Union F4211 & F42119 -All Fields)
    0022    End If
    0023 ! End If
    0024 ! If BC Quantity - Time Series 03 (F5541261) is not equal to <Zero>
         ! And BC Quantity - Time Series 03 (F5541261) is not equal to <Blank>
    0025    If BC Group - Unit of Measure (Level 3) (F5541261) is not equal to <Blank>
    0026       VA rpt_GroupUnitOfMeasure = ""
    0027       VA rpt_GroupUnitOfMeasure = [BC Group - Unit of Measure (Level 3) (F5541261)]
    0028       VA rpt_Qty_ship_C1 = [BC Quantity - Time Series 03 (F5541261)]
    0029       Do Custom Section(RS Union F4211 & F42119 -All Fields)
    0030    End If
    0031 ! End If

    =======================================================================
         SECTION: Report Header [REPORT HEADER] ()
    =======================================================================
         OBJECT:  SECTION
         EVENT:  Do Section
    -----------------------------------------------------------------------
    0001 RV RepDate = [SL DateToday                      ]
    0002 RV RrunTime = [VA rpt_TimeLastUpdated]

    -----------------------------------------------------------------------
         EVENT:  Initialize Report Header
    -----------------------------------------------------------------------
    0001 Get Audit Information
            UNDEFINED X szUserName
            UNDEFINED X jdDate
            VA rpt_TimeLastUpdated <- mnTime
            UNDEFINED X szWorkstation_UserId

    =======================================================================
         SECTION: Report Footer [REPORT FOOTER] ()
    =======================================================================
         OBJECT:  SECTION
         EVENT:  Do Section
    -----------------------------------------------------------------------
    0001 RV TotRec = VA rpt_CountLineNumberTot

     

    Tuesday, March 8, 2011

    Conditional Validation in ASP.NET MVC 3



    http://blogs.msdn.com/b/simonince/archive/2011/02/04/conditional-validation-in-asp-net-mvc-3.aspx

    Database Deployment with the VS 2010 Package/Publish Database Tool

    Database deployment hasn't ever been considered the fun part of a developer's job, and automating it to be made easier often takes lots of manual setup. Earlier versions of Visual Studio didn't have much in the way of deployment built in or easily accessible. Web Deployment Projects, which are a separate download, have no database deployment options (ASP.NET project assets only). Visual Studio 2010 has incorporated into the IDE a very rich set of web and database deployment configuration settings & tools to make things as easy and automated as possible for developers during the deployment process.

    Thursday, March 3, 2011

    JD Edwards Account details by year

    select

    glan8 [Address Number],gldct [Do Ty],gldoc [Doc Number],glkco [Doc Co],

    CONVERT

    (CHAR(10),DATEADD(dy, cast(gldgj as varchar(10)) % 1000, DATEADD(yy, cast(gldgj as varchar(10)) / 1000,-1)),101) [G/L Date],

    glvinv [Invoice Number]

    ,glexr Remarks,glexa Explanation ,-glaa/100 Amt,glu Units,glpo [Purchase Order],

    gllt LedTy

    from

    jde_production.proddta.f0911 where glaid=[ShortAccountNo] and glfy=10

    Tuesday, March 1, 2011

    Gridview/Detailsview edit browse working sample c#

    <%

    @ Page Language="C#" %>

    <!

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <

    script runat="server">

    void CustomerDetail_ItemInserted(object sender,

    DetailsViewInsertedEventArgs e)

    {

    CustomersView.DataBind();

    }

    void CustomerDetail_ItemInserting(object sender,

    DetailsViewInsertEventArgs e)

    {

    for (int i = 0; i < e.Values.Count; i++)

    {

    if (e.Values[i] != null)

    {

    e.Values[i] = Server.HtmlEncode(e.Values[i].ToString());

    }

    }

    }

    void CustomerDetail_ItemUpdated(object sender,

    DetailsViewUpdatedEventArgs e)

    {

    CustomersView.DataBind();

    }

    void CustomerDetail_ItemUpdating(object sender,

    DetailsViewUpdateEventArgs e)

    {

    for (int i = 0; i < e.NewValues.Count; i++)

    {

    if (e.NewValues[i] != null)

    {

    e.NewValues[i] = Server.HtmlEncode(e.NewValues[i].ToString());

    }

    }

    }

    void CustomerDetail_ItemDeleted(object sender,

    DetailsViewDeletedEventArgs e)

    {

    CustomersView.DataBind();

    }

    </

    script>

    <

    html xmlns="http://www.w3.org/1999/xhtml" >

    <

    head id="Head1" runat="server">

    <title>

    DetailsView Example

    </title>

    </

    head>

    <

    body>

    <form id="Form1" runat="server">

    <h3>

    </h3>

    <table cellspacing="10">

    <tr>

    <td>

    <asp:GridView ID="CustomersView" DataSourceID="Customers"

    AutoGenerateColumns="False"

    DataKeyNames="CustomerID" runat="server">

    <HeaderStyle BackColor="Blue" ForeColor="White" />

    <Columns>

    <asp:CommandField ShowSelectButton="True" />

    <asp:BoundField DataField="ContactName"

    HeaderText="ContactName" />

    <asp:BoundField DataField="CompanyName"

    HeaderText="CompanyName" />

    </Columns>

    </asp:GridView>

    </td>

    <td valign="top">

    <asp:DetailsView ID="CustomerDetail"

    DataSourceID="Details" AutoGenerateRows="false"

    AutoGenerateInsertButton="true"

    AutoGenerateEditButton="true"

    AutoGenerateDeleteButton="true"

    EmptyDataText=""

    DataKeyNames="CustomerID" GridLines="Both"

    OnItemInserted="CustomerDetail_ItemInserted"

    OnItemInserting="CustomerDetail_ItemInserting"

    OnItemUpdated="CustomerDetail_ItemUpdated"

    OnItemUpdating="CustomerDetail_ItemUpdating"

    OnItemDeleted="CustomerDetail_ItemDeleted"

    runat="server">

    <HeaderStyle BackColor="Navy" ForeColor="White" />

    <RowStyle BackColor="White" />

    <AlternatingRowStyle BackColor="LightGray" />

    <EditRowStyle BackColor="LightCyan" />

    <Fields>

    <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" ReadOnly="True" />

    <asp:BoundField DataField="ContactName" HeaderText="ContactName" />

    <asp:BoundField DataField="ContactTitle" HeaderText="ContactTitle" />

    <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" />

    <asp:BoundField DataField="Address" HeaderText="Address" />

    <asp:BoundField DataField="City" HeaderText="City" />

    <asp:BoundField DataField="Region" HeaderText="Region" />

    <asp:BoundField DataField="PostalCode" HeaderText="PostalCode" />

    <asp:BoundField DataField="Country" HeaderText="Country" />

    <asp:BoundField DataField="Phone" HeaderText="Phone" />

    <asp:BoundField DataField="Fax" HeaderText="Fax" />

    </Fields>

    </asp:DetailsView>

    </td>

    </tr>

    </table>

    <asp:SqlDataSource ID="Customers" runat="server"

    ConnectionString=

    "<%$ ConnectionStrings:ConnectionString1 %>"

    SelectCommand="SELECT [CompanyName], [ContactName], [CustomerID]

    FROM [Customers]">

    </asp:SqlDataSource>

    <asp:SqlDataSource ID="Details"

    ConnectionString=

    "<%$ ConnectionStrings:ConnectionString1 %>"

    runat="server"

    SelectCommand="SELECT * FROM [Customers]

    WHERE ([CustomerID] = @CustomerID)"

    DeleteCommand="DELETE FROM [Customers]

    WHERE [CustomerID] = @CustomerID"

    InsertCommand="INSERT INTO [Customers] ([CustomerID],

    [CompanyName], [ContactName], [ContactTitle], [Address],

    [City], [Region], [PostalCode], [Country], [Phone], [Fax])

    VALUES (@CustomerID, @CompanyName, @ContactName, @ContactTitle,

    @Address, @City, @Region, @PostalCode, @Country, @Phone, @Fax)"

    UpdateCommand="UPDATE [Customers] SET [CompanyName] = @CompanyName,

    [ContactName] = @ContactName, [ContactTitle] = @ContactTitle,

    [Address] = @Address, [City] = @City, [Region] = @Region,

    [PostalCode] = @PostalCode, [Country] = @Country,

    [Phone] = @Phone, [Fax] = @Fax

    WHERE [CustomerID] = @CustomerID">

    <SelectParameters>

    <asp:ControlParameter ControlID="CustomersView"

    Name="CustomerID" PropertyName="SelectedValue"

    Type="String" />

    </SelectParameters>

    <DeleteParameters>

    <asp:Parameter Name="CustomerID" Type="String" />

    </DeleteParameters>

    <UpdateParameters>

    <asp:Parameter Name="CompanyName" Type="String" />

    <asp:Parameter Name="ContactName" Type="String" />

    <asp:Parameter Name="ContactTitle" Type="String" />

    <asp:Parameter Name="Address" Type="String" />

    <asp:Parameter Name="City" Type="String" />

    <asp:Parameter Name="Region" Type="String" />

    <asp:Parameter Name="PostalCode" Type="String" />

    <asp:Parameter Name="Country" Type="String" />

    <asp:Parameter Name="Phone" Type="String" />

    <asp:Parameter Name="Fax" Type="String" />

    <asp:Parameter Name="CustomerID" Type="String" />

    </UpdateParameters>

    <InsertParameters>

    <asp:Parameter Name="CustomerID" Type="String" />

    <asp:Parameter Name="CompanyName" Type="String" />

    <asp:Parameter Name="ContactName" Type="String" />

    <asp:Parameter Name="ContactTitle" Type="String" />

    <asp:Parameter Name="Address" Type="String" />

    <asp:Parameter Name="City" Type="String" />

    <asp:Parameter Name="Region" Type="String" />

    <asp:Parameter Name="PostalCode" Type="String" />

    <asp:Parameter Name="Country" Type="String" />

    <asp:Parameter Name="Phone" Type="String" />

    <asp:Parameter Name="Fax" Type="String" />

    </InsertParameters>

    </asp:SqlDataSource>

    </form>

    </

    body>

    </

    html>