Return Value

  
Hi,

I'm new in Outsystems.

just need help on how to get the return value of a query.

INSERT INTO Table1(Name) VALUES(@Name)
RETURN SCOPE_IDENTITY()

or

how do i use the OUPUT parameter in the query?

thanks in advance..
Hi Chris,

Quick question: any reason why you wouldn't want to use the Built-In Entity action Create<YourEntityName> (In this case CreateTable1) instead? That also returns the inserted record's new ID, is much cleaner to look at in a flow and it will work in Oracle too.

Cheers,


Miguel
Yeah I know that part but i didn't use that function of outsystems instead i used advance query for my insert.

the reason behind that I didn'nt use the built-in function is that because I didn't use the edit widget's variables because sometimes some of the data will come from another table and i have to retrive it and the can edit the values.

i need to retrieve the ID once the user save the transaction, the destination will be the Show webscreen and i have to past the ID in it then the user can encode other details of the transaction.
Chris Librero wrote:
the reason behind that I didn'nt use the built-in function is that because I didn't use the edit widget's variables because sometimes some of the data will come from another table and i have to retrive it and the can edit the values.

Hey Chris,

can you explain it better? Sometimes you have input parameters, other times you don't?!
I didn't get it...


Best regards,
--
R. Saraiva
Chris, you're not limited to passing a full, unadulterated, EditRecord variable into the CreateTable1 action.

If you need to assemble info from various sources, simply have a Local Variable (say, MyTable1Record) in the screen action of Data Type Record and Record Definition Table1.

Then use an Assign node to set the individual fields from wherever they may come and pass MyTable1Record to CreateTable1.

Incidently, I admise you to call Table1 something else so you can keep track of what your Entities are...


Miguel
Thank you Miguel..

I understand what you said but i don't know to put it in outsystems.

can you send me a sample oml with version 6.0.1.21 if it just ok with you?

I'm totally newbie in outsystems.

Thank you.
Saraiva wrote:

Hey Chris,

can you explain it better? Sometimes you have input parameters, other times you don't?!
I didn't get it...


Best regards,
--
R. Saraiva
 
 Hi R. Saraiva,

Yes, it depends on the transaction. there is a type of transaction that the user will just get the majority of the inputs from another table(other department) for them to not manually encode the details.
chriztoph wrote:
Thank you Miguel..

I understand what you said but i don't know to put it in outsystems.

can you send me a sample oml with version 6.0.1.21 if it just ok with you?

I'm totally newbie in outsystems.

Thank you.
 
 Hi,

This is a completely contrived example, but have a look and see how it roughly goes.

Cheers,


Miguel
Got it Miguel..

Thanks.

but is there a way to return a value in advance query with insert/update??