Edit Related Record in Modal from an Infolist RepeatableEntry / View Page

Hello, I am trying to edit a Quote record from the view page of an Order (Procurement Request) record the order record has a repeatable entry which lists all the quotes in sections - every section head has an infolist action button I want to open a modal to edit the related quote record - however, if there are any relation fields in the quote record form, filament is trying to find related relation with the Order (Procurement Request) record not the quote record.
use Filament\Infolists\Components\Actions\Action;


Action::make('editQuote')
->label('Edit Quote')
->form(Quote::getForm())
->action(function (Quote $record, array $data) {
$record->update($data);
}),

//FORM function the Quote Model - shortened
public static function getForm(): array
{
return [
Section::make('Quote Details')
->columns(2)
->schema([
TextInput::make('vendor_reference')
->label('Quote Ref. No.')
->required(),
Select::make('payment_term_id')
->relationship('paymentTerm', 'name')
->columnspan(2)
->required(),
]),
];
}
use Filament\Infolists\Components\Actions\Action;


Action::make('editQuote')
->label('Edit Quote')
->form(Quote::getForm())
->action(function (Quote $record, array $data) {
$record->update($data);
}),

//FORM function the Quote Model - shortened
public static function getForm(): array
{
return [
Section::make('Quote Details')
->columns(2)
->schema([
TextInput::make('vendor_reference')
->label('Quote Ref. No.')
->required(),
Select::make('payment_term_id')
->relationship('paymentTerm', 'name')
->columnspan(2)
->required(),
]),
];
}
Ideally I dont want to take user to another page I can also mutate the data before calling the form - the above is part of the code without the relationship field, the modal is opening
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server