• Nik sh
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 8
    Replies
Hello 
As I am trying to show records in jquery.
Onloading page it appears,but select some records which should be assoicated with it,then it disappear.

Any help
  • March 20, 2019
  • Like
  • 0
Hello,

As I am trying to import conatct records when i select any Account records,on that basis the contact records will be shown.I am trying to use of it but getting records.

Any code snippet...will be appreciate.
  • March 19, 2019
  • Like
  • 0
public class abc{
	private final Id AccountId; 
	
	 public abc(ApexPages.StandardController stdController) {
       Account acc = (Account)stdController.getRecord();
       accountId = acc.Id;
   }
	
	@AuraEnabled
	public static Account getAccount(){
		 Account acc = [select Name,Phone,Id from Account where Id= :accountId];
		System.debug(acc.Id);
		return acc;
	}
}

 
Hi all,
Right now I am creating a pop on detail page button.Everything is fine except it's height can anyone help me on how to create a dynamic iframe using javascript?

Here is my code.
(function() {
    var width = 700;
    var height = 515;
    var title = "Dialog title here";

    var box = new SimpleDialog("salesforce" + Math.random(), true);
    box.setTitle(title);
    box.displayX = true;
    box.isMovable = false;
    box.createDialog();
    box.setWidth(width);
    // set your html content here
    box.setContentInnerHTML(
      '<iframe src="/apex/toastmessage?Id={!Account.Id}" style="border:none;" width="100%" height="'+ (height - 30)+'px" />'
    );
    //set the height of the modal
     box.dialog.children[1].style.height = height + 'px';
    box.show();

    //if displayX is set to true, then override standard close event by this code
    box.dialog.getElementsByClassName('dialogClose')[0].onclick = function() {
      box.hide();
      // you can add code to reload the page or redirect to another page 
    };
    //optional : add this to close the modal onclick of the overlay background
    box.background.addEventListener('click', function() {
      box.hide();
    });
    
    // if you want to be able to close the modal from the Visualforce page
    window.addEventListener('message', function(event){
      if (event.data === 'close'){
        box.hide();
      }
    });
})();

Thanks in advance
WHEN i RUN THIS PART OF THE CODE IT GIVES ME THE BELOW ERROR ALTHOUGH IT USED TO WORK BEFORE

 if(a[0].Product_Family__c == '360 Suite'){
            a[0].Status = 'Canceled';
        }
        




error:

System.ListException: List index out of bounds: 0
Hello 
As I am trying to show records in jquery.
Onloading page it appears,but select some records which should be assoicated with it,then it disappear.

Any help
  • March 20, 2019
  • Like
  • 0
Hello,

As I am trying to import conatct records when i select any Account records,on that basis the contact records will be shown.I am trying to use of it but getting records.

Any code snippet...will be appreciate.
  • March 19, 2019
  • Like
  • 0