function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
CezuCezu 

Trigger - i want reserve items

Hi im newbiee

 

I have problem i write : 

 

trigger createReservation on Rezerwacja__c (before insert, before update) {

Set<id> rezSet = new Set<id>();

for (Rezerwacja__c rez : trigger.new){
rezSet.add(rez.Item__c);
}


List<Rezerwacja__c> rezList = [SELECT Rental_Date__c, Date_of_return__c, Status__c
FROM Rezerwacja__c
where id in :trigger.new];
List <Item__c> itList = [SELECT id, name FROM Item__c WHERE Item__c.Rezerwacja__c IN : rezList];

Map<Id, List<Rezerwacja__c>> rezMap = new Map<Id, List<Rezerwacja__c>>()

 

 

 

i wants the item was not available in a given period of time

Can somebody help me ?? 

Mayank_JoshiMayank_Joshi

Do you mind ,if you could explain me your requirment in detail . Then ,I can have a look ... !! 

AsiereikiAsiereiki
The variables in the trigger only lives during the insert or the update. If you want to read that Set later, you need to save it in another static class.