Skip to content
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

Closed
crooney2016 opened this issue Oct 12, 2017 · 7 comments
Closed

Issue passing recordId correctly #1

crooney2016 opened this issue Oct 12, 2017 · 7 comments
Assignees

Comments

@crooney2016
Copy link

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>

capture

@PaulNieuwelaar
Copy link
Owner

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

@crooney2016
Copy link
Author

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!

@PaulNieuwelaar
Copy link
Owner

PaulNieuwelaar commented Oct 12, 2017

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. Note: you also don't need to specify any parameters in the ribbon command, as they're now all handled directly inside the function.

@PaulNieuwelaar PaulNieuwelaar self-assigned this Oct 12, 2017
@crooney2016
Copy link
Author

crooney2016 commented Oct 12, 2017 via email

@crooney2016
Copy link
Author

crooney2016 commented Oct 13, 2017 via email

@PaulNieuwelaar
Copy link
Owner

Hi, looks like you just need to wrap cen_hubspotpublicurl in quotes, e.g. "cen_hubspotpublicurl".

@PaulNieuwelaar
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants