These are chat archives for nanafifieldsage/Sage-X3-Hackathon

4th
Jul 2016
GeoffDatel
@GeoffDatel
Jul 04 2016 12:21
Has anybody got the URL to the RESTFul POST command for $edit, so that I can get the Parameters please? I'm trying to get round a "Saving has failed" error
William Boon
@wboon
Jul 04 2016 13:27
We're having problems sending messages from an Arduino device to the AWS IoT. How do we do this? We can get the message from the Arduino and we've setup the AWS IoT account but we don't know how to the connection. Really appreciate help with this.
Oliver Brown
@DotNetHitMan_twitter
Jul 04 2016 14:41
@wboon hi William, what code are you using to read the values from the Arduino?
William Boon
@wboon
Jul 04 2016 14:42
@DotNetHitMan_twitter dot We're trying phyton now
Dominique BOPP
@dbopp
Jul 04 2016 15:19
@cchaize You must use the latest server supplied to your team. The original one was done before I implemented the last example.
@GeoffDatel the URL starts with the server address and service , followed by /api/x3/erp/folder_name/class, then by ?representation=representation.$create The body contains the values of the 4 properties
Dominique BOPP
@dbopp
Jul 04 2016 15:25
@GeoffDatel on edit it is more complicated because you need to create first a working copy. I would suggest you to implement an interface class that performs the update on the class you want to update
Dominique BOPP
@dbopp
Jul 04 2016 15:38

Here a small example of code you would add to your interface class:

Class update : # Technical interface class

$METHODS

Case [L]CURPTH
When ""
Case [L]ACTION
When "AINSERT" : # An update has been requested

    # 1) Instantiate the main class to update
      Local Instance MYINST Using C_MYCLASS
      MYINST = NewInstance C_MYCLASS AllocGroup null

    # 2) Read record, then change values 
    #     (conditions can be different, here we check property existence
    #       in the interface class)
      OK=fmet MYINST.AREAD(this.MYKEY)
      If type(MINST.PROP1)>0 : MYINST.PROP1= this.PROP1: # First field
      If type(MINST.PROP2)>0 : MYINST.PROP2= this.PROP2: # Second field
      If type(MINST.PROP3)>0 : MYINST.PROP3= this.PROP3: # Third field

    # 3) Update the record (you should also check the return status)
      OK=fmet MYINST.AUPDATE
      FreeGroup MYINST
  Endcase

Endcase
Return

Dave Laird
@l4rd
Jul 04 2016 20:41
@dbopp the instance should be rebooted now, can you try again
blob
Teddy Chambard
@tchambard
Jul 04 2016 21:03
Hi Dave, it still doesn't work...
http://52.30.57.116:1880/red should respond...
Dave Laird
@l4rd
Jul 04 2016 21:04
I'm not sure what to try - If I stop and start the instance (rather than reboot) it will change the IP. Do you want me to try that?
Teddy Chambard
@tchambard
Jul 04 2016 21:06
Forget it.... We will do by another way
thanks
Dave Laird
@l4rd
Jul 04 2016 21:07
Sorry Teddy, I'll check the documentation and see if I'm missing anything
Teddy Chambard
@tchambard
Jul 04 2016 21:07
Don't worry :)
Dave Laird
@l4rd
Jul 04 2016 21:30
Trying to do a POST to X3 and I'm getting the following error...
Response: {"$diagnoses":[{"$severity":"error","$message":"License error for product 1 and version 9.","$stackTrace":"License error for product 1 and version 9."},{"$severity":"error","$message":"User does not have any badge for product 'Sage X3'"}]}
Dominique BOPP
@dbopp
Jul 04 2016 21:42
This happens if you didn't close properly X3 instances when making several attempts. The number of badges of the license are limited. The best way to clean up quickly is to restart the Syracuse service
Dave Laird
@l4rd
Jul 04 2016 21:43
Thanks @dbopp - seems to have cleared up now :)
William Boon
@wboon
Jul 04 2016 22:42
@dbopp @tchambard We do not seem to have enough badges for everyone to test. We are having problems with this. Can you provide us with more badges or tell us how we can create new badges. Thanks.
Dominique BOPP
@dbopp
Jul 04 2016 22:43
The onlyway is to ask for another license, but this will be difficult at that time. What might happen is that you loose some connections if for any reason (when using connectors) you don't release sessions. The best way to fix it is to restart Syracuse service
William Boon
@wboon
Jul 04 2016 22:44
@dbopp We can't restart the Syracuse service as this will causes too many problems everyone. It is not really feasible at this time. Is there a way for us to create more licenses?
Dominique BOPP
@dbopp
Jul 04 2016 22:46
I have no other solution. Licenses generation is highly secured, and getting a new license goes through sales administration. If you can get an existing license from an other existing server, do it, otherwise I have no solution.