Skip to main content
Solved

How can i get a record from button press without choosing the record?


Forum|alt.badge.img+4
  • New Participant
  • 4 replies
let table = base.getTable("Orders");
let field = table.getField('Order Info');

let record = await input.recordAsync('Choose a record', table);

I know that if I make this script, I can press the button and then select the record to run the automation.

But what I wanted was to press the button and the script would already get the record without me choosing it.

Is there any way of doing this?

Best answer by Alexey_Gusev

Guics wrote:

I'm doing this, but how can I make the script get the record that I pressed the button? What i need to do in the script?


 

View original
Did this topic help you find an answer to your question?

5 replies

kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6001 replies
  • May 2, 2024

Create a button field in a data grid view and configure the button field to run the script.

Then run the script from the button field in a data grid view (not an interface or shared view).


Forum|alt.badge.img+4
  • Author
  • New Participant
  • 4 replies
  • May 3, 2024
kuovonne wrote:

Create a button field in a data grid view and configure the button field to run the script.

Then run the script from the button field in a data grid view (not an interface or shared view).


I'm doing this, but how can I make the script get the record that I pressed the button? What i need to do in the script?


Alexey_Gusev
Forum|alt.badge.img+23
  • Brainy
  • 1120 replies
  • Answer
  • May 4, 2024
Guics wrote:

I'm doing this, but how can I make the script get the record that I pressed the button? What i need to do in the script?


 


Forum|alt.badge.img+4
  • Author
  • New Participant
  • 4 replies
  • May 6, 2024
Alexey_Gusev wrote:

 


I've seen it, but when I make this script I still have to choose a record after pressing the button.


Forum|alt.badge.img+4
  • Author
  • New Participant
  • 4 replies
  • May 6, 2024
Guics wrote:

I've seen it, but when I make this script I still have to choose a record after pressing the button.


I was dumb, it worked now using what you said. Thanks hahahha


Reply