Code for Job Queue

rico1931rico1931 Member Posts: 295
edited 2015-05-28 in NAV Three Tier
Hi Everyone,

We have a job queue that runs every night for the planning report. We noticed that it was only checking things that were set to Items = Prob. Order for the replenishment system. I tried adding this over line to make it the following
ItemReplSystem := Item."Replenishment System"::"Prod. Order";
ItemReplSystem := Item."Replenishment System"::Assembly;

When it was only the first line, everything worked fine. Ever since I added the 2nd line, things have been hit or miss. I'm wondering if there is a nice clean way to add everything to 1 line or if I'm missing something here.

Thank you
-rico1931

Answers

  • Rob_HansenRob_Hansen Member Posts: 296
    What are you trying to do here? Set the ItemReplSystem variable to what the replenishment system is on the item record? Or is it a Boolean variable that you want to set to true if the replenishment system is Prod. Order OR Assembly?
  • rico1931rico1931 Member Posts: 295
    Rob Hansen wrote:
    What are you trying to do here? Set the ItemReplSystem variable to what the replenishment system is on the item record? Or is it a Boolean variable that you want to set to true if the replenishment system is Prod. Order OR Assembly?

    Hi Rob,

    Just trying to set the ItemReplSystem variable to BOTH Prod. Order; Assembly

    -rico1931
  • satbirsatbir Member Posts: 33
    You cannot assign 2 values to one variable at the same time.
    You can create another variable, assign the other value and then use both the variables in your filters or conditions.
  • Rob_HansenRob_Hansen Member Posts: 296
    I think this is a case where you're probably going about something the wrong way. If you're trying to adapt this process to run under the job queue, your code needs to apply a similar filter to the Item data item...a variable shouldn't really come into play. Through code, you'll need to (OnPreDataItem for the Item data item) filter the records:

    SETFILTER("Replenishment System",'%1|%2',"Replenishment System"::"Prod. Order","Replenishment System"::Assembly);
  • rico1931rico1931 Member Posts: 295
    satbir wrote:
    You cannot assign 2 values to one variable at the same time.
    You can create another variable, assign the other value and then use both the variables in your filters or conditions.


    Perfect! It works! Thank you very very much!
    -rico1931
Sign In or Register to comment.