• AK_Smith
  • NEWBIE
  • 70 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 35
    Replies
Hello! 
Please help me with my VF page.
i need to update <p> from the CTPHARMA__Activity__c.SF1_Status__c (text formula) until y < 6 && z && u != "Win32" returns true
 
<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">

<p id="text"></p>

    </apex:form>
    
    
    <script>
    myFunction();
    function myFunction(){
    var x = {!CTPHARMA__Activity__c.SF1_Status__c};
    var y = {!CTPHARMA__Activity__c.SF1_Attempts__c};
    var z = {!CTPHARMA__Activity__c.SF1_Request_geo__c};
    var u = window.navigator.platform;
    
    do{
    
    document.getElementById("text").innerHTML = x;
     } 
     while (y < 6 && z && u != "Win32")
     }
     
    </script>
 
</apex:page>

 
Hello i need only to reload frame with VF page.
I use <apex:commandButton value="Check" id="checkBtn" oncomplete="window.location.reload( true );"/>, but it reloads parrent page inside the visual forece page, how to fix it?
How to reload/rerender VF Page frame by if condition. 
If CTPHARMA__Activity__c.SF1_Status__c contains ‘in progress ’ than refresh page else do nothing 
 
​<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">
<apex:outputText value="{!CTPHARMA__Activity__c.SF1_Status__c}" />
    </apex:form>
</apex:page>



 
Hello!
Is it possible to align text in the middle of VF page frame in SF1?  If my frame is to narrow  i get result like on the screen (green stripe)

Is it possible to align it on top of the frame?
User-added image
 
<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">
<apex:outputText value="{!CTPHARMA__Activity__c.SF1_Status__c}" />
    </apex:form>
</apex:page>




 
Hello! Please hellp me to fix my code to get user agent 
 
<apex:page standardController="CTPHARMA__Activity__c" id="page">

<script>
agent()
function agent() {
    var u = window.navigator.userAgent;
       document.getElementById('page:form:A').value  = 1;
       }
</script>




<apex:form id="form" >

<apex:inputField id="A"  value="{!CTPHARMA__Activity__c.SF1_UA__c}" /> 

</apex:form>



</apex:page>

 
Hello!
Is it possible to show force:showToast alert on VF page with only javascript?
Hello!
Is it possibe to send toast message in SF1 from visualforce page using Script? 
Hello!
Is it possible to use standart alerts like on screen below from the Visualforce page in SF1? 

User-added image
Hello! I trying to add +1 to field with the code below. But did not succeed
 
<script>
       plus()
        var a = {!Activity__c.SF1_Attempts__c};
        function plus(){
        document.getElementById('page:form:Attempts').value = a + 1;
        }

</script>


Attempts : <apex:inputField id="Attempts" value="{!Activity__c.SF1_Attempts__c}" />

 
Hello! how to run skript only if checkbox Project__c.check__c is checked
 
<script>
        var int=self.setInterval(function(){callActionFunction()},200);
        function callActionFunction(){
            ActionFunctionName();
        }

</script>

 
Hello! I have a problem with the visualforce page below. I use it in the Salesforce1. After the action="{!save}" VF page closes but the parent page stays the same with the olв values. How to re render/reload it automatically?
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">
<script>
geoFindMe()
function geoFindMe() {
  var output = document.getElementById("out");

  if (!navigator.geolocation){
    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
    return;
  }

  function success(position) {
    var latitude  = position.coords.latitude;
    var longitude = position.coords.longitude;

    document.getElementById('page:form:lati').value = latitude.toString().replace(".",",")  ;
    document.getElementById('page:form:long').value = longitude.toString().replace(".",",")  ; 
    document.getElementById('page:form:SF1').checked = true;

   
  };

  function error() {
    output.innerHTML = "Unable to retrieve your location";
  };

  navigator.geolocation.getCurrentPosition(success, error);
}
</script>

<script>
function reload(){
sforce.one.back(true);
}
</script>

   <script>
        var int=self.setTimeout(function(){callActionFunction()},200);
        function callActionFunction(){
            ActionFunctionName();
        }

</script>

<apex:form id="form">

  <div style="display:none;"></div>
latitude :<apex:inputField id="lati"  value="{!Project__c.l__c}" /> <br></br>
longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" />
<apex:inputField id="SF1" value="{!Project__c.SF1__c}" />

        <apex:actionFunction action="{!save}" name="ActionFunctionName"/>
                     
                     
                     
</apex:form>

