Let's Get Funcy - Epicor Functions

I’m having trouble calling my test function using ReST. I’ve tried in a browser URL using:

/api/v2/efx/<YourCompany>/<YourLibrary>/<YourFunction>

But I get an error about api key. I append the api key with ?x-api-key= but still get the same error.

I tried to locate it in the swagger page but I don’t see it listed. I recycled the app pool but I didn’t reboot the server, maybe I should try that.

Any ideas?

Thanks,
Chris

1 Like

@Aaron_Moreng nothing to announce yet but REST assured we are looking at options (Pun intended - @Mark_Wonsil is a horrible influence). This is something we need internally (CSF, CSG, Industry verticals) so I hear the audience feedback well…

2 Likes

What can I say? I believe in dad jokes in transit and at REST.

3 Likes

Here’s the official documentation I found so far:

Epicor Learning Center Video ’ Extending Your Business Processes Through Epicor Functions’: Epicor Learning Center

10.2.500 Help:

4 Likes

Look for a new batch of Epicor Learning content as well. Lots of efforts coming from them.

3 Likes

6 posts were split to a new topic: Epicor Functions Test

EFX question on 600.3. It does not seem possible to call a function from another within the same library. Is that accurate or am I missing something? @SAD wasn’t sure if you had any input on that topic.

1 Like

Sorry, I literally have no time to read forum (and Yammer too).

However, regarding this specific question I can provide exact answer… No, EFx does not support calling functions from the same library with a caller. It still is in roadmap, but not for near future.
This feature requires quite a lot of additional code, especially in UI.

3 Likes

In the meantime, we can refactor out those oft used routines in a different library I guess…

2 Likes

Have any one tried consuming function from BPM using C# Code not with the help of Invoke.

If you have done please share me the details

1 Like

Trying to do it without the widget? but just in straight BPM code? That would be something like this.

string arg1 = "INPUT_OUTPUT";
var res = (Tuple<String>)this.InvokeFunction("Library","Method", Tuple.Create(arg1));
string outvar = res.Item1;
2 Likes

This works well, not what I want, but it works fine.

2 Likes

Hi All,

Have anybody tried calling a BO objects like GetByID or Update or GetNew from Function C# Code Wizard instead of Invoke BO.

Please let me know.

Thanks,

1 Like

Yeah works fine. Different syntax than a BPM though.

using Ice.Tablesets;
 
this.CallService<UserFileSvcContract>(uf => {
  try
  {
    UserFileTableset newUser = new UserFileTableset();
    uf.GetNewUserFile(ref newUser);
    newUser.UserFile[0].UserID = propDcdUserID;
    newUser.UserFile[0].Name = propNewUserName;
    uf.Update(ref newUser);
 
    newDcdUserID = newUser.UserFile[0].UserID;     
  }
  catch (Exception ex)
  {
    pcOutMessage = ex.Message;
  }  
}
);
3 Likes

Sure, it works but “generally” the widgets tend to upgrade better in that issues show up quicker than in code since Epicor can’t write upgrade programs for code blocks.

1 Like

I don’t know that they show up any quicker than custom code either way it won’t compile. Widgets are ok for something simple but once it starts looking like the flying spaghetti monster I’m out and it all goes to custom code.

4 Likes

Oh, I’m not against code, anytime I want to use Json or call another REST service, it’s the only way to go. Sure, the code will just not compile either way but at least it’s “possible” for Epicor to see which Business Objects are being used in Widgets and know where they’re called instead of grep’ing code and finding all instances of Ice.Contracts.UserFileSvc or CallService< UserFIleSvcContract > or…

1 Like

I know this is an old topic, but hoping this can help others trying to start out with these REST functions. For now, my capability is RESTricted.

I’m testing out these functions and am having some issues. Trying to call through code in a form customization, I get an authentication issue.:

To try and troubleshoot, I thought I’d try accessing through browser with a simple function (Library ‘Test’, Function ‘GetANumber’) that takes no input parameters and returns a number, but when I try and run it, I get a list of the libraries and it doesn’t seem to run the function:

Any ideas what I could be doing wrong here?

I should note that calling the built in services work just fine:

1 Like

you certificate is not trusted by the client application. In browser as well you can see that Not Secure icon is shown. Do you use self-signed certificate?

2 Likes

Thanks Olga. I ended up installing the certificate on the client machine and it’s all working now.
Is this the expected solution? How do others manage the distribution of the certificates? Is it just one of those things that you add to your client install script for all machines?

1 Like