Date: 10 July 2011
When we are using Accpac views to insert data into Accpac most of the validation it does by itself. This is one of the most important reasons, why we need to use Accpac views to insert or update data into Accpac Database.
The protocol that Accpac follows while doing Insert is as follows:
1. If the next header number is generated by the view, Put zero in the header number field and use Init to generate the next available header number. If the header number is specified by the caller, use Init to initialize the fields of the header, then Put the header
number in the header view.
2. Put the fields in the header.
3. Init detail to initialize the fields.
4. Put zero into the detail number field to insert from the start.
5. Put values in the other detail fields.
6. Verify detail. (Optional.)
7. Insert detail.
8. Go to step 5 until no more detail.
9. Verify header. (Optional.)
10. Insert the header. (This will do a Post of the details.)
Protocol for updating the data in Accpac is as follows (Including deleting the details):
1. Put header key into header view.
2. Read or Browse/Fetch the header view to get to the header.
3. Put the fields to be updated in the header view. (Optional.)
4. Put detail key into the detail view.
5. Read or Browse/Fetch the detail view to get to the detail.
The header number in the detail view should have been set by the header (because of the explicit composition).
6. Put the fields to be updated in the detail view.(Optional.)
7. Verify the detail. (Optional.)
8. Update or delete the detail.
9. Go to step 4 to process another detail.
10. Verify the header. (Optional.)
11.Update the header. (This will do a Post of the details.)
Browse/Fetch is the functions that help us to navigate through the data. Browse property do not have the “Where” or “Having” clause so we can use if condition to filter our data.