Is it possible to use the Context.AssemblySeq to indirectly look up the JobAsmbl.PartNum to load this to an Inspection Plan Form control in the “On Load” Event expression? I am new at this and don’t find in my searches any examples of how to use these:
The other thought I had was could we increase the fields that are supplied with the Context data to include this field we need? I was not sure if this Context list was dynamic or fixed.
I broke that up into multiple lines for readability. Normally it’s just one long expression.
That will search the JobAsmbl table for the first record that matches all the conditions in the .Where() part. You can add more conditions. And you’ll need to replace MyCompany, JobToFind, and Seq.
If a record is found, it sets the variable pn to the value of the PartNum field.
If no matching records are found, it sets pn to "NotFound"
Other than what I inserted with the Context fields, if that is even correct, do i assign pn to a control with a
Inputs.epiPcTextBox1.Value = pn; statement ?
I am guessing I need to change the Db to my database name like “Epicor10” if that is the database I connect to in SSMS?
As you probably know this inspection plan is being called from the Inspection Data button. This field on this End Labor Activity display is not passed along in the Context list. Can you tell me how to reference it? Is there any way to add to the available fields in the Context list? See second image.
If I determine the part number in the “On Load” event, is it possible to compare that value to the entered value at the “On Field Validating” event?
I am not sure how to pass that jobPartNum variable to the validation event.
// Compare the entered PartNum with the retrieved PartNum
if (!string.IsNullOrEmpty(jobPartNum) && enteredPartNum == jobPartNum)
{
// Validation passed
MessageBox.Show("Validation passed: The entered PartNum matches the Job's PartNum.");
}
else
{
// Validation failed
throw new Exception("Validation failed: The entered PartNum does not match the Job's PartNum.");
}
The following errors were found during compile:
CS0103 - c:\Users\meissnef\AppData\Local\Temp\ConfigDump\Client\_SubcontractCertInputEventCollection.cs (59,27) - The name 'jobPartNum' does not exist in the current context
CS0103 - c:\Users\meissnef\AppData\Local\Temp\ConfigDump\Client\_SubcontractCertInputEventCollection.cs (59,42) - The name 'enteredPartNum' does not exist in the current context
CS0103 - c:\Users\meissnef\AppData\Local\Temp\ConfigDump\Client\_SubcontractCertInputEventCollection.cs (59,60) - The name 'jobPartNum' does not exist in the current context
Total number of Errors: 3, Warnings 0
Sorry I am not going to be any help for you on this. We actually abandoned trying to implement the Quality Module and came up with entirely custom app using UD tables.
Edit: I ended up creating a hidden text field which I populated with the job part number. I can then compare in the separate event using the two fields.
To help the community provide the best answer, could you include as much of the information below as you can? Your question appears to be lacking some much needed context
Epicor Version
Deployment Type (Cloud, On Prem, 3rd Party Cloud etc)
The business problem you’re trying to solve
What you’ve already tried
Is this a Kinetic UX (Web) or Epicor Classic issue?
Is it related to a Method Directive, Data Directive, Function, BAQ, UBAQ, Configurator, etc.?
Any screenshots, error messages, or logs.
Any code you’ve written (or borrowed , make sure it is property formatted)
```
code here
```
Hi Clint, that code you referenced is Calvin’s solution to the original thread. It is code for the Configurator that pulls the part number for the job being referenced in the Inspection Data module. I probably should have started a new thread instead of resurrecting this one. In any case, as I posted in my edit, I figured how to do it by storing the value in a hidden character field so it would be available “globally”.