AnsweredAssumed Answered

Script creating a new record not working

Question asked by ElpicFayl on Jan 4, 2016
Latest reply on Jan 27, 2016 by ElpicFayl

Hi there,

So I am trying to make a basket like thing.

A client has access to some products after getting logged in depending of the Company he works in (so the display of available products is in a portal depending of the Company table),

He can add them to his basket via a + button or substract them via a - button

In order to avoid creating an order each time a client logs in, I only create my order when a client adds the first item to his basket.

But my script appears to be broken.

Here is the code of it:

If [ IsEmpty ($$OrderId)]

   Set Variable [ $$ClientId; Value: Client::__id ]

   New Record/Request []

   Set Field [ Order:: ClientId ; $$ClientId]

   Commit Records/Requests []

   Set Variable [ $$OrderId; Value: Order:: __id]

End if

 

Each time I try to use my script I have a 415 Error with the script debugger and I don't understand where I made a mistake.

If you have any idea or can point me to my error.

Outcomes