warehouse and advanced travsporter

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
somayeh
Posts: 3
Joined: Monday 15 July, 2013 - 17:40

warehouse and advanced travsporter

Post by somayeh »

Hi,
I have a problem with sending atoms to advanced transporter, in the following i describe the model:
there is a warehouse that products should be sent to 3 advanced transporter by following condition:
{if time>=4
if content c <7
message (content <7)
else if content c <20 channel 1
else if content c <40 channel 2
else channel 3
else message (time<4)}
i don't know how to send all products to 1 transporter when the content reaches to specify amount.
plz help me to do that.
BartC
Posts: 47
Joined: Monday 05 November, 2012 - 17:05

Re: warehouse and advanced travsporter

Post by BartC »

Hello Somayeh,

A way to implement this is by using the following 4DScript:

Code: Select all

Do(
  var([valChannel], vbValue),
  
  If(
    time >= 4,
    Case(
      WhichIsTrue(
        Content(c) < 7,
        Content(c) < 20,
        Content(c) < 40,
        True
      ),
      
      {Content < 7}
      msg([Content < 7]),
      
      {Content < 20,}
      valChannel := 1,
      
      {Content < 40,}
      valChannel := 2,
      
      {Content >= 40,}
      valChannel := 3
    ),
    msg([Time < 4])
  ),
  
  valChannel
)
Note that by using this, it will return channel 0 when time < 4 or Content(c) < 7 and you will probably get an ED error message. If you want to avoid this you have to filter out the possibility that the the above 4DScript is executed when time < 4 or Content(c) < 7.

Regards,

Bart
somayeh
Posts: 3
Joined: Monday 15 July, 2013 - 17:40

Re: warehouse and advanced travsporter

Post by somayeh »

Dear bart
thank you for your answer
i want to do nothing when the time is <4 or content<7
actually the product remain at warehouse until the number reach to 7 or time become more than 4

RGRDS,
SOMAYEH
Post Reply