Find answers, ask questions, and connect with our
community around the world.

  • Send Email Attachment

    Posted by John Fredy on 16-Apr-21 at 9:09 am

    Hi guys, I am generating several csv files (one for each cost center), my cost center dimension includes an email address. I am using a Turbointegrator process that work fine, but only if I write into a vCostCenter parameter each code. For instance, I write 11020 and the process look into the dimension the email address for Cost Center 11020 and get the csv file “11020.csv” and email the file correctly. What I really need to do is avoid to write the Cost Center, just run the process and do the job itself, scanning all dimension elements.

    Andrew replied 3 years ago 3 Members · 5 Replies
  • 5 Replies
  • John

    Administrator
    16-Apr-21 at 9:17 am
    2 Diamonds
    14 Gold
    2,180 Experience
    Hiker

    Hey John,

    I’m a little confused here.So please correct my understanding.

    You want to send an attachment of a CSV for a Cost Centre to the email address identified in the Email attribute for that specific Cost Centre.

    Is that correct?

    Thanks

    John

    • John Fredy

      Member
      22-Apr-21 at 1:22 am
      0 Diamonds
      2 Gold
      130 Experience
      Scout

      Hi, yes you are correct. I can do this now, but manually, I mean, using a parameter pCostCenter, I enter the codes, one by one, but I am sure there is a way to do it automatically, just run the process and send all emails at once. Thanks for your reply.

      • Andrew

        Member
        22-Apr-21 at 10:11 am
        0 Diamonds
        0 Gold
        470 Experience
        Scout

        Hi John,

        You could do this automatically. I guess it depends a bit on the way your code is currently written. From what I have read above you have a process that has a pCostCentre parameter and you run the process enter the Cost Centre and it creates the file and emails it. You then run it again for the next cost centre etc etc.

        What you could do here is have a Subset of the Cost Centres you need to process and use that as your Data Source. This process would then call your existing process passing the Cost Centre to the parameter so it is all automated.

        So on your Datasource tab you would have the subset defined for example

        “Instance:Cost Centre->CCList” (CCList is the subset)

        You would have 1 Variable such as vCC and this would be Type=String and Contents=Other

        Prolog does not have anything

        Metadata Tab would have code such as

        IF (ELLEV( ‘Cost Centre’, vCC ) = 0);
        ExecuteProcess( ‘eMail Cost Centre’, ‘pCostCentre’, vCC );
        ENDIF;

        If this does not make sense I would be happy to have a quick chat (via zoom or teams??) to discuss it further.

        Cheers

        Andrew

        • John Fredy

          Member
          22-Apr-21 at 10:34 am
          0 Diamonds
          2 Gold
          130 Experience
          Scout

          Andrew, thank you so much. You are right, I will check, The problem is where I put my code into, I Guess, there are code into prolog and I need to move it into data tab to achieve the automation.

          • Andrew

            Member
            22-Apr-21 at 10:56 am
            0 Diamonds
            0 Gold
            470 Experience
            Scout

            John,

            You could do it just on the Prolog Tab by using a loop, but you would still call the existing process.

            Something like this

            DimName = ‘Cost Centre’;
            nCCs = DIMSIZ( DimName);
            nCount = 1;
            WHILE(nCount <= nCCs);
            sCC = DIMNM( DimName, nCount);
            IF( ELLEV( DimName, sCC) = 0;
            ExecuteProcess ( ‘eMail CC Process’, ‘pCC’, sCC );
            ENDIF;
            nCount = nCount + 1;
            END;

Log in to reply.