</apex:page>

 
Hello! Please help me with the code below.
I created an action button that opens the VF page on SF1 record
After i hit SAVE button the  VF page closes but values in Project__c.l__c/Project__c.ll__c stays the same (old)
I have to pull down the page to see the results. 
how to automatically update the record window after clicking on the save button?
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">
<script>
geoFindMe()
function geoFindMe() {
  var output = document.getElementById("out");

  if (!navigator.geolocation){
    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
    return;
  }

  function success(position) {
    var latitude  = position.coords.latitude;
    var longitude = position.coords.longitude;

    document.getElementById('page:form:lati').value = latitude.toString().replace(".",",")  ;
    document.getElementById('page:form:long').value = longitude.toString().replace(".",",")  ; 
    document.getElementById('page:form:SF1').checked = true;

   
  };

  function error() {
    output.innerHTML = "Unable to retrieve your location";
  };

  navigator.geolocation.getCurrentPosition(success, error);
}
</script>


<apex:form id="form">

  <div style="display:none;"></div>
latitude :<apex:inputField id="lati"  value="{!Project__c.l__c}" /> <br></br>
longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" />
<apex:inputField id="SF1" value="{!Project__c.SF1__c}" />


<apex:commandButton action="{!save}"  value="Save"/>

                     
                     
                     
</apex:form>

</apex:page>

 
Hello!
im using action="{!save}" on my VF page in SF1. But when it close the window it does not refresh the page

how to fix it?
Hello! is there any option to use apex:actionPoller  without interval?
I need to execute action immediately

My code is
<apex:actionPoller action="{!save}" interval="5" oncomplete="reload()"/>
Hello!
How to run action="{!save}" and oncomplete="reload()"  automaticly on VF page in SF1 without apex:commandButton?
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">

<script>
function  reload(){
   sforce.one.back(true);
}
</script>

<apex:form id="form">

<apex:commandButton action="{!save}"  value="Save" oncomplete="reload()"/>
                      
</apex:form>

</apex:page>

Thank you!
Hello!
How to run my page in SF1 "onload"?
geoFindMe() than save and than reload()
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">
<p><button onclick="geoFindMe()">Show my location</button></p>
<p id="out"></p>
<script>

function geoFindMe() {
  var output = document.getElementById("out");

  if (!navigator.geolocation){
    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
    return;
  }

  function success(position) {
    var latitude  = position.coords.latitude;
    var longitude = position.coords.longitude;

    document.getElementById('page:form:lati').value = latitude.toString().replace(".",",")  ;
    document.getElementById('page:form:long').value = longitude.toString().replace(".",",")  ; 


   
  };

  function error() {
    output.innerHTML = "Unable to retrieve your location";
  };

  navigator.geolocation.getCurrentPosition(success, error);
}
</script>

<script>
function  reload(){
   sforce.one.back(true);
}
</script>

<apex:form id="form">


latitude :<apex:inputField id="lati"  value="{!Project__c.l__c}" /> 
longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" />

<apex:commandButton action="{!save}"  value="Save" oncomplete="reload()"/>
           
          
            
</apex:form>

</apex:page>

Thank you!
How to refresh parrent page in salesforce1 after save VF page 
My code is:
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">
<p><button onclick="geoFindMe()">Show my location</button></p>
<p id="out"></p>
<script>

function geoFindMe() {
  var output = document.getElementById("out");

  if (!navigator.geolocation){
    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
    return;
  }

  function success(position) {
    var latitude  = position.coords.latitude;
    var longitude = position.coords.longitude;

    document.getElementById('page:form:lati').value = latitude.toString().replace(".",",")  ;
    document.getElementById('page:form:long').value = longitude.toString().replace(".",",")  ; 


   
  };

  function error() {
    output.innerHTML = "Unable to retrieve your location";
  };

  navigator.geolocation.getCurrentPosition(success, error);
}
</script>
<apex:form id="form">

  
latitude :<apex:inputField id="lati"  value="{!Project__c.l__c}" /> 
longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" />

<apex:commandButton action="{!save}"  value="Save"/>
           
          
            
</apex:form>

</apex:page>


 
Hello!
I need to create button or action in Salesforce(1) app to fill in latitude and longitude fields on record. 
I tried to create javascript button, but it did not work in the mobile app
Hello! 
I need to remove "Edit | Del" from the related list. As far as i now, I need to create viaul force page, but i have no idea how to do it.
Master object: SubTarget__c
Related object is QTarget__c
Master-Detail field is SubTarget__c 00Nb000000AekhM

Can someonу help me with the code?
Hello!
Please help me to fix an error in my code
 
global class UpdateAct Implements Schedulable
    {
        global void execute(SchedulableContext sc)
        {
            doexecute();
        }

        public void doexecute()
        {
            list<CTPHARMA__Activity__c> AllRecords = new list<CTPHARMA__Activity__c>();
            AllRecords = [select Id  from CTPHARMA__Activity__c where Id = 'a028E000003U83o'];
            
            if (!allRecords.isEmpty) {
             for (CTPHARMA__Activity__c pg : allRecords){
              pg.RecordTypeId = '012b00000004hic';
                 }
            
            
            update AllRecords;
        }
    }
    }

 
Hello! 
Please help me with my VF page.
i need to update <p> from the CTPHARMA__Activity__c.SF1_Status__c (text formula) until y < 6 && z && u != "Win32" returns true
 
<apex:page standardController="CTPHARMA__Activity__c" id="page" docType="html-5.0">
<style>
.good{
text-align:center;
background-color: MediumSeaGreen;
font-weight: bold;
color: white;
}
.bad{
text-align:center;
background-color: Tomato;
font-weight: bold;
color: white;
}

.ugly{
text-align:center;
background-color: LightGray;
}


</style>
  
    <apex:form styleClass="{!if(CTPHARMA__Activity__c.SF1_Status__c == 'Подтвержден территориально','good',if(CTPHARMA__Activity__c.SF1_Status__c == 'Не подтвержден территориально','bad','ugly'))} ">

<p id="text"></p>

    </apex:form>
    
    
    <script>
    myFunction();
    function myFunction(){
    var x = {!CTPHARMA__Activity__c.SF1_Status__c};
    var y = {!CTPHARMA__Activity__c.SF1_Attempts__c};
    var z = {!CTPHARMA__Activity__c.SF1_Request_geo__c};
    var u = window.navigator.platform;
    
    do{
    
    document.getElementById("text").innerHTML = x;
     } 
     while (y < 6 && z && u != "Win32")
     }
     
    </script>
 
</apex:page>

 
Hello! Please hellp me to fix my code to get user agent 
 
<apex:page standardController="CTPHARMA__Activity__c" id="page">

<script>
agent()
function agent() {
    var u = window.navigator.userAgent;
       document.getElementById('page:form:A').value  = 1;
       }
</script>




<apex:form id="form" >

<apex:inputField id="A"  value="{!CTPHARMA__Activity__c.SF1_UA__c}" /> 

</apex:form>



</apex:page>

 
Hello!
Is it possible to show force:showToast alert on VF page with only javascript?
Hello! I trying to add +1 to field with the code below. But did not succeed
 
<script>
       plus()
        var a = {!Activity__c.SF1_Attempts__c};
        function plus(){
        document.getElementById('page:form:Attempts').value = a + 1;
        }

</script>


Attempts : <apex:inputField id="Attempts" value="{!Activity__c.SF1_Attempts__c}" />

 
Hello! how to run skript only if checkbox Project__c.check__c is checked
 
<script>
        var int=self.setInterval(function(){callActionFunction()},200);
        function callActionFunction(){
            ActionFunctionName();
        }

</script>

 
Hello! Please help me with the code below.
I created an action button that opens the VF page on SF1 record
After i hit SAVE button the  VF page closes but values in Project__c.l__c/Project__c.ll__c stays the same (old)
I have to pull down the page to see the results. 
how to automatically update the record window after clicking on the save button?
 
<apex:page standardController="Project__c" id="page" docType="html-5.0">
<script>
geoFindMe()
function geoFindMe() {
  var output = document.getElementById("out");

  if (!navigator.geolocation){
    output.innerHTML = "<p>Geolocation is not supported by your browser</p>";
    return;
  }

  function success(position) {
    var latitude  = position.coords.latitude;
    var longitude = position.coords.longitude;

    document.getElementById('page:form:lati').value = latitude.toString().replace(".",",")  ;
    document.getElementById('page:form:long').value = longitude.toString().replace(".",",")  ; 
    document.getElementById('page:form:SF1').checked = true;

   
  };

  function error() {
    output.innerHTML = "Unable to retrieve your location";
  };

  navigator.geolocation.getCurrentPosition(success, error);
}
</script>


<apex:form id="form">

  <div style="display:none;"></div>
latitude :<apex:inputField id="lati"  value="{!Project__c.l__c}" /> <br></br>
longitude :<apex:inputField id="long" value="{!Project__c.ll__c}" />
<apex:inputField id="SF1" value="{!Project__c.SF1__c}" />


<apex:commandButton action="{!save}"  value="Save"/>

                     
                     
                     
</apex:form>

</apex:page>