TRIGGER SALESFORCE/APEX - class

I have to complete a challenge and i have no idea where to starts it.
I created the object "customer", with the fields: name, birth date, age, and account (lookp up to account)
1- Dont allow insert record if the birth date is empty, and shows an error message to the user.
2-dont allow to create a record of customer with age less than 18, and shows an error message to the user.
3-if the field account is empty shoud create automatically an account and insert on the field.
4-when a record is created a new opportunity should be create and the field customer should be filled.
Can someone help me with that?

Related

TYPO3 TCA fill in a field with the year of creation and the UID

I have created a new field in the TCA. This is now empty. Now I would like to fill this in with the creation year and the current UID when creating the data record or afterwards.
Do I have to do this via hooks or tasks?
As the uid of a new record is unknown until the record is saved there could not be a prefill.
Of course you could create a scheduler task to set a field with the value from the creation date (field cr_date) and uid regulary.
But a better solution would be a hook after the record creation as it would be less overhead.
On the other side: as the relevant data already is stored in every record (cr_date and uid):
do you realy need another field with the same information?

Workflow - get transaction Created By Field

How do I get Created By field of any transaction in workflow. I'm creating a workflow that is applied to Bill record. Bill record is created from PO. I want to send an email to the created by of PO record when Bill gets created.
But I am unable to find that field in workflow.
Hi Refer "Access Purchase Order Fields on Vendor Bills via SuiteFlow"
Suite answer id :37827

Autofill fields in a subform of access2003 based on a previous entry/field

First off, I am new at this. Secondly, yes I am working with access 2003 and this is not by choice. It is the program that my job has provided to me, so I am stuck using it.
Question: I have created a form with a subform in access2003. The form has three fields: State, Year and CompanyName.
The sub form then lists three fields: CompanyID, Date, and AmtPaid (in dollars).
I would like for the subform to autopopulate/autofill in the CompanyID in the subform each time I have users enter a new line of data in to the subform.
For example: I choose the following in the form...State=PA, Year=2017, CompanyName=ABC (ID=2).
I then can enter values in to my subform...CompanyID=2, Date=3/1/17, AmtPaid=$10.00.
When I go to enter a new line of data, for example the amount paid for the same company on 4/1/17, I would like for the CompanyID to automatically fill in "2". My goal is for this field to autofill for each company ID since I am planning on avoiding user error and also planning on hiding this field.
I understand the default assignment in the properties window of the field, but if i enter in the number "2", then "2" will be entered by default for all companys, not just for company ABC. I believe i have to write some sort of code that references a previous field or the first field in the subform, so that the new line copies what has been entered previously.
Any help is much appreciated in advance.

How do I make filemaker recognize records from an imported file

I imported an excel list of student names and ID's. The teachers job is to either scan or manually enter student ID's and when done so, filemaker will automatically add the student name from the excel list. If the teacher mistyped the student ID, then the name would not show because it is not in the excel list. How do I make filemaker tell the user to stop and retype the student ID not allowing the teacher/user to add anymore students until they fix the current mistyped ID?
How do I make filemaker tell the user to stop and retype the student
ID not allowing the teacher/user to add anymore students until they
fix the current mistyped ID?
You can (and should) validate the field. The validation here could be as Member of value list: [StudentIDs], where "StudentIDs" would be a value list using values from the StudentID field in the imported table.
Note: Filemaker's validation error messages can be somewhat intimidating to the users, so you may consider adding a script triggered OnObjectValidate to run a "pre-validation" check and guide the user in case of an invalid entry, for example:
If [ IsEmpty ( FilterValues ( Attendance::StudentID ; ValueListItems ( Get (FileName) ; "StudentIDs" ) ) ) ]
Show Custom Dialog [ Message: "There is no student with this ID. Please correct your entry."; Buttons: “OK” ]
Exit Script [ Result: 0 ]
End If

retrieve values from database using Id in mvc2

I want to retrieve particular values from database using Id..
Orgvasplans
Id
vasplanId
orgId
createdDate
vasplans
Id
Name
Amount
Validity
The "vasplans" table values are already stored in database.. when I click button, it is automatically taken value from vasplans table and store into orgvasplans table. Also created date will store..
In view, it will retrieve the values from orgvasplans table... But I have problem with vasplanId. can anyone please check and tell me?