11 January 2011

Random Generation of number

static void RandomGenerateEg(Args _args)
{
RandomGenerate objRG = new RandomGenerate();
Random objRandom = new Random();
;
//This generates random numbers specified within the given range
//info(int2Str(objRG.randomInt(10,55)));

//This generates random numbers
info(int2Str(objRandom.nextInt()));
}

1 comment:

  1. Create in class Global method

    static int RandomGenerator(int _from, int _to)
    {
    return xGlobal::randomPositiveInt32() mod (_to - _from + 1) + _from;
    }

    then call it from any place like
    i = RandomGenerator(-99, 56);

    ReplyDelete

Give me the commetns and solutions

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.