We have our own custom script for receiving job to inventory which suddenly stopped working.
After debugging the code from visual basic it pops us the error:
Date of 11/26/2023 is less than the allowed earliest apply date of 1/1/2024.
Please find the error log:
System.Transactions Critical: 0 : Microsoft Learn: Build skills that open doors in your careerUnhandled exceptionMESTOEPICOR.exeIce.Common.BusinessObjectException, Epicor.ServiceModel, Version=3.2.700.0, Culture=neutral, PublicKeyToken=37a5ccb872c00aec Date of 11/26/2023 is less than the allowed earliest apply date of 1/1/2024. at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Erp.Proxy.BO.ReceiptsFromMfgImpl.ReceiveMfgPartToInventory(ReceiptsFromMfgDataSet ds, Decimal pdSerialNoQty, Boolean plNegQtyAction, String&amp; pcMessage, String&amp; pcPartTranPKs, String pcProcessID) at Erp.Adapters.ReceiptsFromMfgAdapter.ReceiveMfgPartToInventory(Decimal pdSerialNoQty, Boolean plNegQtyAction, String&amp; pcMessage, String&amp; pcPartTranPKs, String pcProcessID) at MESTOEPICOR.MESIntegrations.Submit(ILauncher launch123, String pcJobNum, Int32 piAssemblySeq, Int32 Quantity, String SRNumber, DateTime TranDate) in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\MESIntegrations.cs:line 166 at MESTOEPICOR.MESIntegrations.btnCreateClick(ILauncher launch123) in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\MESIntegrations.cs:line 126 at MESTOEPICOR.MESIntegrations.JobToReceive(String strcompany) in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\MESIntegrations.cs:line 92 at MESTOEPICOR.Program.Main() in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\Program.cs:line 25</StackTrace><ExceptionString>Ice.Common.BusinessObjectException: Date of 11/26/2023 is less than the allowed earliest apply date of 1/1/2024. at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet dataSets)
at Erp.Proxy.BO.ReceiptsFromMfgImpl.ReceiveMfgPartToInventory(ReceiptsFromMfgDataSet ds, Decimal pdSerialNoQty, Boolean plNegQtyAction, String& pcMessage, String& pcPartTranPKs, String pcProcessID)
at Erp.Adapters.ReceiptsFromMfgAdapter.ReceiveMfgPartToInventory(Decimal pdSerialNoQty, Boolean plNegQtyAction, String& pcMessage, String& pcPartTranPKs, String pcProcessID)
at MESTOEPICOR.MESIntegrations.Submit(ILauncher launch123, String pcJobNum, Int32 piAssemblySeq, Int32 Quantity, String SRNumber, DateTime TranDate) in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\MESIntegrations.cs:line 166
at MESTOEPICOR.MESIntegrations.btnCreateClick(ILauncher launch123) in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\MESIntegrations.cs:line 126
at MESTOEPICOR.MESIntegrations.JobToReceive(String strcompany) in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\MESIntegrations.cs:line 92
at MESTOEPICOR.Program.Main() in C:\Job To Receive\MESTOEPICOR\POSTOEPICOR\Program.cs:line 25CorrelationID1475af1a-dc82-4123-9b3e-6371ef1b5970
An unhandled exception of type âIce.Common.BusinessObjectExceptionâ occurred in Erp.Adapters.ReceiptsfromMfg.dll
Date of 11/26/2023 is less than the allowed earliest apply date of 1/1/2024.
We cant seem to identify where the issue is occurring from.
Welcome to the forum! Looks like your script is trying to use a date in the past (Nov 2023) and your fiscal period is closed in that month. Which makes sense. Maybe adjust the script to use todayâs date or something in the current month.
/*
* Disclaimer!!!
* This is not a real query being executed, but a simplified version for general vision.
* Executing it with any other tool may produce a different result.
*/
select
[JobAsmbl].[JobNum] as [JobAsmbl_JobNum],
[JobAsmbl].[AssemblySeq] as [JobAsmbl_AssemblySeq],
[JobAsmbl].[PartNum] as [JobAsmbl_PartNum],
[JobAsmbl].[Description] as [JobAsmbl_Description],
[JobAsmbl].[RevisionNum] as [JobAsmbl_RevisionNum],
[UD31].[Key2] as [UD31_Key2],
[UD31].[Key5] as [UD31_Key5],
[UD31].[Number19] as [UD31_Number19],
[UD31].[Number20] as [UD31_Number20],
[UD31].[Date06] as [UD31_Date06],
[UD31].[ShortChar19] as [UD31_ShortChar19],
[UD31].[Character10] as [UD31_Character10],
('5148') as [Calculated_EmpID],
[UD31].[Date02] as [UD31_Date02],
[UD31].[Date20] as [UD31_Date20]
from Ice.UD31 as UD31
inner join Erp.JobAsmbl as JobAsmbl on
JobAsmbl.Company = UD31.Company
and JobAsmbl.JobNum = UD31.Key1
and JobAsmbl.AssemblySeq = UD31.Key3
and ( JobAsmbl.JobNum = case when @JobNum<>'' then @JobNum else JobAsmbl.JobNum end and JobAsmbl.PartNum = case when @PartNum<>'' then @PartNum else JobAsmbl.PartNum end )
inner join Erp.JobHead as JobHead on
JobAsmbl.Company = JobHead.Company
and JobAsmbl.JobNum = JobHead.JobNum
and ( JobHead.JobReleased = 1 and JobHead.JobClosed = 0 )
where (UD31.ShortChar20 <> '' and UD31.ShortChar19 = '' and not UD31.Key5 in (select SerialNo_SerialNumber from (select
[SerialNo].[SerialNumber] as [SerialNo_SerialNumber]
from Erp.SerialNo as SerialNo) as SR) and UD31.Date06 >= case when @fDate<>'' then @fDate else UD31.Date06 end)
order by JobAsmbl.JobNum, JobAsmbl.AssemblySeq Desc
Can you run the BAQ in the designer? What are the values (results) for Date20? Assuming youâll see at least one dated 11/26/2023? We donât know what that date represents in your data. Do you what youâre using that Date20 column for?