Forum Post: RE: Related objects on default Rollbase mobile

  • Thread starter Thread starter Orchid Corpin
  • Start date Start date
Status
Not open for further replies.
O

Orchid Corpin

Guest
It seems like "Show record on Scope for New Object" is working on desktop version only. Here are the complete test codes which works in my test, change some IDs and fieldname. Parent View Page Code: script var sectionId; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { sectionId = rbf_getSectionIdByTitle("Desktop Section"); rbf_showOrHideSection(sectionId, false); console.log('You are using a mobile device!'); } else { sectionId = rbf_getSectionIdByTitle("Mobile Section"); rbf_showOrHideSection(sectionId, false); console.log('You are NOT using a mobile device!'); } /script !--Get the page ID in the Object definition Pages View Page Name -- a href="../b/mb.jsp?pageId=54383&relatedId={!id}" New Product /a div id="accountsList" {!#LOOP_BEGIN.R56036} div {!name#link} --- {!id} /div {!#LOOP_END.R56036} /div NEW page of Child Object Code: script //GET URL PARAMETER function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null } $(document).ready(function() { parentId = getURLParameter('relatedId'); $("#R56036 option[value='"+parentId+"']").attr('selected', 'selected'); //REFRESH SELECT ELEMENT - FOR MOBILE $('#R56036').selectmenu('refresh', true); }); /script How it works? In the View page of parent I added a URL attribute "relatedId" to the link ( a ... ) and so when user redirected to the Child's New page it carry over the parent ID/value. When the user is now in the Child's New page it can get the Parent's Value via URL parameter "relatedId" and set that to the parent lookup. Hope this helps. Regards, Orchid

Continue reading...
 
Status
Not open for further replies.
Back
Top