All right here it is, running this code from a Button Click Event will do
what you want, ofcourse you need to change the where clause to something
more useful, I put a full explination on my blog http://goo.gl/NQ4ep , but
here is the code you need, let me know if you have any further questions.
bool funBool; //Boolean required by GetList Method
String outMsg; //String required by CheckJobOperSeq
//Normally the above variables will be MessageBoxes and warnings on the UI
but in code behind
//they live as variables
/* Get a list of all the Jobs we want to mess with
WARNING: DO not try to do 500 jobs at a time since this will take for
EVER!
change the "WHERE CLAUSE" to meet your needs
In my case I am asking only for Job 000252 but it wouldn't be hard
to ask for Jobs greater than X or Jobs that are Open */
JobHeadListDataSet jeds = je.GetList("JobHead.JobNum='000252'", 0, 0, out
funBool);
//For each of the results I want to add an Operation with Sequence 115 and
OpCode "Daily"
foreach (JobHeadListDataSet.JobHeadListRow r in jeds.JobHeadList)
{
//Get the Job Data Set
JobEntryDataSet jods = je.GetByID(r.JobNum);
//Get a New Operation
je.GetNewJobOper(jods, r.JobNum, 0);
/* Check to make sure the sequence is good
Note that I am not actually checking, but if there is a problem
your outMsg will contain the reason.*/
je.CheckJobOperOprSeq(r.JobNum, 0, 115, out outMsg);
//Add the sequence number to the operation
jods.JobOper[jods.JobOper.Count - 1].OprSeq = 115;
//Change the OpCode
je.ChangeJobOperOpCode("Daily", out outMsg, jods);
//Update the Job
je.Update(jods);
}
EpiMessageBox.Show("Done!");
*
*
*
*
*
*
*Jose C Gomez*
Software Engineer
*
*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
*Quis custodiet ipsos custodes?*
what you want, ofcourse you need to change the where clause to something
more useful, I put a full explination on my blog http://goo.gl/NQ4ep , but
here is the code you need, let me know if you have any further questions.
bool funBool; //Boolean required by GetList Method
String outMsg; //String required by CheckJobOperSeq
//Normally the above variables will be MessageBoxes and warnings on the UI
but in code behind
//they live as variables
/* Get a list of all the Jobs we want to mess with
WARNING: DO not try to do 500 jobs at a time since this will take for
EVER!
change the "WHERE CLAUSE" to meet your needs
In my case I am asking only for Job 000252 but it wouldn't be hard
to ask for Jobs greater than X or Jobs that are Open */
JobHeadListDataSet jeds = je.GetList("JobHead.JobNum='000252'", 0, 0, out
funBool);
//For each of the results I want to add an Operation with Sequence 115 and
OpCode "Daily"
foreach (JobHeadListDataSet.JobHeadListRow r in jeds.JobHeadList)
{
//Get the Job Data Set
JobEntryDataSet jods = je.GetByID(r.JobNum);
//Get a New Operation
je.GetNewJobOper(jods, r.JobNum, 0);
/* Check to make sure the sequence is good
Note that I am not actually checking, but if there is a problem
your outMsg will contain the reason.*/
je.CheckJobOperOprSeq(r.JobNum, 0, 115, out outMsg);
//Add the sequence number to the operation
jods.JobOper[jods.JobOper.Count - 1].OprSeq = 115;
//Change the OpCode
je.ChangeJobOperOpCode("Daily", out outMsg, jods);
//Update the Job
je.Update(jods);
}
EpiMessageBox.Show("Done!");
*
*
*
*
*
*
*Jose C Gomez*
Software Engineer
*
*
*
*
*
*T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com
*Quis custodiet ipsos custodes?*
On Wed, Jun 8, 2011 at 4:31 PM, Jose Gomez <jose@...> wrote:
> Are you ok at writing custom code? C#? Cause that's probably what it will
> take in short, what you need to do is.
>
> Turn on Tracing
> Do what you need to do for Job X
> Save the Trace File
>
> Open a UD Menu item or something irrelevant
> Add A button or something like that to it
> On the button click Event,
> Run a Query to get all the jobs you want to mess with
> For each Job, replicate what the Trace does
>
> I can go into more detail but honestly if you are not familiar with C#
> or Customization it will be fairly hard.
>
>
> *Jose C Gomez*
> *Software Engineer*
> *
> *
> *checkout my new blog <http://www.usdoingstuff.com> *
> *
> *T: 904.469.1524 mobile
> E: jose@...
> http://www.josecgomez.com
> <http://www.linkedin.com/in/josecgomez> <http://www.facebook.com/josegomez>
> <http://www.google.com/profiles/jose.gomez> <http://www.twitter.com/joc85>
> <http://www.josecgomez.com/professional-resume/> <http://www.josecgomez.com/feed/>
> <http://www.usdoingstuff.com>
>
> *Quis custodiet ipsos custodes?*
>
>
>
> On Wed, Jun 8, 2011 at 4:15 PM, Jen <jmesiano@...> wrote:
>
>>
>>
>>
>> Yep! I need to add operation sequence 115 to assembly 1 with with
>> operation code 'PermExp'for every open job.
>>
>> Thanks!
>>
>>
>> --- In vantage@yahoogroups.com, Jose Gomez <jose@...> wrote:
>> >
>> > I assume you are talking about going to a job and hitting get Details
>> etc
>> > correct?
>> > if that's the case you can call it all from code confirm and I'll
>> wrangle
>> > you up some code to do the rest.
>> >
>> > *Jose C Gomez*
>> > *Software Engineer*
>> > *
>> > *
>> > *checkout my new blog <http://www.usdoingstuff.com> *
>> > *
>> > *T: 904.469.1524 mobile
>> > E: jose@...
>> > http://www.josecgomez.com
>> > <http://www.linkedin.com/in/josecgomez> <
>> http://www.facebook.com/josegomez>
>> > <http://www.google.com/profiles/jose.gomez> <
>> http://www.twitter.com/joc85>
>> > <http://www.josecgomez.com/professional-resume/>
>> > <http://www.josecgomez.com/feed/>
>> > <http://www.usdoingstuff.com>
>> >
>> > *Quis custodiet ipsos custodes?*
>>
>> >
>> >
>> >
>> > On Wed, Jun 8, 2011 at 3:23 PM, Jen <jmesiano@...> wrote:
>> >
>> > >
>> > >
>> > > I need to add a new operation to our job method. I added it to our job
>> > > template which takes care of newly created jobs. Is there a way to
>> mass
>> > > update all of the old jobs with the new operation? Something tells me
>> that
>> > > this has been discussed in the past but I don't know if anyone ever
>> came up
>> > > with a solution. I think I got my first gray hair think about having
>> to
>> > > manually update over 1,000 open jobs.
>> > >
>> > > Jennifer
>> > >
>> > >
>> > >
>> >
>> >
>> > [Non-text portions of this message have been removed]
>> >
>>
>>
>>
>
>
[Non-text portions of this message have been removed]