Forum Discussion
EverettPatterso
6 years agoQrew Captain
Post your formula for the Add Child buttons, you should be using the native
------------------------------
Everett Patterson
------------------------------
& "&z=" & Rurl()
and it should return to the correct tab after adding a child record. ------------------------------
Everett Patterson
------------------------------
BrandonClark
6 years agoQrew Cadet
Thanks for the reply Everett. Code from button below.
The issue is that the button to add the child record is not on the child record tab for us. It basically saves the user from having to click the tab header and then click add child. This way they just click add child and then when completed it returns them with the correct tab in focus so they can see it come through and review/edit if required.
URLRoot() & "db/" & [_DBID_CONTACTS] & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#])
& "&_fid_104=11"
& "&rdr="
& URLEncode(URLRoot() & "db/" & [_DBID_OPPORTUNITIES] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Related Company])& " &_fid_43=" & URLEncode ([Record ID#])& "&z=" & Rurl())
------------------------------
Brandon Clark
------------------------------
The issue is that the button to add the child record is not on the child record tab for us. It basically saves the user from having to click the tab header and then click add child. This way they just click add child and then when completed it returns them with the correct tab in focus so they can see it come through and review/edit if required.
URLRoot() & "db/" & [_DBID_CONTACTS] & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#])
& "&_fid_104=11"
& "&rdr="
& URLEncode(URLRoot() & "db/" & [_DBID_OPPORTUNITIES] & "?a=API_GenAddRecordForm&_fid_17=" & URLEncode ([Related Company])& " &_fid_43=" & URLEncode ([Record ID#])& "&z=" & Rurl())
------------------------------
Brandon Clark
------------------------------
- EverettPatterso6 years agoQrew CaptainSorry I must have misunderstood, you are wanting a function within the code page that looks at the value of _fid_104 and determines which tab to focus?
(function () { //Get the expected tab value var QBUmytab = Number($("#tdf_1").text()); //Go to tab based on value switch(QBUmytab) { case 3: $("#tab_t3_link a").click(); break; case 4: $("#tab_t4_link a").click(); break; };})();
------------------------------
Everett Patterson
------------------------------- BrandonClark6 years agoQrew CadetHi Everett,
I pasted the code in but nothing is happening. Do you by chance have any debugging code I can insert to see if the variable is passing in and if the cases are selecting properly?
Thanks!
Brandon
------------------------------
Brandon Clark
------------------------------- AustinK6 years agoQrew CommanderGiven the code above adding in the debugging is the easier part. You should get used to adding it in yourself because it helps you learn as you go.
What I would do is start simple, a console.log(QBUmytab); after the variable is set in the code. If you see that it is returning something then go from there. Make sure it is returning what is expected which is some type of number, and if it is returning anything but the numbers listed(3 or 4) then it doesn't have anything in the code to call. If it is returning a 3 or 4 then chances are the code for those may not be exactly right.