Gudao
Clearing a dependent Select field when the field that it is depending changes value
I need help in finding a way to clear or dehydrate the 'name' Select Field whenever the LOB Select Field changes
Select::make('LOB')->label('LOB')
->options($departmentLabels)
->live(),
Select::make('name')->label('Name')->searchable()
->options(function (callable $get) use ($groupedUsers) {
$lob = $get('LOB');
return $groupedUsers($lob) ?? [];
}),
so far ive tried the method ->afterStateUpdated() but the problem there is any other field that changes also clears the name field and I can really use a conditional in the method to check if the old state != new state
so far ive tried the method ->afterStateUpdated() but the problem there is any other field that changes also clears the name field and I can really use a conditional in the method to check if the old state != new state
47 replies
Using Salesforce REST api in filament
Is there anybody here who has used Salesforce and their api for a filament project before? I want to use Sushi plugin for it as well but it requires a link to generate a model from static values but have no idea how to get that certain link from Salesforce or what to search to find how to get this link.
8 replies
Edit Page not showing Hidden Field
I am encountering this problem with a Conditional Select Field where if the role of the user is Vendor, another section appears but if it is defaulted as Vendor in Edit User, it is not visible and you have to reselect it to Vendor for it to reappear. How can I fix this?
return $form
->schema([
Group::make()
->schema([
Section::make()
->schema([
TextInput::make('name')->label('Full Name'),
TextInput::make('email')->label('Email'),
TextInput::make('password')->label('Password')
->password()
->dehydrateStateUsing(fn (string $state): string => Hash::make($state))
->dehydrated(fn (?string $state): bool => filled($state)),
Select::make('roles')
->native(false)
->relationship('roles', 'name')
->live(),
]),
Section::make()
->schema([
TextInput::make('user_rate')->label('Rate')
->numeric(),
TextInput::make('user_distance_rate')->label('Rate Per Distance')
->numeric(),
Toggle::make('user_preferred')->label('Preferred'),
])
->hidden(fn (Get $get): bool => $get('roles') != 2) //2 is the id of Vendor role
]),
Here is the code for context
3 replies