PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07/18/2017 9:38 AM by  John Henley
IPD Designer - Custom Function
 10 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Roger French
Private
Private
Veteran Member
(1266 points)
Veteran Member
Posts:522


Send Message:

--
07/13/2017 10:04 AM

    IPD Designer version 10.1.1.49

    Windows 2012, Landmark 10.x

    So I want to add a custom function to utilize in designer.

    I've added the custom code in pflow.js in \system\LPS

    I stopped/restarted all services in Landmark and LSF.

    Exited and logged back into Process Designer. I still can't see the custom function I just created in the drop down of any assignment node.

    I rechecked everything. Still the custom function doesn't appear.

    Yes, I'm using this in the header part of the pflow.js. I even added it to the plfow.js on the LSF server. Yes all of the actual code in the function is in the pflow.js, and it's been checked and verified.

    Anyone know why it's not appearing in IPD?

    Thank you in advance.

     

    //*****Function Definition -->String=TestingFunc(varString)                                                   //

    Bob Canham
    Private
    Private
    Veteran Member
    (535 points)
    Veteran Member
    Posts:193


    Send Message:

    --
    07/13/2017 10:08 AM
    Hi Roger. Where is your IPD installed? In addition to putting the function on the server LPS directory, you have to put it in your IPD folder for the instance you're running (i.e. C:\IPDesigner\IPDPrd).

    Also, I would recommend adding functions to pflow_user.js rather than pflow.js. The pflow_user.js is meant for user defined functions and isn't overwritten when you install service packs.
    Roger French
    Private
    Private
    Veteran Member
    (1266 points)
    Veteran Member
    Posts:522


    Send Message:

    --
    07/13/2017 10:26 AM

    Hello, yes I'm aware of that using pflow_user.js. I am just doing some simple testing for now.

    Just an observation about a custom pflow.js. If it's to be copied to the local directory where IPD is installed, essentially that is saying that a custom function for server side processflow resides on a client side drive/directory. Correct? Not sure if that is actually correct, because shouldn't all code reside server side? Because obviously what happens to the function in the flow if the client side pflow_user.js or pflow.js function is removed from the client side? That would mean the function isn't available any longer. 

    Just as a test, I copied the pflow.js to the install dir on client side. Logged back into IPD and the custom function still doesn't appear.

     

    Bob Canham
    Private
    Private
    Veteran Member
    (535 points)
    Veteran Member
    Posts:193


    Send Message:

    --
    07/13/2017 10:52 AM
    You have to have the file in both places. When it runs it uses the server side. But when you're developing, you're using the local version. To be honest, I haven't tried modifying the pflow.js in a long time, I switched to the pflow_user.js as soon as it became available so I don't know if there is some other gotcha with editing the system provided file.
    Bob Canham
    Private
    Private
    Veteran Member
    (535 points)
    Veteran Member
    Posts:193


    Send Message:

    --
    07/13/2017 10:54 AM
    Just to verify, do you have multiple IPD instances on your client? I have 2, one for Prod and 1 for Test, so the custom function needs to be in both install directories.
    Roger French
    Private
    Private
    Veteran Member
    (1266 points)
    Veteran Member
    Posts:522


    Send Message:

    --
    07/13/2017 10:56 AM

    Nope, just one simple instance.

    I have it in both places client and server. Still doesn't appear.

    I'll open an incident. 

    Thanks.

    Woozy
    Private
    Private
    Veteran Member
    (3469 points)
    Veteran Member
    Posts:701


    Send Message:

    --
    07/13/2017 10:57 AM
    The biggest risk to modifying the pflow.js directly is that it could be overwritten through updates. Also, it makes it easy to identify your custom functions compared to the delivered functions. FYI - you can also use this to overload the existing functions if that is helpful to you.

    I've never had problems seeing the custom functions in IPA once the code is added to the pflow_user.js file, so it makes me think that Bob is right and that maybe your custom code isn't in the right folder. Just a guess though.
    Kelly Meade
    J. R. Simplot Company
    Boise, ID
    Tim Cochrane
    Private
    Private
    Veteran Member
    (450 points)
    Veteran Member
    Posts:154


    Send Message:

    --
    07/17/2017 12:57 PM
    Agree...check you've got it in the correct folder.

    I just added a new function in C:/IPDesigner/CU56/pflow_user.js, went into my CU56 Designer install and I can see the new function. I keep multiple CUs loaded, and CU56 is where i'm currently working in
    Tim Cochrane - Principal LM/IPA Consultant
    Roger French
    Private
    Private
    Veteran Member
    (1266 points)
    Veteran Member
    Posts:522


    Send Message:

    --
    07/18/2017 8:55 AM

    I tried upgrading to CU52.

    It's now appearing in the drop downs.

    Thanks all, I guess it was an earlier version of IPD that wasn't working for me.

     

    David Williams
    Private
    Private
    Veteran Member
    (3022 points)
    Veteran Member
    Posts:1018


    Send Message:

    --
    07/18/2017 8:58 AM
    Your version of IPD must match your version of Landmark. Installing a different version will cause issues!
    David Williams
    John Henley
    Private
    Private
    Senior Member
    (9563 points)
    Senior Member
    Posts:3205


    Send Message:

    --
    07/18/2017 9:38 AM
    Double-check the syntax you are using the in pflow_user.js file.
    In particular, in addition to the function itself, there needs to be a comment in the heading for each function definitions in order for IPD to show them correctly.
    //*****Function Definition -->String=myCustomFunction()//
    Thanks for using the LawsonGuru.com forums!
    John
    You are not authorized to post a reply.