Booking Form/ Leads Form/CRM – Relationships?

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Using Tap Forms Booking Form/ Leads Form/CRM – Relationships?

Viewing 1 reply thread
  • Author
    Posts
  • May 25, 2019 at 9:13 AM #34944

    John Maschinot
    Participant

    Hi,
    I’m a musician and booking manager for myself and several bands.
    I’ve created a decent (still tweaking) form for booking for when I receive a request for a gig.
    I’d like to integrate a “Leads Form” with my booking form – a list of prospective clients with which I plan to make contact. This form would have much of the same feilds/data as the booking form but also feilds that would not appear on the booking form.
    Once I contact the client and agree on booking a gig, I want to transfer the info into the Booking Form automatically so as to avoid repetition in data entry.
    I looked into creating “relationships” between these 2 forms but am at a loss. Any suggetstions?
    Thanks.

    May 25, 2019 at 11:42 AM #34945

    Sam Moffatt
    Participant

    I use a script in one form to create a new record in another form. On Mac if you create a form script, you can create a new record based on the currently selected record. This creates a copy of the data, not a reference, so if it changes in one place it doesn’t change the other which may or may not be problematic for you.

    You can do it a couple of ways, you can get the form from the document and create a new record (var newRecord = document.getFormNamed("Bookings").addNewRecord()) or if you create a Link To Form from your Leads form to your Bookings for you can add a new record via (var newRecord = record.addNewRecordToField(link_field_id)).

    Then with that newRecord you basically map across the fields from the two forms to update them.

    Here’s an example using the addNewRecordToField approach that I use. It’s slightly simplified example but basically it gets all of the values from the record, adds them to a dictionary and then uses that to save the data to the new record. For what you’re doing this might be useful because you can see which leads lead to the booking.

    
    // Pull some details from this record
    var title = record.getFieldValue('fld-39ca9564ef2347ac93f933bc9a2316ac');
    var price = record.getFieldValue('fld-a2973999a60d4319baf0b4480d6f57a0');
    var note = record.getFieldValue('fld-d0cfab9ec09d497294fbd8b5b52caf16');
    var line_number = record.getFieldValue('fld-f95b68d488cb4b058bbf3de84e1a7c3b');
    var purchase_date = record.getFieldValue('fld-bc2e4b152dee42ac9361539a6e37cb5d');
    var marketplace = record.getFieldValue('fld-fa37906add2942c88bce3b500561c42d');
    var order_id = record.getFieldValue('fld-8228040b4641449b96aabfaea15f1ac5');
    var store_name = record.getFieldValue('fld-c153da2f9a504be4b6fee4b5b62a1c11');
    var ship_date = record.getFieldValue('fld-6ab700ccc11d418fbd27d8899d00c7a9');
    var delivery_date = record.getFieldValue('fld-4b1c4180dc1b4bb08b32d16fa60cae66');
    var purchase_key = record.getFieldValue('fld-3e49aaa5bc32429c8f0f0f234878356d');
    
    // Details field names
    var details_title_id = 'fld-0d0edd2552ea461e929f806a4e5552b5';
    var details_price_id = 'fld-08129d71ab0f4fa4a2749456281fca07';
    var details_notes_id = 'fld-bf19d52c18cb4f5198df191ef7902e1b';
    
    var details_purchase_date_id = 'fld-ccbd9a8f51d34246bebfb31aa4e397dd';
    var details_ship_date_id = 'fld-cb3a9886ac7f4ec487447801a3911a1a';
    var details_received_date_id = 'fld-bb17d48e41c7423692ab586f6c884d05';
    
    var details_order_id_id = 'fld-e3e66a0f2e5c4df7b9496f65355e0bcf';
    var details_marketplace_id = 'fld-c163aba17ae64c4d93b5a53819a139dc';
    var details_store_name_id = 'fld-3d98dc6cdcae4a88909c97c80dde7bfb';
    
    var details_state_id = 'fld-9402f8c0d53c43b986fee4ebc3468929';
    
    var details_shipping_tracking_number_id = 'fld-6ea45a9c141343628940bfbcfa38ee90';
    var details_shipping_carrier_id = 'fld-12644a7a4ae24ed8a7926123832d3557';
    
    var details_purchase_key_id = 'fld-8be9b2c2603f458f8349082237c41964';
    var details_order_line_number_id = 'fld-da763fa0946d4be79039b4e828cf85f4';
    
    var data = {
    	// Order Item Details
    	[details_title_id]: title,
    	[details_price_id]: price,
    	[details_notes_id]: note,
    	[details_order_line_number_id]: line_number,
    	
    	// Order Details
    	[details_purchase_date_id]: purchase_date,
    	[details_ship_date_id]: ship_date,
    	[details_received_date_id]: delivery_date,
    	[details_order_id_id]: order_id,
    	[details_marketplace_id]: marketplace,
    	[details_store_name_id]: store_name,
    	[details_purchase_key_id]: purchase_key,
    };
    
    // Last but not least push the new record.
    var details_id = 'fld-ac04de32d98242b88333977c89526fc1';
    var detailsRecord = record.addNewRecordToField(details_id);
    detailsRecord.setFieldValues(data);
    document.saveAllChanges();
    

    One of the advantages of the script approach for me is that it let’s me splice in extra data or set new values at creation time as well. Another trick I do is use a form script to use a prompter to ask for extra data and integrate that into my new record.

    Scripting manual section: https://www.tapforms.com/help-mac/5.3/en/topic/scripts

Viewing 1 reply thread

You must be logged in to reply to this topic.