You need to sign in to do that
Don't have an account?
Sergio Ruiz Barrios 5
Help with a Batch Class!!
Hi All,
I need to create a batch class to be executed every night to make some field updates.
I have a custom object called rate_card_item_price__c with two lookup fields:
Advert_Assignment__c
Product_Node__c
the batch have to find al the rate_card_item_price__c records with the field borrado__c not equals to "X" , and update the Title_Product_Node__c field (IF IT IS NULL) from the Advert_Assignment__c lookup record with the id of the Product_Node__c lookup field.
Also i need to change the picklist value of the Media_Types__c field from the Product_Node__c lookup record to "Print"
Any idea how to do it?
Thanks in advance!
I need to create a batch class to be executed every night to make some field updates.
I have a custom object called rate_card_item_price__c with two lookup fields:
Advert_Assignment__c
Product_Node__c
the batch have to find al the rate_card_item_price__c records with the field borrado__c not equals to "X" , and update the Title_Product_Node__c field (IF IT IS NULL) from the Advert_Assignment__c lookup record with the id of the Product_Node__c lookup field.
Also i need to change the picklist value of the Media_Types__c field from the Product_Node__c lookup record to "Print"
Any idea how to do it?
Thanks in advance!
Below is the code that you can use.
Batch Class:
To schedule daily run, just run below snippet in Execute Anonymous Window in Developer Console -
FYI... I have tested this in my Dev org and it appears to work fine.
Please mark this as BEST ANSWER if it helps you!
All Answers
Below is the code that you can use.
Batch Class:
To schedule daily run, just run below snippet in Execute Anonymous Window in Developer Console -
FYI... I have tested this in my Dev org and it appears to work fine.
Please mark this as BEST ANSWER if it helps you!
Many thanks for your help Saurabh
Regards.