-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue passing recordId correctly #1
Comments
Hi, you'll need to create a separate JavaScript function for your button command to call, then your function should make the call to Alert.js to show the dialog using the dynamic parameters. You can see examples of this on the documentation tab, including the usage from ribbons. Hope that helps, Paul |
Yeah, I tried to figure that out, I think it's just beyond my technical abilities. I don't know how to write the custom function to call Alert.js properly I was able to get the show iFrame function to work for a simple url. Thanks for publishing this! |
Hi, you're pretty close already, just need to wrap your logic in a function, either inside your mag_testingdialog web resource, or another web resource, like:
Then in your ribbon command, just set the function name to callDialog. Note: you also don't need to specify any parameters in the ribbon command, as they're now all handled directly inside the function. |
Thanks so much Paul that worked perfectly. I appreciate you taking the time to help me!
Chris Rooney, Associate Analyst
[Logo]
1000 Century Blvd. Oklahoma City, OK 73110
Office: 405.426.4167
CenturyMartialArts.com
[fb]<http://www.facebook.com/CenturyMartialArts>[IG]<https://twitter.com/centuryma>[twitter]<http://instagram.com/centurymartialarts>[Youtube]<https://www.youtube.com/user/centurymartialarts>
From: Paul Nieuwelaar [mailto:notifications@github.com]
Sent: Thursday, October 12, 2017 3:53 PM
To: PaulNieuwelaar/alertjs <alertjs@noreply.github.com>
Cc: Rooney, Chris <crooney@centurymartialarts.com>; Author <author@noreply.github.com>
Subject: Re: [PaulNieuwelaar/alertjs] Issue passing recordId correctly (#1)
Hi, you're pretty close already, just need to wrap your logic in a function, either inside your mag_testingdialog web resource, or another web resource, like:
function callDialog() {
Alert.showDialogProcess("{the-guid-of-your-dialog}", "lead", Xrm.Page.data.entity.getId(), function() { Xrm.Page.data.refresh(); }, 1600, 900);
}
Then in your ribbon command, just set the function name to callDialog.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AfOwc70R-qxMnqMcuSKc1NZv_PCbVTx5ks5srnwggaJpZM4P3bkG>.
…________________________________
This email was scanned by Bitdefender
|
Sorry, I don’t mean to be annoying, last question I promise. I have one last task I am trying to execute.
Using Alert.ShowIFrame to open a URL that is contained in a text field on the form. I attempted to write a custom function, but the button does nothing on click. No issue with the function when I put the actual URL string as the first parameter.
My goal is to use getAttribute to return the string value as the parameter.
function callHubSpot() {
Alert.showIFrame(Xrm.Page.data.entity.getAttribute(cen_hubspotpublicurl).getValue(), 1600, 900, undefined, null, "https://devcencrm.centuryfitness.com/DEVCRM", false, null);
}
Thanks,
Chris Rooney, Associate Analyst
[Logo]
1000 Century Blvd. Oklahoma City, OK 73110
Office: 405.426.4167
CenturyMartialArts.com
[fb]<http://www.facebook.com/CenturyMartialArts>[IG]<https://twitter.com/centuryma>[twitter]<http://instagram.com/centurymartialarts>[Youtube]<https://www.youtube.com/user/centurymartialarts>
From: Paul Nieuwelaar [mailto:notifications@github.com]
Sent: Thursday, October 12, 2017 3:53 PM
To: PaulNieuwelaar/alertjs <alertjs@noreply.github.com>
Cc: Rooney, Chris <crooney@centurymartialarts.com>; Author <author@noreply.github.com>
Subject: Re: [PaulNieuwelaar/alertjs] Issue passing recordId correctly (#1)
Hi, you're pretty close already, just need to wrap your logic in a function, either inside your mag_testingdialog web resource, or another web resource, like:
function callDialog() {
Alert.showDialogProcess("{the-guid-of-your-dialog}", "lead", Xrm.Page.data.entity.getId(), function() { Xrm.Page.data.refresh(); }, 1600, 900);
}
Then in your ribbon command, just set the function name to callDialog.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AfOwc70R-qxMnqMcuSKc1NZv_PCbVTx5ks5srnwggaJpZM4P3bkG>.
…________________________________
This email was scanned by Bitdefender
|
Hi, looks like you just need to wrap cen_hubspotpublicurl in quotes, e.g. "cen_hubspotpublicurl". |
Hi, Haven't heard back from you so I'm going to assume you've managed to solve this now. Please feel free to to reply again if need any further assistance. Cheers, Paul |
Hello, I am trying to use the Alert.showDialogProcess function in Ribbon Workbench 2016 to trigger a dialog from a custom button on the form and I am unable to pass the Record ID as a parameter, it's passing the string value instead of the ID.
I am pretty new to JavaScript, so any guidance you could offer would be greater appreciated!
When I inspect the iFrame, here is what I see:
<iframe id="alertJs-iFrame" class="alert-js-iframe" src="https://devcencrm.centuryfitness.com/DEVCRM/cs/dialog/rundialog.aspx?DialogId=%7b2E75936F-9777-4DA1-B4EA 3D6657FF49E1%7d&EntityName=lead&ObjectId="Xrm.Page.data.entity.getId()" style="height: 897px;"></iframe>The text was updated successfully, but these errors were encountered: