I am a fairly new to servoy, and have come from a filemaker backround, I am currently designing a basic invoice system for a client, and would really appreciate some help with setting up relationships etc. Is their a tutorial on this subject. eg setting up relationships between invoice tables and invoice_line_item tables. etc
Welcome to the wonderfull world of Servoy. You will feel ‘alive and kicking’ after some time with this great tool. On the other hand I can imagine you feel overwhelmed.
All answers should be in the crm solution that is shipped with your developer installation. Don’t let the thing scrare you off with it’s ‘banana-interface’, there are some real good examples of relationships etc. in there.
As per the previous posts by Graham and (legendary;)) Marcel, welcome you can look forward to a very rewarding if long learning curve. O’reilly do a great book on Java Scripting if you don’t already have it its essential for Servoy!!
Hi All,
I am sorry in advance for what is probally a supid question, I have looked at the sample CRM solution and found what seems to be the snippet of code that would work. But I am having trouble understanding where the section is that returns the selected value from the popup customer list to the invoice form.
if(globals.formName == “orderDetails”)
{
forms.orderDetails.company_id = companiesid;
var portalrows = forms.orderDetails.elements.portalLineItems.getMaxRecordIndex()
for ( var i = 1 ; i <= portalrows ; i++ )
{
forms.orderDetails.elements.portalLineItems.recordIndex = i;
forms.orderDetails.orders_to_line_items.company_id = companiesid;
}
This is the bit I don’t understand, the method does not need to return any data to a portal row, only to a single feild on the form, I almost want to just copy the required feild in the related form and paste it in to the required feild in the target form, infact this is the way filemaker performed the action I require, I know there must be a simple solution to what I want (and I am just a Dummy)
The bit that you need to concern yourself with then is :
forms.orderDetails.company_id = companiesid;
This bit is the equivalent to a FM Set Field step and is setting the ‘company_id’ field - which is on the ‘orderDetails’ form - to the ‘companiesid’ which you chose from the list of customers in the list.
The loop which Marcel indicated then cycles through each related record and sets the chosen company di into each of those records - but at this stage you don’t seem to need that !