cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Network class methods

michaele
1-Newbie

Network class methods

Hello I am trying to utilize methods of the "Network" class...  Am having some challenges

I have a network called "CustomerNetwork"  I am trying to  manipulate it through code

one example  removing an entity from the Network

my code for this is

Networks['CustomerNetwork'].RemoveFromNetwork('Store5');

when I test this code I get the following error

Wrapped java.lang.Exception: Invalid parameter type for service: [RemoveFromNetwork] on CustomerNetwork Cause: Invalid parameter type for service: [RemoveFromNetwork] on CustomerNetwork..

According to the class reference the parameter type should be string..  I have entered a string in quotes , In previous tries I have passed a string as a parameter and get the same error...  I have tried several other methods where I needed to pass a parameter and get similar results

2 REPLIES 2
paic
1-Newbie
(To:michaele)

I recommend you use the snippet.

var params = {

  name: undefined /* STRING */

};

// no return

Networks["AcmeVending"].RemoveFromNetwork(params);

As you can see it is using not a String in the Service but a JSON Object.

michaele
1-Newbie
(To:paic)

Many thanks!!

Top Tags