Question :
If I have two table :
Workshop |
|
Material |
SN |
M_SN |
|
Material _SN |
Material _ Name |
|
Workshop _Quantity |
Quantity |
I need to make a trigger that automatically decreases a ( Quantity ) in Material Table when I use this material in ( Workshop _Quantity ) in Workshop Table.
Does anyone know how to do it please ?
many thanks,
Aggy
Hi Aggy,
To do this you can create an Update Field Value trigger in the Workshop object, these two objects / tables must be related.
Trigger Properties values:
Record = Material
Field to change = Quantity
In the formula area specify the sample code below:
return parseInt("{!R123456.quantity}") - 1; //R123456 - relationship name
Hope this may help.
Regards,
Orchid
Hello Orchid,
Thanks very much, I'll try that!
best regards,
Aggy
Hi Orchid,
I don’t want to decrease the value of a ( Quantity ) in Material Table 1 , but I want to decrease it by the same value of ( Workshop _Quantity ) in Workshop Table.
That’s mean I need ( Quantity in material Table = Quantity in material Table – workshop_quantity in Workshop Table ).
Can you confirm please ?
thanks,
Aggy
Hi apodsiad,
You can specify a return value like:
return parseInt("{!R123456.materialQtyHERE}") - parseInt("{!workshopQtyHERE}"); //R123456 - relationship name
Regards,
Orchid
Many thanks Orchid, will try that
Aggy