You need to sign in to do that
Don't have an account?
GYAN ANDRUS
Hi Anyone please help for this trigger
trigger ColorCodes on PBSI__PBSI_Item__c (after insert,after update) {
Set<string> aliasscope = new Set<String>();
List<Item_Master_Color__c> mo = Item_Master_Color__c.getall().values();
system.debug('ItemTransDataLIST ------->'+mo);
for (PBSI__PBSI_Item__c itemCod : Trigger.new) {
aliasscope.add(itemCod.Color__c);
}
}
I have created the custom Settings(list) called Item_Master_Color__c,I have name and Color Code fileds in Item_Master_Color__c(Custom settings).I want to update the the custom Setting color code dynamically in (-Item_Color_Code__c)Custom field in PBSI__PBSI_Item__c object,If i insering and updating the record in PBSI__PBSI_Item__c object,I want to automatically update the custom Setting COlor Code
In Custom Setting i have a name -PINK
color_Code-789
Set<string> aliasscope = new Set<String>();
List<Item_Master_Color__c> mo = Item_Master_Color__c.getall().values();
system.debug('ItemTransDataLIST ------->'+mo);
for (PBSI__PBSI_Item__c itemCod : Trigger.new) {
aliasscope.add(itemCod.Color__c);
}
}
I have created the custom Settings(list) called Item_Master_Color__c,I have name and Color Code fileds in Item_Master_Color__c(Custom settings).I want to update the the custom Setting color code dynamically in (-Item_Color_Code__c)Custom field in PBSI__PBSI_Item__c object,If i insering and updating the record in PBSI__PBSI_Item__c object,I want to automatically update the custom Setting COlor Code
In Custom Setting i have a name -PINK
color_Code-789
You need to call (insert/update/upsert) DML operation for changing value in custom settings after you set desired code.
For instance in the end of trigger put something like
trigger ColorCodes on PBSI__PBSI_Item__c (after insert,after update) {
Set<string> aliasscope = new Set<String>();
Map<string,Item_Master_Color__c> mapCodes = Item_Master_Color__c.getAll();
mapCodes.containsKey(Color_Code__c);
system.debug('ItemTransDataLIST ------->'+mapCodes);
String colorName;
String colorCode;
for (PBSI__PBSI_Item__c itemCod : Trigger.new) {
}
}
Please try below code. Instead of PINK you should pass your PBSI__PBSI_Item__c field API name which is contains color name.