Is this possible to write apex trigger based on roll-up summary field? - triggers

For example: I have custom object Game__c with rollup summary field TotalMoneyBet__c
Can I update all Game__c records whenever TotalMoneyBet__c is changed on any Game__c record?

Related

Adding new fields in pipeline

How can I add new fields to the schema? We are pulling in records from a SQL database and would like to add a few metadata columns in the pipeline process.
Also, is there a way to use the record duplicator plugin such that the child records have a distinct identifying field? Thanks.

How to automatically populate Custom Item Field with data from a saved report in NetSuite?

Software Platform - NetSuite
Goal - Run a weekly sales report. Use the data from that report to populate a custom item field on the item record (Kit item) in NetSuite.
Can this be done using a workflow or???
Before you try to write a Script or create a Workflow, I recommend you investigate NetSuite's ability to populate Custom Fields with Search Results.
Check out the Help page titled Creating Custom Fields with Values Derived from Summary Search Results for the details.
The basic process will involve creating a Saved Search that generates the data you need, then using the Validation and Defaulting tab on your Custom Item field to select the Search you created.
This should be done using SuiteScript. In your script, run a search, store the data as JSON, and submit the data to the item record. You could submit the data into a single text field on the item record, but it would be better to create a Custom Record Type "Sales Report" which has a list/record field sourced from the item and with the "Record Is Parent" checkbox checked. This will display your custom record on the item in a sublist. Using a Custom Record Type will allow you to store the data over multiple iterations. If you use a field on the item record it will be replaced each time you run the script.

NetSuite Workflow

I need help on how to create the following workflow please. I added a new body field in the NetSuite sand box called “sow.” It is a check box field and I added it to the sales order transaction page. Is it possible to make a formula that says: If “contract type” field that exists on opportunity equals “sow”, check box, if not don’t check box? So the field contract type is on the opportunity and once this is contract type is set to SOW the checkbox SOW on the opportunity should be checked.
Your workflow will need a single State. The State will have a single Set Field Value Action, which will mark the checkbox accordingly. This Action will have a Condition that looks at the value of the Contract Type field.
New Workflow
Name the Workflow
Give it an ID
Record Type: Transaction
Sub Types: Sales Order
Trigger Ttype: Before Record Load
WorkFlow Condition: Condition
Field: SOW -- Compare Type: checked
Workflow Condition

SugarCRM - Mass update Contacts in a Target List

I want to insert todays date in a field in all the Contacts that are in a Target List.
What would be the best way? SQL somehow/somewhere, existing plugin, other ideas?
I am often seeing the use of BeanFactory when I google Sugar Customisations, but has no clue where to insert this code in the sugar files to acomplish what I want.....
Using SugarCRM CE 6.5.8, and Kinamu Reports module to generate the Target List.
Rgds
Petter
Export the Target List so that you get a CSV file
Ensure the CSV contains the Contact records' ID and name fields
Update the CSV to include a column for whatever field you're updating, and add the value you want all records to have
Contacts -> Import Contacts and select Insert & Update to update the records with the new values.
you can add date field in mass update panel
Only fields with the types of relate, parent, enum, contact_id, assigned_user_name, account_id, account_name and date can be added to the mass update panel. Of these you can only create types date and enum with the studio editor (I think).
You would just add 'massupdate' => true to the field description in vardefs.php.
If it's a custom field than search that field file in custom/Extension folder,
and add 'massupdate' => true there do repair and rebuild !

Salesforce trigger to update a field based on a picklist value on a visualforce page

I'm trying to find a way to have a trigger update a picklist field based on a picklist selection from another field. I want the trigger to update on the insert of the record.
For example, I have a field called Address__c that is a picklist field and I want the trigger to select the appropriate location based on the address selected.
Address_c 123 Main Street selected, updates Location_c "Main St."
Address_c 321 Elm Street selected, updates Location_c "Elm St"
I've done an extensive search on this topic but haven't found anything that will update a picklist field from a picklist. Any suggestions?