Updating UD fields on JobAsmbl table via BAQ error

I have an updateable BAQ with the jobhead and jobasembl tables. I am trying to update some UD fields on the jobasembl table. The data shows on the BAQ Query results screen ok but when I try to update the fields the assy (1,2…) part number changes to the assy 0 part number and I get a circular error reference. Everything works fine if the assy number is 0.

Before Update:
image

After trying to update:
image

Can you show us the BAQ you used to get this error? Do you have any custom code or widgets on the update, or is it a standard updatable baq? I suspect your assembly part number is not pointing to the assembly part number.

The original BAQ has a bunch of other tables and subqueries but I stripped it down to see if they were the issue but I get the same error with just the jobhead and jobasmbl tables.

 * 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 
	[JobHead].[Company] as [JobHead_Company],
	[JobHead].[Character04] as [JobHead_Character04],
	[JobHead].[JobNum] as [JobHead_JobNum],
	[JobAsmbl].[JobNum] as [JobAsmbl_JobNum],
	[JobHead].[PartNum] as [JobHead_PartNum],
	[JobAsmbl].[PartNum] as [JobAsmbl_PartNum],
	[JobAsmbl].[AssemblySeq] as [JobAsmbl_AssemblySeq],
	[JobAsmbl].[NameShift1_c] as [JobAsmbl_NameShift1_c],
	[JobAsmbl].[NameShift2_c] as [JobAsmbl_NameShift2_c],
	[JobAsmbl].[NameWEShift_c] as [JobAsmbl_NameWEShift_c],
	[JobAsmbl].[DailyEstHrs_c] as [JobAsmbl_DailyEstHrs_c],
	[JobAsmbl].[Out_c] as [JobAsmbl_Out_c],
	[JobHead].[RevisionNum] as [JobHead_RevisionNum]
from Erp.JobHead as JobHead
inner join Erp.JobAsmbl as JobAsmbl on 
	JobHead.Company = JobAsmbl.Company
	and JobHead.JobNum = JobAsmbl.JobNum
	and ( JobAsmbl.AssemblySeq = 1  )

where (JobHead.JobClosed = 0  and JobHead.JobComplete = 0  and JobHead.JobReleased = 1)
group by [JobHead].[Company],
	[JobHead].[Character04],
	[JobHead].[JobNum],
	[JobAsmbl].[JobNum],
	[JobHead].[PartNum],
	[JobAsmbl].[PartNum],
	[JobAsmbl].[AssemblySeq],
	[JobAsmbl].[NameShift1_c],
	[JobAsmbl].[NameShift2_c],
	[JobAsmbl].[NameWEShift_c],
	[JobAsmbl].[DailyEstHrs_c],
	[JobAsmbl].[Out_c],
	[JobHead].[RevisionNum]

I’m very inexperienced with UBAQ’s… but it looks like you have your JobHead_PartNum mapped to you JobAsmbl_PartNum… I’m assuming that’s why it is overwriting.

2 Likes

I was just screen-shotting to show the same thing. I think that will resolve the error.

Thank you, that fixed it. Sometimes you go cross-eyed after looking at BAQs for so long :slight_smile:

1 Like

the office agree GIF by EditingAndLayout

Sometimes a fresh set of eyes is all you need!

1 Like