Can a logic hook send or receive data?

I am trying to send an AJAX to a loogic hook to get the id of a newly created Case, but I am not getting an answer, also and I have been trying to do it by CURL towards another php but I am not getting any answer either, is this possible or not?.

Thanks!

Im working in Sugar CE 6.5.22.

  • I am not sure what you mean by sending an AJAX to a logic hook...

    In a logic hook you have the bean as one of the parameters being sent to your method ($bean, $event, $arguments)

    An After Save logic hook will include the $bean->id of the record you just saved (note that a before save does not yet have one). 

    FrancescaS

  • Instead of a logic hook I think what you may want is an Entry Point if you are trying to send an Ajax call to create a new Case and then get the id in the response.

  • but since it is a new record when it is created, it still does not have an id so it would return empty, no? For that reason I use logic hook with the after_save event

  • I read that a logic hook does not return data to the browser, is this true? I want to interact with the user with a prompt to receive a value

  • Hey David. 

    Your entryPoint would take the passed parameters of the Ajax request then create and save the new Case. After you save it you have the ID which can be included in the response.


  • Let me explain, I hope you could help me.

    I have created a js file and I have included it in custom / modules / Cases / metadata / editviewdefs.php to be able to send the form by clicking save to a php that I have, and to do some validations and be able to send an email, the problem that I have is that since it is a new record, it does not yet have an id, with which I cannot make validations, so I thought that I could send an ajax to the logic hook and that it would return the newly created id ...

    Why don't I use logic hook?

    I read that a logic hook does not return data, and in some cases I have to return a data, I do not know if I explain myself correctly

  • or what address should my entry point have? to get the id of the created record.
    thank you very much Shad