On jobs, we often need to re-order operations. However, the Operation Sequence field is greyed out, even when the job is not yet firm or released.
Does anyone know if there is a reason for this or if it is a bug?
I create a brand new job for a part that has an approved method.
When the job is created, the operations are automatically inserted into the job from the method.
I need to change the sequence of the operations (e.g. Move Op 20 to come after Op 50). The ‘Op Seq’ field is greyed out (even though the job has not been engineered or released).
Why is the field greyed out in this case?
As a result, we delete the operation, re-add it with the required sequence number, and re-enter all the information (e.g. setup times, operation instructions etc). Changing the sequence number would save a lot of time.
Going all the way back to 10.0, the only time I’ve been able to change the operation sequence / order has been using Product Configurator Method Rules, and that is during job creation. I’m guessing that probably indicates that it’s intended that way.
This is the design. You can only change the sequence after manually adding before it is initially saved. If you have a way to know this is a job you want the operations in a different order than the boo you could use an alternate method to bring them in in that order.
You can also make a bpm post processing on GetDetails that behind the scenes does the delete, add and change operation number.
Great idea, Greg. You could create a function to do the re-sequencing for you, and call the function from a BPM. Or you could even create a “Change JobOper Sequence” Kinetic App in App studio, and call a function from the UI.
/* Request Parameters:
string Jobnum
int OriginalOprSeq
int NewOprSeq
*/
using ( var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(Db) ) {
// Get the Job Tableset, the Operation you want to copy, and the SysRowID from the related Assembly
var JobTS = svc.GetByID( JobNum );
var OldOpRow = JobTS.JobOper.Where( x => x.OprSeq == OriginalOprSeq ).FirstOrDefault();
var AsmblySeq = JobTS.JobAsmbl.Where(x => x.AssemblySeq == OldOpRow.AssemblySeq).Select(s => s.SysRowID).FirstOrDefault();
// Add a new Operation with the desired OprSeq
bool opShowmsg;
svc.AddOperation(AsmblySeq, OldOpRow.OpCode, NewOprSeq, true, out opShowmsg);
var NewOpRow = JobTS.JobOper.FirstOrDefault( x => x.Added() );
// Copy all the fields from the original Operation that you need
NewOpRow.ActSetupHours = OldOpRow.ActSetupHours;
NewOpRow.Instructions = OldOpRow.Instructions;
NewOpRow.OpDesc = OldOpRow.OpDesc;
// Call JobEntry.Update to save the new Operation
svc.Update( ref JobTS );
// Delete the old Operation
OldOpRow.RowMod = "D";
svc.Update( ref JobTS );
}
Note: This isn’t tested at all, but it is probably a good start.