Design Feedback

Viewing 10 reply threads
  • Author
    Posts
  • July 22, 2020 at 9:04 PM #41455

    Rocky Machado
    Participant

    Hi Team – I want to get some design ideas from the team. I have a Trade Summary form, which the Layout will always be in the Multi-Column List View. There are cases where I want to get redirected to a form that has all the Trades related to the Trade Summary. When in the Multi-Column List View I notice that I can not access my link form (which allows me to go to my trades). So what I did in the Trade Summarry form is add a website field, which is populated with the Tapforms records.getUrl. I can click the link and get redirected to the trades in the other form. The only thing I do not like about this approach is that process is slow when it redirects to the tapform url. Is there a better solution? Keep in mind I do not want to toggle back and forth from the single to multi column view.

    thanks,
    rocky

    July 22, 2020 at 10:36 PM #41465

    Brendan
    Keymaster

    Hi Rocky,

    That’s an interesting workaround for you.

    The multi-column list view is not great for showing any linked data. Originally it just displayed the summary calculation value. But I suppose having an arrow button in there that you could click on to take you to the linked form would be something perhaps. Although it wouldn’t know which linked record to show you because you can’t access a table of records from that small cell in that view.

    You could alternatively show just enough of the record details view down below to get access to the linked records for the selected record above. Then click on the specific child record you want to visit from down below.

    Thanks,

    Brendan

    July 23, 2020 at 5:48 AM #41470

    T.L. Ford
    Participant

    A simple field type of “button” that ran a script (like the Script field type) would work wonders for this (and other uses). The multi-column grid view could show the button with its text label on it.

    My current play looks like the attached. I put the button on a different layout and put that layout on the bottom split of the view.

    Attachments:
    You must be logged in to view attached files.
    July 23, 2020 at 6:46 AM #41476

    Rocky Machado
    Participant

    Hi Guys – Thank You for the idea’s. I didn’t think about splitting the screen. I’ll go with that option.

    Thanks again,
    rocky

    July 24, 2020 at 7:40 AM #41495

    Rocky Machado
    Participant

    Hi Brendan / T.L. – I took your ideas and created the following layout. Just wanted to share with you.

    Brendan – the Stock Performance text on the right I’m using the markdown field

    thanks again,
    rocky

    Attachments:
    You must be logged in to view attached files.
    July 24, 2020 at 11:40 AM #41497

    Brendan
    Keymaster

    That’s really cool Rocky! That’s an incredible layout you’ve made there. I’m always amazed at what I see customers doing with Tap Forms. It’s phenomenal what you’ve create.

    July 24, 2020 at 12:02 PM #41498

    T.L. Ford
    Participant

    Looks impressive! What’s your code on that Refresh Layout button?

    – T

    July 24, 2020 at 12:21 PM #41499

    Rocky Machado
    Participant

    Here is a the function I call. Basically I call another script that adds information to the markdown field. The reason I have the script broken out is that I call applyStockPerformance(fldStockPerformanceKey,fldTradeId); multiple locations (i.e Upload Load process, refresh layout and when I’m expiring options module). Again thanks for the idea.

    document.getFormNamed('Script.Manager').runScriptNamed('Globals');
    document.getFormNamed(FORM_TRADE_SUMMARY).runScriptNamed('Apply.Stock.Performance');
    
    /**
     *
     * Refreshes the Trade Summary Layout. This module is called by the button that
     * that is on the Trade Summary Layout
     *
     */
    function refreshTradeSummaryLayout() {
    
    	let fldTradeId = record.getFieldValue('fld-5399c8a67ee44fc18239a890a5102d41');
    	let fldStockPerformanceKey = record.getFieldValue('fld-f5b68ce9937d4958a516862b502933b0');
    	
    	//-- Run modules to update Markdown fields in Trade Summary form
    	applyStockPerformance(fldStockPerformanceKey,fldTradeId);
    	form.saveAllChanges();
    	
    }
    refreshTradeSummaryLayout();
    July 24, 2020 at 12:29 PM #41500

    Rocky Machado
    Participant

    Here is the code for the module I call.

    /**
     *
     * Applies Stock Performance information to the markdown field
     *
     */
    function applyStockPerformance(stockPerformanceKey,searchTradeId){
    
    	let markDownContainer = [];
    
    	//-- Retrieve Stock Performance information in the Stock Performance form using search API
    	let recStockPer = document.getFormNamed(FORM_STOCK_PERFORMANCE).getRecordsForSearchTerm('"' + stockPerformanceKey + '"' )
    	for(recStock in recStockPer){
    		
    		let fldStockPerformanceKey = recStockPer[recStock].getFieldValue('fld-325a0d5c5b734711b94703573a13bd67');
    		if(fldStockPerformanceKey === stockPerformanceKey){
    			
    			//-- We have a match, let's get trade information to add ro markdown field
    			let fldStockSymbolFullname = recStockPer[recStock].getFieldValue('fld-117eea76f6f546ae8ec22c8131c5113e');
    			let fldYear = recStockPer[recStock].getFieldValue('fld-c1095d92dd0f4846ac168a9c17c2fc3e');
    			let fldNetProfit = recStockPer[recStock].getFieldValue('fld-8b5c80f8c002422baba6c46a294ec7e1');
    			let fldROI = recStockPer[recStock].getFieldValue('fld-7b2903e8fe8e4d04a3ac501916d168c6');
    			let fldInvtUsed = recStockPer[recStock].getFieldValue('fld-aa233adba9fb46ed9b5d0198283e531e');
    			let fldCommFees = recStockPer[recStock].getFieldValue('fld-4faf841e96b343f4b3398519c33e348e');
    			let fldWinningPct = recStockPer[recStock].getFieldValue('fld-360135113c3e4eebb656c6b7c804ceee');
    			let fldNbrOfTrades = recStockPer[recStock].getFieldValue('fld-31f66257104e4d30ae00ef3ccbf0894f');
    			let fldNbrOfWins = recStockPer[recStock].getFieldValue('fld-500c7f5c1bd34f7bb97d287359a9e4cf');
    			let fldNbrOfLosses = recStockPer[recStock].getFieldValue('fld-777f286c4ae34537889258f8ff89e064');
    			let fldAvgProfitPerTrade = recStockPer[recStock].getFieldValue('fld-78d916090b544d558655461058e56911');
    			let fldAvgWin = recStockPer[recStock].getFieldValue('fld-07b381c052f44daeb87eab12a6e9de97');
    			let fldAvgLoss = recStockPer[recStock].getFieldValue('fld-77afe5578e1844aa842808bde53bdb8e');
    			let fldMaxWin = recStockPer[recStock].getFieldValue('fld-41780c9ea8144638854f9437e09d5ec6');
    			let fldMaxLoss = recStockPer[recStock].getFieldValue('fld-e2d72f7755ef4a0db859c9f33d1dceee');
    			let fldMistakes = recStockPer[recStock].getFieldValue( 'fld-aa0c6ff57d554678bcdf70c0b23dd863');
    			
    			//-- Add to markdown container array
    			markDownContainer.push('- Year → ' + fldYear);
    			markDownContainer.push('- Net Profit → ' + utilFormatNumberToCurrency(fldNetProfit));
    			markDownContainer.push('- ROI → ' + utilFormatNumberToPercentage(fldROI));			markDownContainer.push('- Invt Used → ' + utilFormatNumberToCurrency(fldInvtUsed));
    			markDownContainer.push('- Comm / Fees → ' + utilFormatNumberToCurrency(fldCommFees));			markDownContainer.push('- Winning Pct → ' + utilFormatNumberToPercentage(fldWinningPct));
    			markDownContainer.push('- Nbr of Trades → ' + fldNbrOfTrades);
    			markDownContainer.push('- Nbr of Wins → ' + fldNbrOfWins );
    			markDownContainer.push('- Nbr of Losses → ' + fldNbrOfLosses);
    			markDownContainer.push('- Avg Profit Per Trade → ' + utilFormatNumberToCurrency(fldAvgProfitPerTrade));
    			markDownContainer.push('- Avg Win → ' + utilFormatNumberToCurrency(fldAvgProfitPerTrade));
    			markDownContainer.push('- Avg Loss → ' + utilFormatNumberToCurrency(fldAvgLoss));
    			markDownContainer.push('- Max Win → ' + utilFormatNumberToCurrency(fldMaxWin));
    			markDownContainer.push('- Max Loss → ' + utilFormatNumberToCurrency(fldMaxLoss));
    			markDownContainer.push('- Nbr of Mistakes → ' + fldMistakes);
    
    		}
    					
    	}
    	
    	//-- Continue if data exist in markdown container array
    	if(utilObjectIsEmpty(markDownContainer) == false){
    	
    	
    		//-- Retrieve Trades in the Trade Summary form using search API. Since we can have multiple 
    		//-- trades (per Trade Id). Let's update them all. 
    		let recTradeSum = document.getFormNamed(FORM_TRADE_SUMMARY).getRecordsForSearchTerm('"' + searchTradeId + '"' )
    		for(recSum in recTradeSum){
    			
    			let fldTradeId = recTradeSum[recSum].getFieldValue('fld-5399c8a67ee44fc18239a890a5102d41');
    			if (fldTradeId === searchTradeId){
    				
    				recTradeSum[recSum].setFieldValue('fld-709d377ef009465991162680f20758a3',markDownContainer.join("\n"));
    			
    			}
    		}
    	
    	}
    			
    	
    }
    July 25, 2020 at 11:35 AM #41509

    T.L. Ford
    Participant

    Thank you! I confess I was hoping for a “runs the View | Refresh Records menu item” done in some squirrely way I haven’t figured out yet, while we’re waiting on an update with this functionality. I may try swapping some of my document.saveAllChanges() over to form.saveAllChanges(). I’ve got a mucked up block of code that isn’t saving like it is supposed to (likely some record lock/race condition) I need to hunt down.

    July 25, 2020 at 4:05 PM #41517

    Rocky Machado
    Participant

    I’m looking forward when Brendan introduces a refresh feature in the API. FYI. I’ve had issue wher my data woouldn’t appear, etcc. If I know my code looks code then I do a compact database and relaunch the project. Most of the times that resolves my issues.

    Good Luck

Viewing 10 reply threads

You must be logged in to reply to this topic.